Anda di halaman 1dari 622

Wonderware Factelligence

Client API Programmers Guide

Invensys Systems, Inc.

Revision A
Last Revision: 11/12/08

Copyright
2008 Invensys Systems, Inc. All Rights Reserved.
All rights reserved. No part of this documentation shall be reproduced, stored in a
retrieval system, or transmitted by any means, electronic, mechanical,
photocopying, recording, or otherwise, without the prior written permission of
Invensys Systems, Inc. No copyright or patent liability is assumed with respect to
the use of the information contained herein. Although every precaution has been
taken in the preparation of this documentation, the publisher and the author
assume no responsibility for errors or omissions. Neither is any liability assumed
for damages resulting from the use of the information contained herein.
The information in this documentation is subject to change without notice and does
not represent a commitment on the part of Invensys Systems, Inc. The software
described in this documentation is furnished under a license or nondisclosure
agreement. This software may be used or copied only in accordance with the terms
of these agreements.
Invensys Systems, Inc.
26561 Rancho Parkway South
Lake Forest, CA 92630 U.S.A.
(949) 727-3200
http://www.wonderware.com
For comments or suggestions about the product documentation, send an e-mail
message to productdocs@wonderware.com.

Trademarks
All terms mentioned in this documentation that are known to be trademarks or
service marks have been appropriately capitalized. Invensys Systems, Inc. cannot
attest to the accuracy of this information. Use of a term in this documentation
should not be regarded as affecting the validity of any trademark or service mark.
Alarm Logger, ActiveFactory, ArchestrA, Avantis, DBDump, DBLoad, DT Analyst,
Factelligence, FactoryFocus, FactoryOffice, FactorySuite, FactorySuite A2, InBatch,
InControl, IndustrialRAD, IndustrialSQL Server, InTouch, MaintenanceSuite,
MuniSuite, QI Analyst, SCADAlarm, SCADASuite, SuiteLink, SuiteVoyager,
WindowMaker, WindowViewer, Wonderware, Wonderware Factelligence, and
Wonderware Logger are trademarks of Invensys plc, its subsidiaries and affiliates.
All other brands may be trademarks of their respective owners.

Contents

Welcome.......................................... 19
Documentation Conventions.............................................19
Technical Support .............................................................20

Chapter 1 Introduction to Factelligence API Scripts in


ArchestrA ...................................... 21
Factelligence Client API Wrapper....................................22
Installing the Factelligence Client API Wrapper ............22
Accessing the Factelligence Client API Help File ...........23
Using the Factelligence Client API Functions ................23

Chapter 2 Using the Factelligence Client API ........... 27


Using Sessions ...................................................................28
Configuring UDAs for Sample Scripts ..........................28
Creating Sessions ...........................................................28
Starting Sessions ............................................................29
Logging into Sessions .....................................................29
Logging on to Entities ....................................................30
Monitoring Events in Sessions ......................................31
Interacting with Factelligence.......................................33
Logging off from Entities ...............................................37
Ending Sessions..............................................................38
Web Access.........................................................................39
Using Web Access ...........................................................39
Attrs Class .........................................................................43
Attrs Constructor ...........................................................43
AddLotAttrs() Method ....................................................43
GetAttrID() Method (String)..........................................44

Wonderware Factelligence Client API Reference Guide

GetAttrID() Method (String, Generic Nullable) ...........45


GetAttrs() Method ..........................................................46
GetAttrSet() Method ......................................................46
GetAttrsVisibleInInv Method........................................47
GetAttrValue() Method (String, String, String, String)48
GetAttrValue() Method (String, String, String, String,
String, String) ............................................................49
GetAttrValue() Method (String, String, String, String,
String, String, String, String) ...................................51
GetEntAttrs() Method (Int32) .......................................53
GetEntAttrs Method (Int32, Int32)...............................53
GetJobAttrs() Method ....................................................54
GetLotAttrs() Method.....................................................55
GetWOAttrs() Method....................................................57
PopupItemAttributes() Method (String) .......................57
PopupItemAttributes Method (String, Boolean) ..........58
PopupJobAttrsDlg Method (String, String, Int32, String)
59
PopupJobAttrsDlg() Method (String, String, Int32,
String, ColumnList) ...................................................60
PopupLotNoAttributes() Method (String, String) ........61
PopupLotNoAttributes() Method (String, String,
Boolean, ColumnList) ................................................62
SetAttrValue() Method (String, Object, String, String,
String, String, String, Boolean) ................................64
SetAttrValue() Method (String, Object, String, String,
String, String, String, String, String, Boolean) .......65
SetAttrValue() Method (String, Object, String, String,
String, String, String, String, String, String, String,
Boolean) ......................................................................68
SetLotAttrs() Method .....................................................70
ClientSession Class ...........................................................71
ChangePassword() Method ............................................72
ClearFormLoginStatus() Method ..................................73
CloseChildForms() Method ............................................74
End Session() Method ....................................................74
GetCurUserCurEntInfo Method (Int32, Int32) ............75
GetCurUserCurEntInfo Method (Object, Object).........76
GetDS() Method..............................................................77
GetDSbySQL() Method ..................................................78
GetInstance() Method ....................................................78
GetLangStringsObject() Method ...................................79
GetServerTime() Method ...............................................80
Login() Method ...............................................................80

Wonderware Factelligence Client API Reference Guide

LoginWithDialog() Method (String) ..............................81


LoginWithDialog() Method (String, Boolean, Boolean) 82
LoginWithDialog() Method (String, Boolean, Boolean,
Boolean) ......................................................................84
LoginWithDialog() Method (String, Boolean, Boolean,
Boolean, String) .........................................................85
LogOffAllUsers() Method ...............................................87
LogOffCurrentUser() Method ........................................87
LogOffUser() Method (String)........................................88
LogOffUser() Method (String, Boolean) ........................89
OnRefreshControls() Method .........................................90
PopupConfigureMiddlewareAccess() Method ...............90
PopupSwitchUserDialog() Method (String, String)......90
PopupSwitchUserDialog() Method (String, String,
Boolean) ......................................................................92
ReadTextFile() Method ..................................................93
RefreshCurUserStatusDataSet() Method .....................94
RegisterDNCControl() Method ......................................94
RemoveControlFromSingleSignOn() Method ...............95
SaveTextFile() Method ...................................................96
SendXMLCmd() Method (String) ..................................97
SendXMLCmd() Method (String, XMLParser) .............98
SendXMLCmd() Method (String, DateTime) ................99
SendXMLCmd() Method (String, Int32) .....................100
SendXMLCmd() Method (String, Int32, DateTime) ...101
SendXMLCmd() Method (String, Int32, String) .........102
SendXMLCmd() Method (String, String) ....................104
SendXMLCmd() Method (String, String, Int32) .........105
StartLoggingXMLMsgs() Methods ..............................106
StartSession() Method..................................................107
StopLoggingXMLMsgs() Method .................................108
SwitchUser() Method....................................................108
UnregisterDNCControl() Method ................................110
UpdateSystemParameter() Method.............................110
VerifyUser() Method.....................................................111
ApplicationName Property ..........................................112
ClientType Property .....................................................113
curUser Property ..........................................................113
DBMSName Property ..................................................114
EntitiesRequired Property ...........................................114
IsHostedByInTouch Property ......................................115
IsInTouchUserLoggedIn Property...............................115
IsSingleSignOnEnabled Property ...............................116

Wonderware Factelligence Client API Reference Guide

LicenseInfo Property .................................................... 116


MainForm Property...................................................... 117
MESVersion Property .................................................. 117
MiddlewareAccess Property......................................... 117
SelectForm Property .................................................... 118
SessionId Property ....................................................... 118
ShowLanguageIDs Property........................................ 119
SystemAttrs Property .................................................. 120
TopLevelFont Property ................................................ 120
UIPlatform Property .................................................... 121
UserList Property.........................................................121
Ent Class.......................................................................... 122
AddDirectory() Method (Int32, String) ....................... 122
AddDirectory() Method (Int32, Int32, String) ............ 123
AddShift() Method........................................................ 124
CopyEntityShiftSchedule() Method ............................ 127
DeleteShift() Method .................................................... 128
EndJob() Method .......................................................... 129
EntIdFromName() Method .......................................... 130
GetDirectories() Method (seqNo) ................................. 131
GetDirectories() Method (entID, seqNo) ..................... 132
GetEntAttributes() Method ......................................... 133
GetJobPos() Method ..................................................... 134
GetJobString() Method ................................................ 136
GetNumberOfJobsOnEntUserLoggedInto() Method.. 137
GetTagValue() Method................................................. 137
GetUsersOnEnt() Method ............................................ 138
GetEntityShiftSchedule() Method ............................... 139
GetEntAttributes() Method ......................................... 139
PauseJob() Method ....................................................... 140
ProcessJobsBeforeLogoff() Method.............................. 143
PromptForQuantities() Method................................... 144
PromptForQuantities() Method (String, String, String,
Int32, Double, Double, Double, String) .................. 144
PrepareProductionAttributes() Method ...................... 146
SetCurJobExec() Method (Int32)................................. 149
SetCurJobExec() Method (String, String, Int32)........ 150
SetEntAttributes() Method .......................................... 151
SetTagValue() Method ................................................. 152
StartJob() Method ........................................................ 154
UpdateEntity() Method ................................................ 155
UpdateJobExec() Method............................................. 160
UpdateShift() Method .................................................. 167

Wonderware Factelligence Client API Reference Guide

CanCaptureLabor Property .........................................170


CanCaptureUtil Property ............................................170
CanDoDNC Property....................................................171
CanLogData Property ..................................................171
CanRunJobs Property ..................................................172
CanSchedJobs Property ...............................................172
CanSchedShifts Property.............................................172
CanStore Property........................................................173
CanTrackOEE Property ...............................................173
CertExec Property ........................................................174
CurShiftDesc Property .................................................174
CurShiftID Property.....................................................175
CurShiftStartTime Property........................................175
DNCExec Property .......................................................176
EntDesc Property .........................................................176
EntID Property .............................................................176
EntName Property .......................................................177
FoldersExec Property ...................................................177
JobExec Property..........................................................178
LaborExec Property......................................................178
NumberOfJobsEntCanRun Property ..........................179
NumberOfRunningJobs Property................................179
OEEExec Property .......................................................180
Site Property.................................................................180
SiteName Property .......................................................181
StorageExec Property...................................................181
User Property ...............................................................182
UtilExec Property .........................................................182
Ents Class ........................................................................183
AddEntity() Method......................................................183
AddEntLink() Method ..................................................188
DeleteEntity() Method..................................................189
DeleteEntLink() Method ..............................................190
GetCountsAndDuration() Method ...............................191
GetEntChildren() Method ............................................194
GetEntityFromComboBoxEntry Method (Object, Int32,
String).......................................................................195
GetEntityFromComboBoxEntry Method (Object,
Generic Nullable, String).........................................196
GetEntProperties() Method .........................................197
NumberOfJobsRunning() Method ...............................198
PopulateEntityComboBox() Method (ComboBox,
Boolean) ....................................................................199

Wonderware Factelligence Client API Reference Guide

PopulateEntityComboBox() Method (ComboBox,


DataTable, Boolean) ................................................ 200
PrepareProductionAttributes() Method ...................... 201
PrepareProductionAttributes() Method ...................... 204
SelectEntityInComboBox() Method (ComboBox, Int32)...
207
SelectEntityInComboBox() Method (ComboBox, Generic
Nullable) ................................................................... 208
UpdateEntity() Method ................................................ 209
UpdateJobExec() Method............................................. 214
UpdateOEEExec() Method........................................... 221
UpdateUtilExec() Method ............................................ 224
Jobs Class ........................................................................ 227
AddConsDirect() Method ............................................. 227
AddConsPostExec() Method......................................... 231
AddJobEvent() Method ................................................ 236
AddProd () Method ....................................................... 242
AddProdPostExec() Method ......................................... 243
EndJob() Method .......................................................... 247
EndAllJobs () Method................................................... 249
GetAllJobStates() Method............................................ 250
GetConfirmation() Method........................................... 250
GetDownstreamOperations() Method ......................... 253
GetDownstreamProduction() Method ......................... 255
GetJob() Method ........................................................... 256
GetJobEvents() Method ............................................... 257
GetJobExecData() Method ........................................... 259
GetJobAttrs() Method (String, String, Int32)(Jobs Class)
260
GetJobAttrs() Method (String, String, Int32, Int32)(Jobs
Class) ........................................................................ 262
GetJobBomAvailSubst() Method (Jobs Class) ............ 263
GetJobBOMData() Method .......................................... 265
GetJobBOMProducibles() Method (Jobs Class) .......... 266
GetJobBomSubst() Method (Jobs Class) ..................... 268
GetJobBomSubstitutesForSerializedItem() Method .. 269
GetJobBOMWithSubData() Method (Jobs Class) ...... 270
GetJobEvents() Method ............................................... 272
GetJobQueue() Method ................................................ 273
GetJobsByWo() Method ............................................... 274
GetJobStateData() Method .......................................... 275
GetNextWOId() Method ............................................... 276
GetQueue() Method ...................................................... 276

Wonderware Factelligence Client API Reference Guide

GetScheduledJobForWo() Method ...............................278


GetStartQtyOfItemInWO() Method ............................279
GetWO() Method...........................................................280
GetWoForSerializedItems() Method............................281
GetWORouteData() Method.........................................282
IsFirstJob() Method......................................................283
ItemConsSplit() Method...............................................285
JobStateDesc() Method ................................................288
PopupCreateJobDialog() Method.................................289
PopupJobBOMDlg() Method ........................................290
PopupJobEventDlg() Method (Jobs Class) ..................291
PopupJobSplitDlg.........................................................293
PopupSelectPausedStateDlg() Method........................295
PopupStartSomeDlg() Method (String, Int32, String,
String, Int32, Double, Double, Double, Double).....297
PopupStartSomeDlg() Method (String, String, String,
Int32, Double, Double, Double, Double) .................299
SetJobConcurrentLink() Method.................................302
SetJobQueue() Method.................................................303
SetProdProcessedFlag() Method..................................305
SplitJob() Method .........................................................306
StartSome() Method .....................................................309
JobExec Class ..................................................................311
AddCons() Method ........................................................311
AddConsByLot() Method (String) ................................315
AddConsByLot() Method (String, Double) ..................315
AddProd() Method (Double) .........................................317
AddProd Method (Double, Object, String, String, Object,
Object, String, String, String, String, String) ........317
CalculateProductionTarget() Method..........................320
EndJob() Method ..........................................................321
GetAvailLots() Method.................................................322
GetBatchOfJobs() Method............................................323
GetConsData() Method ................................................324
GetJobBomAvailSubst() Method .................................325
GetJobBOMData() Method ..........................................326
GetJobBOMProducibles() Method ...............................326
GetJobBomSubst() Method ..........................................328
GetJobBOMWithSubData() Method ...........................328
GetJobEvents() Method................................................329
GetJobSchedData() Method .........................................331
GetProdData() Method.................................................331
GetProduction () Method..............................................332

Wonderware Factelligence Client API Reference Guide

10

GetQueue() Method ...................................................... 333


GetShortages() Method ................................................ 335
GetSPCCharJobData() Method ................................... 335
PauseJob() Method (JobStates, String, String, Int32,
String, Boolean, Int32)(JobExec Class) .................. 336
PauseJob() Method (JobStates, String, String, Int32,
String, Boolean, Int32, Boolean)(JobExec Class)... 338
PopUpAddConsDlg Method (String, Boolean, String,
String, Object, Boolean, Boolean, Boolean, Boolean,
Boolean, Double, Double, Double, Int32)................ 340
PopUpAddConsDlg() Method (String, Boolean, String,
String, Object, Boolean, Boolean, Boolean, Boolean,
Boolean, Double, Double, Double, Int32, Double,
Object, Object) .......................................................... 344
PopupAddProdDlg() Method (String, String, Boolean,
Double, Double, Double, String, DateTime, Int32) 348
PopupAddProdDlg() Method (String, String, Double,
Double, Double, String) ........................................... 350
PopupAddWasteDlg() Method ..................................... 352
PopupCreateJobDialog() Method ................................ 354
PopupEditConsDlg() Method ....................................... 354
PopupEditProdDlg() Method (String, String, Int32,
String, Int32, Int32, DateTime, Boolean, Double) . 356
PopupEditProdDlg() Method (String, String, Int32,
String, Int32, Int32, DateTime, Boolean, Double,
String)....................................................................... 358
PopupJobEventDlg() Method....................................... 361
PopupReduceConsDlg() Method .................................. 362
PopupReduceProdDlg() Method (DateTime, String,
String, String, Int32, Int32, String, Double, Double,
Double, Object, String, Int32, Boolean) .................. 365
PopupReduceProdDlg() Method (DateTime, String,
String, String, Int32, Int32, String, Double, Object,
String, Int32)............................................................ 369
PopupSetConsLotDataDlg() Method ........................... 371
PopupSetProdLotDataDlg() Method ........................... 373
ReadyJob() Method....................................................... 375
Refresh() Method .......................................................... 376
RejectProd() Method..................................................... 377
SetCurLotdata() Method.............................................. 378
SetUIScreenTagValues() Method ................................ 380
StartDataEntryJob() Method ...................................... 381
StartJob() Method ........................................................ 383
UnreadyJob() Method .................................................. 385
AllowZeroQtySplit Property ........................................ 386

Wonderware Factelligence Client API Reference Guide

11

AutoAllocateQtyToRunningJob Property ...................386


CanRunWithoutOperator Property .............................387
CertExecObject Property .............................................387
CurGoodQty Property ..................................................388
CurJobState Property ..................................................388
CurOperId Property .....................................................389
CurRejectQty Property.................................................389
CurSeqNo Property ......................................................390
CurWOId Property .......................................................390
DefConsReasCD Property ............................................390
DefConsReasDesc Property .........................................391
DefFromEntID Property ..............................................391
DefFromEntName Property ........................................392
DefLotNo Property .......................................................392
DefProdReasCD Property ............................................393
DefToEntID Property ...................................................393
DefToEntName Property .............................................393
JobPos Property............................................................394
JobStepExecObject Property .......................................394
SpecExecObject Property .............................................395
SuppressStartSomeQtyPrompt Property....................395
UserLoggedIn Property................................................396
LangStrings Class ...........................................................396
LangStrings Constructor .............................................397
LangStrings Constructor .............................................397
GetLanguages() Method...............................................398
Translate() Method.......................................................399
LangID Property...........................................................400
LicenseInfo Class.............................................................400
MaxSessions() Method .................................................401
ModuleLicensed() Method ............................................401
OEEExec Class ................................................................402
GetValue() Method .......................................................402
Refresh() Method ..........................................................404
CurrentOEE Property ..................................................405
CurrentPerf Property ...................................................405
CurrentQual Property ..................................................405
TargetOEE Property ....................................................406
TargetPerf Property .....................................................406
TargetQual Property ....................................................407
Operations Class .............................................................407
GetOperationDataFromComboBoxEntry() Method ...407

Wonderware Factelligence Client API Reference Guide

12

GetOperationsForWorkOrder() Method...................... 408


PopulateComboBoxWithOperations() Method............ 409
PopulateComboBoxWithSeqNos() Method.................. 410
PersistImage Class.......................................................... 412
ListImageNames() Method .......................................... 412
LoadImage() Method .................................................... 412
SaveImage() Method .................................................... 413
Priv Class......................................................................... 414
Priv Constructor ........................................................... 414
Desc Property ............................................................... 415
Id Property.................................................................... 415
Value Property.............................................................. 416
Shifts Class ...................................................................... 416
AddEntShift() Method.................................................. 416
DefineShift () Method................................................... 419
DeleteEntShift() Method.............................................. 420
DeleteShift() Method .................................................... 421
GetAllShifts() Method .................................................. 422
GetShiftDataFromComboBoxEntry() Method ............ 422
GetShiftID() Method .................................................... 424
PopulateComboBoxWithShiftDescs() Method ............ 424
UpdateEntShift() Method ............................................ 425
UpdateShift() Method .................................................. 428
SystemAttr Class ............................................................ 429
System Attr Constructor.............................................. 429
System Attr Constructor.............................................. 430
AttrDesc Property ........................................................ 432
AttrId Property............................................................. 432
AttrSeq Property .......................................................... 433
AttrValue Property....................................................... 433
Constraints Property.................................................... 433
EditType Property........................................................ 434
GrpId Property ............................................................. 435
ReqdLicenses Property................................................. 435
SystemAttrs Class........................................................... 436
Item Property ............................................................... 436
UIConfig Class ................................................................ 436
DeleteUIConfigDefaultValue() Method....................... 436
DeleteUIConfigValue() Method ................................... 437
GetParameterValue() Method ..................................... 439
ReadUIConfigDefaultValue() Method......................... 440
ReadUIConfigValue() Method ..................................... 441

Wonderware Factelligence Client API Reference Guide

13

RestoreControlsVisibility() Method.............................442
RestoreControlsVisibilityFromDefaults() Method......444
RestoreTabsVisibilityFromDefaults() Method............445
SaveControlsVisibility() Method .................................446
SaveControlsVisibilityAsDefaults() Method ...............447
SaveTabsVisibility() Method........................................448
SaveTabsVisibilityAsDefaults() Method .....................450
SaveUIConfigDefaultValue() Method .........................451
SaveUIConfigDefaultValues() Method........................452
SaveUIConfigValue() Method ......................................453
SaveUIConfigValues() Method ....................................455
User Class ........................................................................456
User Constructor ..........................................................456
AddUserToGroups () Method .......................................457
ChangePassword() Method ..........................................458
CloneUser() Method .....................................................459
GetEntList() Method ....................................................460
IsUserLoggedIntoJob() Method (Int32, String, String,
Int32) ........................................................................461
IsUserLoggedIntoJob() Method (String, String, Int32)....
462
IsUserLoggedOntoEnt() Method .................................463
JobBasedLogin() Method..............................................464
LogoffEnt Method.........................................................465
LogoffEntList() Method................................................465
LogOffJob() Method......................................................466
LogOffJobWithDialog() Method...................................468
LogonEnt() Method.......................................................469
LogonEntList() Method (Int32[]) .................................470
LogonEntList() Method (String, DataTable)...............471
LogonEntWithDialog() Method (Boolean)...................472
LogonEntWithDialog() Method (Boolean, Object) ......473
LogonEntWithDialog() Method (Boolean, Object, String)
474
LogOnJob() Method ......................................................475
MayAccessEntity() Method ..........................................477
RefreshCurUserStatusRecordset() Method ................478
RefreshCurUserStatusRecordset Method (DataSet)..478
SaveEntList() Method ..................................................479
UpdateUser() Method...................................................480
curEnt Property............................................................481
EntList Property...........................................................482
EntsStatusInfo Property ..............................................482

Wonderware Factelligence Client API Reference Guide

14

LangStrings Property................................................... 483


Privs Property............................................................... 483
UserDisplay Property................................................... 484
UserDisplayWithLabel Property ................................. 484
UserID Property ........................................................... 485
UserName Property ..................................................... 485
UserPrivs Class ............................................................... 485
UserPrivs Constructor ................................................. 486
GetPrivObject() Method ............................................... 486
Item Property ............................................................... 487
Users Class ...................................................................... 488
AddUser() Method ........................................................ 488
FormatUser() Method .................................................. 489
GetUserDataFromComboBoxEntry Method............... 490
GetUsers() Method ....................................................... 491
GetUsers() Method (Boolean) ...................................... 492
PopulateComboBoxWithUsers() Method .................... 493
UserGrp Class ................................................................. 494
AddUserGroup() Method.............................................. 494
CloneUserGroup() Method........................................... 495
DeleteUserGroup() Method.......................................... 496
GetGroupId() Method................................................... 497
GetUserGroups() Method............................................. 498
GetUserGroups() Method............................................. 499
GetUserGroupEntities() Method ................................. 499
Set UserGroupEntityAccess() Method ........................ 500
GetUserGroupLinks() Method..................................... 502
GetUserGroupLinks() Method..................................... 502
GetUserGroupLinks() Method..................................... 503
GetUserGroupLinks() Method..................................... 504
SetUserGroupPrivileges() Method .............................. 505
SetUserGroupPrivValue() Method .............................. 507
UpdateUserGroup() Method ........................................ 508
Util Class ......................................................................... 509
GetOEEExecData() Method......................................... 509
GetOldAvailableReasons() Method ............................. 510
GetUtilExecData() Method .......................................... 511
GetUtilLogData() Method............................................ 512
GetUtilReasons() Method ............................................ 513
SetRawReason() Method.............................................. 514
UtilExec Class ................................................................. 516
UtilExec Constructor ................................................... 516

Wonderware Factelligence Client API Reference Guide

15

GetCountsAndDuration() Method ...............................517


GetOldAvailableReasons() Method .............................519
GetUtilExecData() Method ..........................................520
GetUtilLogData() Method ............................................520
GetUtilReasons() Method.............................................521
GetUtilByFilter() Method ............................................522
GetUtilByTimePeriod() Method ..................................526
Refresh() Method ..........................................................528
CurrentUtil Property ...................................................529
TargetUtil Property......................................................529
UtilReasCd Property ....................................................530
UtilReasReqd Property ................................................530
UtilReasStart Property ................................................531
UtilStateCd Property ...................................................531
UtilStateColor Property ...............................................532
Utility Class.....................................................................532
CloseIPForm() Method .................................................532
ConvertStringToEnum() Method.................................533
FindButtonBar() Method .............................................534
FormatDuration() Method ...........................................534
GetAutoLoginUserId() Method ....................................535
GetAutoLoginUserPw() Method ..................................536
GetAutoLogonEntId() Method .....................................536
GetAutoLogonEntIds() Method ...................................537
GetCodeColor() Method................................................537
GetItemGrade() Method...............................................538
GetListIndex() Method.................................................539
GetOperEntLinkData() Method ..................................540
GetStringFromConfigFile() Method ............................541
GetTopLevelForm() Method.........................................542
GetTopLevelFormName() Method...............................542
InspectorLogin() Method (String, Boolean, String,
String, User).............................................................543
InspectorLogin() Method (String, Boolean, String,
String, User, Boolean, String) .................................545
ItemIDorDesc() Method................................................546
LaunchExternalApplication() Method (String, Boolean) .
547
LaunchExternalApplication() Method (String, DataRow,
Boolean) ....................................................................548
LaunchStepDocument() Method (String, String) .......549
OpenIPForm() Method (String) ...................................550
OpenIPForm() Method (String, FormOpenType) .......551

Wonderware Factelligence Client API Reference Guide

16

OpenIPForm() Method (String, FormOpenType, String).


552
PadDuration() Method ................................................. 553
ParseDuration() Method .............................................. 553
ParseNameAndArgs() Method..................................... 554
PopupContextMenu() Method...................................... 556
PopupDateTimeEntry() Method .................................. 557
PopupDurationEntry() Method (Control, Int32, Int32,
Int32, Int32, Boolean).............................................. 558
PopupDurationEntry() Method (NumericUpDown,
MaskedTextBox, MaskedTextBox, Int32, Int32, Int32,
Int32) ........................................................................ 559
PopupEntitySelection() Method (EntityCapabilities,
Boolean, Int32, Boolean, Int32, String, String) ..... 561
PopupEntitySelection() Method ...... (EntityCapabilities,
Boolean, Int32, Int32, String, String)..................... 563
PopupEntitySelection() Method (EntityCapabilities,
Boolean, Int32, String) ............................................ 565
PopupEntitySelection() Method (EntityCapabilities,
Int32, Int32, String)................................................. 566
PopupEntitySelection() Method (EntityCapabilities,
Int32, String)............................................................ 567
PopupEntitySelection() Method (EntityCapabilities,
Int32, String)............................................................ 569
PopupEntitySelection() Method (String)..................... 570
PopupHideControlsForm() Method (Control) ............. 570
PopupHideControlsForm() Method (Control, String,
String, String, Boolean)........................................... 571
PopupHideTabsForm() Method ................................... 573
PopupItemReasonSelection() Method (Boolean, Int32,
String)....................................................................... 574
PopupItemReasonSelection() Method (String, Int32,
Boolean, Boolean, Int32, String) ............................. 575
PopupKeyboard() Method ............................................ 576
PopupKeypad() Method (String, Int32, Decimal,
Decimal, Double)...................................................... 577
PopupKeypad() Method (Control)................................ 579
PopupLotAttributes() Method (String, String) ........... 579
PopupLotAttributes() Method (String, String, Boolean)..
580
PopupNotesDlg() Method............................................. 581
PopupOperationSelection() Method ............................ 583
PopupUtilReasonSelection() Method .......................... 584
PopupWorkOrderSelection() Method .......................... 586
ResizeWindowBasedOnFont() Method........................ 587

Wonderware Factelligence Client API Reference Guide

17

SetFont() Method..........................................................588
SetTextFromKeyPad() Method (Control, String) .......589
SetTextFromKeyPad() Method (Control, String, Int32) ..
590
ShowHelpFile() Method ...............................................591
ShowJobFlowDiagram() Method .................................591
TranslateForm() Method (Control)..............................592
TranslateForm() Method (Control, ILanguageStrings)....
593
UtilRawReason Class......................................................594
AddUtilRawReasonLink() Method ..............................594
Delete() Method ............................................................595
DeleteUtilRawReasonLink() Method ..........................596
GetAllUtilRawReasonLinks() Method ........................597
GetAllUtilRawReasonLinks() Method ........................598
GetAllUtilRawReasonLinks() Method ........................599
GetAllUtilRawReasonLinks() Method ........................600
GetAllUtilRawReasonLinks() Method ........................600
GetUtilRawReasons() Method .....................................601
GetUtilRawReasons() Method .....................................602
Refresh() Method ..........................................................603
Save() Method ...............................................................604
UtilReason Class .............................................................604
Delete() Method ............................................................604
GetUtilReasons() Method.............................................605
LoadHashTableWithUtilReasonData() Method .........605
Refresh() Method ..........................................................606
Save() Method ...............................................................606
UtilReasonGrp Class.......................................................607
Delete() Method ............................................................607
GetUtilReasonGroups() Method ..................................608
Refresh() Method ..........................................................608
Save() Method ...............................................................609
UtilState Class ................................................................610
Delete() Method ............................................................610
GetAllStates() Method..................................................610
GetStateDataFromComboBoxEntry() Method ...........611
PopulateComboBoxWithEntStates() Method .............612
Refresh() Method ..........................................................613
Save() Method ...............................................................613

Index ............................................. 615


Wonderware Factelligence Client API Reference Guide

18

Wonderware Factelligence Client API Reference Guide

19

Welcome

This guide shows you how to use the Factelligence Client API
within the ArchestrA Integrated Development Environment
(IDE) to develop and customize ArchestrA scripts.
You can view this document online or you can print it, in part
or whole, by using the print feature in Adobe Acrobat Reader.
This guide assumes you know how to use Microsoft Windows,
including navigating menus, moving from application to
application, and moving objects on the screen. If you need
help with these tasks, see the Microsoft online help.
In some areas of the Industrial Application Server, you can
also right-click to open a menu. The items listed on this menu
change, depending on where you are in the product. All items
listed on this menu are available as items on the main
menus.

Documentation Conventions
This documentation uses the following conventions:
Convention

Used for

Initial Capitals

Paths and file names.

Bold

Menus, commands, dialog box names,


and dialog box options.

Monospace

Code samples and display text.

Wonderware Factelligence Client API Reference Guide

20

Welcome

Technical Support
Wonderware Technical Support offers a variety of support
options to answer any questions on Wonderware products
and their implementation.
Before you contact Technical Support, refer to the relevant
section(s) in this documentation for a possible solution to the
problem. If you need to contact technical support for help,
have the following information ready:

The type and version of the operating system you are


using.

Details of how to recreate the problem.

The exact wording of the error messages you saw.

Any relevant output listing from the Log Viewer or any


other diagnostic applications.

Details of what you did to try to solve the problem(s) and


your results.

If known, the Wonderware Technical Support case


number assigned to your problem, if this is an ongoing
problem.

Wonderware Factelligence Client API Reference Guide

21

Chapter 2
Introduction to Factelligence
API Scripts in ArchestrA

Factelligence client controls can use the Factelligence Client


API to access and interact with Factelligence middleware.
However, if you attempt to use the Factelligence Client API
in ArchestrA scripts, events and exceptions are not handled
correctly.
To avoid these ArchestrA scripting limitations, you can use
the Factelligence Client API wrapper to access Factelligence
Client API functionality in ArchestrA scripts.
This section shows how to:

Identify the Factelligence Client API wrapper.

Install the Factelligence Client API wrapper.

Use Factelligence Client API Wrapper functions.

Use the Factelligence Client API help file.

Wonderware Factelligence Client API Reference Guide

22

Chapter 2 Introduction to Factelligence API Scripts in ArchestrA

Factelligence Client API Wrapper


Factelligence API wrapper class names start with aa and
their functionality corresponds to their equivalent
Factelligence Client API functions.
Client API Function

Client API Wrapper Class Name

AddAttrArrayList

aaAddAttrArrayList

ClientSession

aaClientSession

Users

aaUsers

Application Server scripting can access the Factelligence


client API wrapper from:

Scripts tab of any automation object.

Any script window within ArchestrA symbols, such


as, the symbol script, the event script, or action
scripts for individual elements on the canvas.

Installing the Factelligence Client API


Wrapper
The Factelligence Client API wrapper is contained in a set of
DLL files. You can install the Factelligence Client API
wrapper by importing an aaSLIB file from the Factelligence
installation image.
To install the Client API Wrapper
1

Open the ArchestrA IDE.

Select the Galaxy menu, point to Import, and then Script


Function Library. The Import Script Function Library dialog
box appears.

Browse to the \Program


Files\Wonderware\Factelligence\Controls folder on your
local hard drive.

Note If you selected to install the .NET Controls during your


Factelligence installation the aaFactMES.aaSLIB file will be copied
into your local hard drive. You can also browse onto the
Factelligence Installation CD and copy the file manually from the
\Factelligence\Controls directory.
4

Select the aaFactMES.aaSLIB file and click Open. The script


library is imported and a success message appears.

Click OK.

Wonderware Factelligence Client API Reference Guide

Accessing the Factelligence Client API Help File

23

Accessing the Factelligence Client API Help


File
The Factelligence Client API help file
(FactMESClientCommon.chm) is located on the Factelligence
installation CD in the \Factelligence\Docs folder.
You can browse the installation CD and open the file directly,
or copy the file to your hard drive for future reference.

Using the Factelligence Client API Functions


To use Factelligence Client API functions in an ArchestrA
script, you need to know the following:

Function name

Function parameters

Purpose and data type of the return result

The class to which the function belongs

The FactMESClientCommon.chm help file contains two


entries for each function:

Base Client API functions

Client API Wrapper functions

Client API wrapper classes are prefixed with aa under the


aaFactMES node of the help file and used when scripting for
Factelligence functionality.

Wonderware Factelligence Client API Reference Guide

24

Chapter 2 Introduction to Factelligence API Scripts in ArchestrA

Base client API functions with more complete descriptions


are found under the FactMES.Client.Common node of the
help file and should only be used for functional reference
when scripting with the client API wrapper.

Important All Factelligence API scripting in the ArchestrA IDE


requires the use of the Client API wrapper. The base Client API
library is included in the help file for functional reference.
To determine the API function name and its parameters
1

Open the Factelligence Client API help file


(FactMESClientCommon.chm).

On the left pane, locate the class or function you want to


use. You can also click the Search tab to search the help
file for the class or function.

Read the syntax of the [Visual Basic (Declaration)]


section in the right pane. For example:
Public Function IsUserLoggedOntoEnt( _
ByVal entId As Integer _
) As Result

The data types appear underlined in blue. The preceding


example includes an integer data type.
Note The data type of the function result for the new API
functions appears as Result. To determine the data type of the
result, complete the following procedure.
To determine the data type of the function return result
1

Open the Factelligence Client Scripting Library help file


(FactMESClientCommon.chm).

Wonderware Factelligence Client API Reference Guide

Using the Factelligence Client API Functions

25

On the left pane, locate the function for which you want
to determine the return result data type.

Locate the equivalent legacy method. For example, the


aaUser.IsUserLoggedOntoEnt() method has the
User.IsUserLoggedOnToEnt() legacy method.

In the syntax for Visual Basic, read the data type of the
return result. In this example it would be Boolean.

Expand the aaFactMES, Result Structure, Result


Fields nodes in the help file and locate the equivalent
data type. The right pane contains further information on
the data type.

Wonderware Factelligence Client API Reference Guide

26

Chapter 2 Introduction to Factelligence API Scripts in ArchestrA

Wonderware Factelligence Client API Reference Guide

27

Chapter 3
Using the Factelligence Client API

Using Factelligence Client API scripts in ArchestrA follows


the same rules and conventions as required when creating
objects in the Application Server. It is important to use the
Factelligence Client API wrapper functions at all times.
This section explains how to use several pre-built API
scripts. These scripts illustrate the basic coding required to
use the full range of Factelligence API functions.
The example code illustrates common programming
techniques related to using the API.
Task

Sample Script

Create and log into a session.

Init

Log on to an entity.

LogonEnt

Get information about an


entity.

ShowEntityData

Get information about the


current user.

GetCurrentUserInfo

Get information when the user


logon changes.

UserChanged

Monitor events.

MonitorEvents

Log off an entity.

LogOffEnt

Close and log off from a


session.

Term

Wonderware Factelligence Client API Reference Guide

28

Chapter 3 Using the Factelligence Client API

Using Sessions
The key to writing script for Factelligence is the session.
In order to use any Factelligence functionality, you must first
create a session.

Configuring UDAs for Sample Scripts


The following UDAs (User Defined Attribute) need to be
configured for a custom application object to use the sample
scripts:
1

EntityName
The EntityName attribute is a string used as an input
argument to several scripts.

UserChanged
The UserChanged attribute is a string that is set by the
MonitorEvents script to trigger the UserChanged script.

LogonEntTrig
The LogonEntTrig attribute is a Boolean value that ,
when set to TRUE, triggers the LogonEnt script.

LogoffEntTrig
The LogoffEntTrig attribute is a Boolean value that,
when set to TRUE, triggers the LogOffEnt script.

GetCurUserInfoTrig
The GetCurUserInfoTrig is a Boolean value that, when
set to TRUE, triggers the GetCurrentUserInfo script.

ShowEntityDataTrig
The ShowEntityDataTrig is a Boolean value that, when
set to TRUE, triggers the ShowEntityData script.

Creating Sessions
You use the aaFactMES.aaClientSession object to create and
manage a Factelligence session. There is only one
aaFactMES.aaClientSession object created for an
application, but there may be many references to that object.
You get a reference to the object by calling the
aaFactMES.aaClientSession.GetInstance method. The first
time this method is called, it creates the object; all
subsequent calls return a reference to that object.
For an example, see the Example: Init Script on page 29.

Wonderware Factelligence Client API Reference Guide

Using Sessions

29

Starting Sessions
After you create an aaFactMES.aaClientSession object, you
can use it to start a Factelligence session with the
Factelligence middleware. The Factelligence middleware
requires a session in order for most functions to work.

Example: Init Script


You can call the Init script to start a session, initialize any
attributes and log on a user. The Init script should be called
one time by one Application Object.
If you use the Init script to log on a user, you must change
the user and password in the Login method.
You can use the Init script as either an OnScan or Execute
script with some attribute-based trigger. If you use it as an
Execute script, you should mark it as an asynchronous script.
' Init Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
' Get the singleton client session - if one doesn't exist yet,
' it will be created
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if ( clientSession <> null and clientSession.SessionId == -1) then
' Start the session. Only do this if a session isn't already started
result = clientSession.StartSession(aaFactMES.aaClientTypes.clientOperator);
if (result.Success == true) then
LogMessage("Session Started!");
' Login a user - this should cause a UserChanged event (see MonitorEvents script)
result = clientSession.Login("fact_user", "fact_user_pswd");
if (result.Success == true) then
LogMessage("Login succeeded!");
endif;
else
LogMessage("Session failed to start!");
endif;
endif;

Logging into Sessions


After you have started a session, you need to log one or more
users into the session.

Wonderware Factelligence Client API Reference Guide

30

Chapter 3 Using the Factelligence Client API

The aaFactMES.ClientSession object can manage multiple


users logged into a session at once, but there will only every
be one user that is the current user for which commands are
being executed.
All Factelligence commands must be executed for a user, and
most commands must be executed for an entity. If you are
using Factelligence controls in your application, they can be
set up to log the user into the Factelligence either by using
the current InTouch user or by prompting the user to login.
You can also write script to log a user in. If you know the
user's Factelligence user ID and password, you can call the
Login method in aaFactMES.aaClientSession to directly login
the user or you can call the LoginWithDialog method in
aaFactMES.aaClientSession to open the Factelligence login
dialog box.
For an example, see the Example: Init Script on page 29.

Logging on to Entities
After the user logs in, the user will need to log on to one or
more entities. If you are using Factelligence controls in your
application, they can be set up to display a dialog for allowing
the user to log onto one or more entities.

Example: LogonEnt Script


You can call the LogonEnt script after setting UDA
(me.EntityName) with the entity name you want to log on.
You should mark this as an asynchronous script.

Wonderware Factelligence Client API Reference Guide

Using Sessions

31

You can use the LogonEnt script as an Execute or OnTrue


script with a UDA trigger (me.LogonEntTrig).
' LogonEnt Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
dim entityID as Integer;
' reset the trigger
me.LogonEntTrig = false;
' Get the singleton client session
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if ( clientSession <> null ) then
if ( clientSession.curUser <> null and me.EntityName <> "" ) then
' get Entity ID from input UDA Entity Name
result = aaFactMES.aaEnt.EntIdFromName( me.EntityName );
if ( result.Success == true and result.Int32_Value <> -1) then
' go an entity ID - attempt to logon
entityID = result.Int32_Value;
result = clientSession.curUser.LogonEnt( entityID, "", 100.0 );
if ( result.Success == true ) then
' Print Success message
LogMessage(clientSession.curUser.userName + " has logged onto entity
" + me.EntityName + " - id=" + StringFromIntg(entityID, 10) );
endif;
else
' Failed to get Entity ID from Entity Name
LogMessage("Entity " + me.EntityName + " does not seem to exist");
endif;
endif;
endif;

Monitoring Events in Sessions


When a new user logs onto a session, or the current user is
changed, the aaFactMES.aaClientSession object can inform
you of this fact. To do this you need to set a UDA to
UserChanged_DateTime variable in the
aaFactMES.aaClientSession object. You must then create a
Data Change script triggered by this UDA.

Example: Monitor Events Script


You can call the MonitorEvents script to check for new
events that have occurred on the aaFactMEScontrol.

Wonderware Factelligence Client API Reference Guide

32

Chapter 3 Using the Factelligence Client API

You can use the MonitorEvents script as an Execute / Periodic


script with a trigger period of 00:00:01.0000000.
' MonitorEvents Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
' Get the singleton client session
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if (clientSession <> null) then
' Get the DateTime of each event we are interested in
' and store it in a UDA. The DateTime will
' change each time the event fires. Use the UDA as a trigger
' on another event handler script (see UserChanged script)
' NOTE: the UserChanged UDA should be a string
me.UserChanged = clientSession.UserChanged_DateTime;
endif;

Example: UserChanged script


You can call the UserChanged script when the trigger UDA
changes. The trigger indicates that an event has arrived and
should be processed.
Every event in the Client API will have a date time property
exposed in the Client API Wrapper. Every time an event is
fired the date time property associated with that event will
be updated with the date time the event was fired. The user
will then have to poll this property and keep track of its value
so they can determine when an event occurred. The polling
script will change the trigger UDA when it finds that a
change has occurred.
Every event in the Client API will have a date time property
exposed in the Client API Wrapper. Every time an event is
fired the date time property associated with that event will
be updated with the date time the event was fired. The user
will then have to poll this property and keep track of its value
so they can determine when an event occurred.

Wonderware Factelligence Client API Reference Guide

Using Sessions

33

You can use the UserChanged script as an Execute or Data


Change script with a trigger UDA (me.UserChanged) that is
set in the Monitor Events script.
' UserChanged Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
dim userName as string;
' Get the singleton client session
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
userName = "???";
if (clientSession <> null) then
if (clientSession.UserChanged_e <> null) then
if (clientSession.UserChanged_e.UserObject <> null) then
userName = clientSession.UserChanged_e.UserObject.User
endif;
endif;
LogMessage("User changed to " + userName );
endif;

Interacting with Factelligence


After you have a user logged into a session and on to an
entity, you can start calling methods to interact with
Factelligence.

Example: Show Entity Data Script


You can trigger the ShowEntityData script after setting the
UDA Trigger (me.EntityName) with the Entity Name you
want to obtain information. You must be logged on to the
entity.
You can use the ShowEntityData script as an Execute or
OnTrue script with a UDA trigger (me.ShowEntityDataTrig).
' ShowEntityData Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
dim entity As aaFactMES.aaEnt;
' reset the trigger
me.ShowEntityDataTrig = false;

Wonderware Factelligence Client API Reference Guide

34

Chapter 3 Using the Factelligence Client API

' Get the singleton client session


result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if ( clientSession <> null ) then
if ( clientSession.curUser <> null and me.EntityName <> "" ) then
' get entity from passed in name - Note: we must be logged into entity
entity = null;
dim ii as integer;
dim tmpEnt as aaFactMES.aaEnt;
for each ii in clientSession.curUser.EntList.Keys
tmpEnt = clientSession.curUser.EntList[ii];
if ( tmpEnt.EntName == me.EntityName ) then
entity = tmpEnt;
exit for;
endif;
next;
if ( entity <> null ) then
' print info about entity
LogMessage("Info: "+entity.EntName+" id=" + entity.EntId );
LogMessage("Entity Capabilities: ");
LogMessage("CanRunJobs: "+entity.CanRunJobs.ToString() );
LogMessage("CanCaptureUtil: "+entity.CanCaptureUtil.ToString() );
LogMessage("CanTrackOEE: "+entity.CanTrackOEE.ToString() );
LogMessage("Entity Shift Information:");
LogMessage("CurShift: " + entity.CurShiftDesc);
LogMessage("Start Time: "+entity.CurShiftStartTime.ToString() );
if ( entity.JobExec <> null ) then
LogMessage("Job State: "+entity.JobExec.CurJobState.ToString() );
else
LogMessage("Job State: n/a" );
endif;
if ( entity.OEEExec <> null ) then
LogMessage("Current OEE:"+entity.OEEExec.CurrentOEE.ToString() );
LogMessage("Target OEE:"+entity.OEEExec.TargetOEE.ToString() );
LogMessage("Perform.: "+entity.OEEExec.CurrentPerf.ToString() );
LogMessage("Target Perf.: "+entity.OEEExec.TargetPerf.ToString() );
LogMessage("Curr. Quality:"+entity.OEEExec.CurrentQual.ToString() );
LogMessage("Target Qual.: "+entity.OEEExec.TargetQual.ToString() );
else
LogMessage("Current OEE: n/a" );
LogMessage("Target OEE: n/a" );
LogMessage("Current Performance: n/a" );
LogMessage("Target Performance: n/a" );
LogMessage("Current Quality: n/a" );
LogMessage("Target Quality: n/a" );
endif;
if ( entity.UtilExec <> null ) then
LogMessage("Utilization:");
LogMessage("Current: "+entity.UtilExec.CurrentUtil.ToString() );
LogMessage("Target: "+entity.UtilExec.TargetUtil.ToString() );
LogMessage("Reason Code: "+entity.UtilExec.UtilReasCd.ToString() );
LogMessage("Start Time: "+entity.UtilExec.UtilReasStart );
LogMessage("State Code: "+entity.UtilExec.UtilStateCd.ToString() );
' List reason codes available to entity
result = entity.UtilExec.GetUtilReasons();
if ( result.Success == true ) then

Wonderware Factelligence Client API Reference Guide

Using Sessions

35

dim dts As System.Data.DataTableCollection;


dim dr As System.Data.DataRow;
dim dt As System.Data.DataTable;
dts = result.Value.Tables;
dt = dts[0];
for each dr in dt.Rows
' show each column in DS (uncomment lines below to
' see what column are available)
' dim dc As System.Data.DataColumn;
' for each dc in dt.Columns
' LogMessage("Column: " + dc.ColumnName);
' LogMessage(" Value: " + dr[dc] );
' Next;
' Show Reason Code and Desc columns
LogMessage("Reason Code: " + dr["reas_cd"] );
LogMessage("Reason Description: " + dr["reas_desc"]);
Next;
endif;
else
LogMessage("Current Utilization: n/a" );
LogMessage("Target Utilization: n/a" );
LogMessage("Utilization Reason Code: n/a" );
LogMessage("Utilization Start Time: n/a" );
LogMessage("Utilization State Code: n/a" );
LogMessage("Utilization Reasons: n/a" );
endif;
else
LogMessage("Could not find entity " + me.EntityName + ".");
LogMessage("Does it exist? Is the current user logged on to it?" );
endif;
endif;
endif;

Example: GetCurrentUserInfo Script


The GetCurrentUserInfo script writes information about the
current user to the Logger. You should mark this as an
asynchronous script.

Wonderware Factelligence Client API Reference Guide

36

Chapter 3 Using the Factelligence Client API

You can use the GetCurrentUserInfo script as an Execute or


OnTrue script with the UDA trigger
(me.GetCurUserInfoTrig).
' GetCurrentUserInfo Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
dim entityID as Integer;
' reset the trigger
me.GetCurUserInfoTrig = false;
' Get the singleton client session
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if ( clientSession <> null ) then
dim i as integer;
dim ent as aaFactMES.aaEnt;
dim entNameList as string;
LogMessage("***********************************************");
'Current User Name
LogMessage("Current User Name: " + clientSession.curUser.UserName);
'Current User ID
LogMessage("Current User ID: " + clientSession.curUser.UserId);
'Current User Display Name
LogMessage("Current User Display Name: " + clientSession.curUser.UserDispl
'Show the entities the user is logged onto
for each i in clientSession.CurUser.EntList.Keys
'Seperate the Entity Names
if (entNameList.Length > 0) then
entNameList = entNameList + ", ";
endif;
'Get the entity which matches the Key.
ent = clientSession.CurUser.EntList[i];
'Append the entity name to the list.
entNameList = entNameList + ent.EntName;

Wonderware Factelligence Client API Reference Guide

Using Sessions

37

Next;
if (entNameList.Length > 0) then
LogMessage("The user is logged onto the following Entities: " + entNameList);
else
LogMessage("The user is not logged onto any entities");
endif;
LogMessage("***********************************************");
endif;

Logging off from Entities


When the user is finished with an entity, they can log off the
entity using the Job Summary control or you can script the
log off as shown in the LogOffEnt script.

Example: LogOffEnt Script


You can call the LogoffEnt script after setting UDA
(me.EntityName) with the entity name you want to log off
from. You should mark this as an asynchronous script.

Wonderware Factelligence Client API Reference Guide

38

Chapter 3 Using the Factelligence Client API

You can use the LogoffEnt script as an Execute or OnTrue


script with a UDA trigger (me.LogoffEntTrig).
' LogOffEnt Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
dim entityID as Integer;
' reset the trigger
me.LogoffEntTrig = false;
' Get the singleton client session
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if ( clientSession <> null ) then
if ( clientSession.curUser <> null and me.EntityName <> "" ) then
' get Entity ID from input UDA Entity Name
result = aaFactMES.aaEnt.EntIdFromName( me.EntityName );
if ( result.Success == true and result.Int32_Value <> -1) then
' go an entity ID - attempt to logoff
entityID = result.Int32_Value;
result = clientSession.curUser.LogoffEnt( entityID );
if ( result.Success == true ) then
LogMessage(clientSession.curUser.userName + " has logged off of entity "
+ me.EntityName + " - id=" + StringFromIntg(entityID, 10) );
endif;
else
' Failed to get Entity ID from Entity Name
LogMessage("Entity " + me.EntityName + " does not seem to exist");
endif;
endif;
endif;

Ending Sessions
When the application is terminating, you can use the code in
the Term script shown below to end the session. If you do not
end a session, the Factelligence Service cleans it up as soon
as it determines that the session is stale.

Example: Term Script


You can call the Term script to clean up and end a session.
The Term script should be called one time by one Application
Object.

Wonderware Factelligence Client API Reference Guide

Web Access

39

You can use the Term script as either an OffScan or Execute


script with some attribute-based trigger. If you use it as an
Execute script, you should mark it as an asynchronous script.
' Term Script
dim clientSession As aaFactMES.aaClientSession;
dim result As aaFactMES.Result;
' Get the singleton client session
result = aaFactMES.aaClientSession.GetInstance();
clientSession = result.Value;
if ( clientSession <> null and clientSession.SessionId <> -1 ) then
' log everyone off and stop session
clientSession.LogOffAllUsers();
clientSession.EndSession();
LogMessage("Session Ended");
endif;

Web Access
Wonderware Factelligence provides a variety of extensibility
capabilities to application authors, enabling access to the
core business logic, runtime data, and historical data store at
the heart of the product. The Web Access feature exposes the
Factelligence Middleware functionality through a
standardized Web Service.
Note It is assumed that the reader and the application
programmer have a solid understanding and working knowledge of
the Factelligence Client API.

Using Web Access


The Web Access usage code example below represents a
standard web page, utilizing the client-side capabilities of
Factelligence, which accesses a list of entities configured in
the Factelligence database and populates an editbox on the
webpage with the list. The key elements of this example are:
1

XMLExecBuilder (from Fact.Common.DLL) is used to


create and format the XML request which is sent to the
Factelligence Middleware.

Encoding XML string into XML bytes via


System.Text.UnicodeEncoding.ASCII.GetBytes().

Wonderware Factelligence Client API Reference Guide

40

Chapter 3 Using the Factelligence Client API

Formatted XML request is sent to the Factelligence


Middleware via HttpWebRequest method
'GetResponse()'.

Sample Client Code to access the HTTP Hander:


System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)
System.Net.WebRequest.Create(
"http://Factelligence/WebServices/XMLRequest.aspx" );
request.ContentType = "text/xml";
request.Method = "POST";
// Build XML command / request
//You can build the xml request using the standard Fact.Common.dll
Fact.Common.XMLExecBuilder xe = new XMLExecBuilder(111, "ent",
StdWriteCommands.Add);
xe.AddParam("ent_name", "TEST ENTITY");
xe.AddParam("can_sched_jobs", "1");
xe.AddParam("can_capture_util", "1");
xe.AddParam("identical_job_execs", "10");
// Add more parameters here as needed.
reqstr = xe.Xml.ToString();
byte[] xmlBytes = System.Text.UnicodeEncoding.ASCII.GetBytes(reqstr);
request.ContentLength = xmlBytes.Length;
//Send Request
Stream QueryStream = request.GetRequestStream();
QueryStream .Write(xmlBytes, 0, xmlBytes.Length);
QueryStream .Close();
// Send the request and get the response.
System.Net.HttpWebResponse response =
(System.Net.HttpWebResponse)request.GetResponse();
// Read the response stream.
Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
string responseString = reader.ReadToEnd();
textBox4.Text = responseString;
//Close the response stream objects.

Wonderware Factelligence Client API Reference Guide

Web Access

41

responseStream.Close();
reader.Close();
request = null;
response = null;
QueryStream = null;
responseStream = null;
reader = null;

Wonderware Factelligence Client API Reference Guide

42

Chapter 3 Using the Factelligence Client API

Wonderware Factelligence Client API Reference Guide

43

Chapter 4
API Classes

Attrs Class
The Attrs class contains methods that retrieves and sets
various attributes within the Factelligence system.

Attrs Constructor
The Attrs Constructor initializes a new instance of the Attrs
class.

AddLotAttrs() Method
The AddLotAttrs() method adds the specified attribute to the
specified lot with an initial value.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddLotAttrs( _
ByVal itemId As String, _
ByVal lotNo As String, _
ByVal attrId As Integer, _
ByVal initialValue As String _
)

[C#]
public static void AddLotAttrs(
string itemId,
string lotNo,
int attrId,
string initialValue
)

[C++]

Wonderware Factelligence Client API Reference Guide

44

Chapter 4 API Classes

public:
static void AddLotAttrs(
String itemId,
String lotNo,
int attrId,
String initialValue
)

[J#]
public static void AddLotAttrs(
string itemId,
string lotNo,
int attrId,
string initialValue
)

[JScript]
public static function AddLotAttrs(
itemId : String,
lotNo : String,
attrId : int,
initialValue : String
)

Parameters

itemId
Holds the item ID used to identify the lot.
lotNo
Holds the lot number to identify the lot.
attrId
Holds the attribute ID to initialize for this lot.
initialValue
Holds the attribute value for this lot.
Exceptions

An exception is thrown if the command fails for any reason.

GetAttrID() Method (String)


The GetAttrID() method looks up the specified attribute name
and returns the ID of the attribute.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrID( _
ByVal attrName As String _
) As Integer

[C#]
public static int GetAttrID(
string attrName
)

Wonderware Factelligence Client API Reference Guide

Attrs Class

45

[C++]
public:
static int GetAttrID(
String attrName
)

[J#]
public static int GetAttrID(
string attrName
)

[JScript]
public static function GetAttrID(
attrName : String
) : int

Parameter

attrName
Holds the name of the attribute to look up.
Return Value

Returns an integer representing the attribute ID.

GetAttrID() Method (String, Generic Nullable)


The GetAttrID() method looks up the specified attribute name
and returns the ID of the attribute.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrID( _
ByVal attrName As String, _
ByVal attr_grp As Nullable(Of Integer) _
) As Integer

[C#]
public static int GetAttrID(
string attrName,
Nullable<int> attr_grp
)

[C++]
public:
static int GetAttrID(
String attrName,
Nullable<int> attr_grp
)

[J#]
public static int GetAttrID(
string attrName,
Nullable<int> attr_grp
)

Wonderware Factelligence Client API Reference Guide

46

Chapter 4 API Classes

[JScript]
public static function GetAttrID(
attrName : String,
attr_grp : Nullable<int>
) : int

Parameters

attrName
Holds the name of the attribute to look up.
attr_grp
Holds the attribute group type.
Return Value

Returns an integer representing the attribute ID.

Exception

This method throws an error if an error occurs while


fetching the data.

GetAttrs() Method
The GetAttrs() method returns a DataSet containing all the
attributes defined on to the system.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrs() As DataSet

[C#]

public static DataSet GetAttrs()

[C++]

public:
static DataSet GetAttrs()

[J#]

public static DataSet GetAttrs()

[JScript]

public static

function GetAttrs() : DataSet

Return Value

Returns a DataSet containing a table with a row for each


attribute.

Exceptions

This method throws an exception if an error occurs while


retrieving the attributes.

GetAttrSet() Method
The GetAttrSet() method returns a DataSet containing all of
the possible attribute values for the given attribute name.

Wonderware Factelligence Client API Reference Guide

Attrs Class

47

Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrSet( _
ByVal attrName As String _
) As DataSet

[C#]
public static DataSet GetAttrSet(
string attrName
)

[C++]
public:
static DataSet GetAttrSet(
String attrName
)

[J#]
public static DataSet GetAttrSet(
string attrName
)

[JScript]
public static function GetAttrSet(
attrName : String
) : DataSet

Parameter

attrName
Attribute name.
Return Value

Returns a DataSet containing the possible values for the


named attribute.

GetAttrsVisibleInInv Method
The GetAttrsVisibleInInv() method returns a DataSet
containing all the attributes defined on the system that are
visible in inventory.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrsVisibleInInv() As
DataSet

[C#]

public static DataSet GetAttrsVisibleInInv()

[C++]

public:
static DataSet GetAttrsVisibleInInv()

[J#]

Wonderware Factelligence Client API Reference Guide

48

Chapter 4 API Classes

public static DataSet GetAttrsVisibleInInv()

[JScript]

public static
DataSet

function GetAttrsVisibleInInv() :

Return Value

Returns a DataSet containing a table with a row for each


attribute.

Exceptions

This method throws an exception if an error occurs while


retrieving the attributes.

GetAttrValue() Method (String, String, String,


String)
The GetAttrsValue () method functions to return an AttrValue
class containing the attribute value, last_edit_at, mod_ID,
and the attribute ID from the passed in attribute name and
an associated filter item.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrValue( _
ByVal attrName As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String _
) As Attrs.attrValue

[C#]
public static Attrs.attrValue GetAttrValue(
string attrName,
string tableName,
string filterField,
string filterValue
)

[C++]
public:
static
String
String
String
String
)

Attrs.attrValue GetAttrValue(
attrName,
tableName,
filterField,
filterValue

[J#]
public static Attrs.attrValue GetAttrValue(
string attrName,
string tableName,
string filterField,
string filterValue

Wonderware Factelligence Client API Reference Guide

Attrs Class

49

[JScript]
public static function GetAttrValue(
attrName : String,
tableName : String,
filterField : String,
filterValue : String
) : Attrs.attrValue

Parameters

attrName
Attribute name.
tableName
"Attribute" table name to be read, for example "item_attr"
for item attributes.
filterField
First filter field to be used, for example "item_ID".
filterValue
First filter value associated with the first filter field.
Return Value

Returns an AttrValue object for the specified attribute.

GetAttrValue() Method (String, String, String,


String, String, String)
The GetAttrsValue () method functions to return an AttrValue
class containing the attribute value, last_edit_at, mod_ID,
and the attribute ID from the passed in attribute name and
associated filter items with an optional filter field (up to 2
filters).
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrValue( _
ByVal attrName As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String, _
ByVal filterField1 As String, _
ByVal filterValue1 As String _
) As Attrs.attrValue

[C#]
public static Attrs.attrValue GetAttrValue(
string attrName,
string tableName,
string filterField,
string filterValue,
string filterField1,

Wonderware Factelligence Client API Reference Guide

50

Chapter 4 API Classes

string filterValue1
)

[C++]
public:
static
String
String
String
String
String
String
)

Attrs.attrValue GetAttrValue(
attrName,
tableName,
filterField,
filterValue,
filterField1,
filterValue1

[J#]
public static Attrs.attrValue GetAttrValue(
string attrName,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1
)

[JScript]
public static function GetAttrValue(
attrName : String,
tableName : String,
filterField : String,
filterValue : String,
filterField1 : String,
filterValue1 : String
) : Attrs.attrValue

Parameters

attrName
Attribute name.
tableName
"Attribute" table name to be read, for example "item_attr"
for item attributes.
filterField
First filter field to be used, for example "item_ID".
filterValue
First filter value associated with the first filter field.
filterField1
Second filter field to be used, for example "item_ID".
filterValue1
Second filter value associated with the second filter field.
Return Value
Returns an AttrValue object for the specified attribute.

Wonderware Factelligence Client API Reference Guide

Attrs Class

51

Exceptions

Exception Type Condition


An exception is thrown if an error occurs while getting the
attribute value from the database.

GetAttrValue() Method (String, String, String,


String, String, String, String, String)
The GetAttrsValue () method functions to return an AttrValue
class containing the attribute value, last_edit_at, mod_ID,
and the attribute ID from the passed in attribute name and
associated filter items with 2 optional filters (up to 3 filters).
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAttrValue( _
ByVal attrName As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String, _
ByVal filterField1 As String, _
ByVal filterValue1 As String, _
ByVal filterField2 As String, _
ByVal filterValue2 As String _
) As Attrs.attrValue

[C#]
public static Attrs.attrValue GetAttrValue(
string attrName,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1,
string filterField2,
string filterValue2
)

[C++]
public:
static
String
String
String
String
String
String
String
String
)

Attrs.attrValue GetAttrValue(
attrName,
tableName,
filterField,
filterValue,
filterField1,
filterValue1,
filterField2,
filterValue2

[J#]
public static Attrs.attrValue GetAttrValue(

Wonderware Factelligence Client API Reference Guide

52

Chapter 4 API Classes

string
string
string
string
string
string
string
string

attrName,
tableName,
filterField,
filterValue,
filterField1,
filterValue1,
filterField2,
filterValue2

[JScript]
public static function GetAttrValue(
attrName : String,
tableName : String,
filterField : String,
filterValue : String,
filterField1 : String,
filterValue1 : String,
filterField2 : String,
filterValue2 : String
) : Attrs.attrValue

Parameters

attrName
Attribute name.
tableName
"Attribute" table name to be read, for example "item_attr"
for item attributes.
filterField
First filter field to be used, for example "item_ID".
filterValue
First filter value associated with the first filter field.
filterField1
Second filter field to be used, for example "item_ID".
filterValue1
Second filter value associated with the second filter field.
filterField2
Third filter field to be used, for example "item_ID".
filterValue2
Third filter value associated with the third filter field.
Return Value

Returns an AttrValue object for the specified attribute.

Exceptions

Exception Type Condition


An exception is thrown if an error occurs while getting the
attribute value from the database.

Wonderware Factelligence Client API Reference Guide

Attrs Class

53

GetEntAttrs() Method (Int32)


The GetEntAttrs() method retrieves all the defined entity
attributes for the specified entity ID from the database.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetEntAttrs( _
ByVal entId As Integer _
) As DataSet

[C#]
public static DataSet GetEntAttrs(
int entId
)

[C++]
public:
static DataSet GetEntAttrs(
int entId
)

[J#]
public static DataSet GetEntAttrs(
int entId
)

[JScript]
public static function GetEntAttrs(
entId : int
) : DataSet

Parameter

entId
Holds the entity for which attributes are requested.
Return Value

Returns a DataSet containing 0 or more rows for each


entity attribute that is assigned to this entity.

GetEntAttrs Method (Int32, Int32)


The GetEntAttrs() method retrieves an entity attribute for the
specified entity ID from the database.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetEntAttrs( _
ByVal entId As Integer, _
ByVal attrId As Integer _
) As DataRow

[C#]

Wonderware Factelligence Client API Reference Guide

54

Chapter 4 API Classes

public static DataRow GetEntAttrs(


int entId,
int attrId
)

[C++]
public:
static DataRow GetEntAttrs(
int entId,
int attrId
)

[J#]
public static DataRow GetEntAttrs(
int entId,
int attrId
)

[JScript]
public static function GetEntAttrs(
entId : int,
attrId : int
) : DataRow

Parameters

entId
Holds the entity for which the attribute is requested.
attrId
Holds the attribute ID requested for this entity.
Return Value

Returns a DataRow containing the specified entity


attribute's data if it exists, else null.

GetJobAttrs() Method
The GetJobAttrs() method gets the job attributes for the
specified job. A job is specified by a work order ID, an
operation ID, and an operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobAttrs( _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer _
) As DataSet

[C#]
public static DataSet GetJobAttrs(
string woId,
string operId,
int seqNo

Wonderware Factelligence Client API Reference Guide

Attrs Class

55

[C++]
public:
static DataSet GetJobAttrs(
String woId,
String operId,
int seqNo
)

[J#]
public static DataSet GetJobAttrs(
string woId,
string operId,
int seqNo
)

[JScript]
public static function GetJobAttrs(
woId : String,
operId : String,
seqNo : int
) : DataSet

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
Return Value

Returns a DataSet containing the job attribute records.


Exceptions

This method throws an exception if an error occurs retrieving


the data from the database.

GetLotAttrs() Method
The GetLotAttrs() method retrieves lot attributes based on
the itemId, lotNo, and attrId parameters. Use nulls for any
parameter not needed.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetLotAttrs( _
ByVal itemId As String, _
ByVal lotNo As String, _
ByVal attrId As Object _
) As DataSet

Wonderware Factelligence Client API Reference Guide

56

Chapter 4 API Classes

[C#]
public static DataSet GetLotAttrs(
string itemId,
string lotNo,
object attrId
)

[C++]
public:
static
String
String
Object
)

DataSet GetLotAttrs(
itemId,
lotNo,
attrId

[J#]
public static DataSet GetLotAttrs(
string itemId,
string lotNo,
object attrId
)

[JScript]
public static function GetLotAttrs(
itemId : String,
otNo : String,
attrId : Object
) : DataSet

Parameters

itemId
Optionally filters the DataSet to an individual item's lot
number attributes.
lotNo
Optionally filters the DataSet to an individual lot number's
attributes.
attrId
Optionally filters the DataSet to a single lot number
attribute.
Return Value

Returns a DataSet containing a set of lot attributes filtered


by the specified values.

Exceptions

This method throws an exception if an error occurs while


getting the information from the database.

Wonderware Factelligence Client API Reference Guide

Attrs Class

57

GetWOAttrs() Method
The GetWOAttrs() method gets the work order attributes for
the specified work order. Caller must catch any exception if
this call fails.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetWOAttrs( _
ByVal woId As String _
) As DataSet

[C#]
public static DataSet GetWOAttrs(
string woId
)

[C++]
public:
static DataSet GetWOAttrs(
String woId
)

[J#]
public static DataSet GetWOAttrs(
string woId
)

[JScript]
public static function GetWOAttrs(
woId : String
) : DataSet

Parameter

woId
Holds the job's work order ID.
Return Value

Returns a DataSet containing the work order attribute


records.

Exceptions

This method throws and exception if an error occurs


retrieving the data from the database.

PopupItemAttributes() Method (String)


The PopupItemAttributes() method opens the Attributes form
to display the item attributes for the specified item.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupItemAttributes( _

Wonderware Factelligence Client API Reference Guide

58

Chapter 4 API Classes

ByVal itemID As String _


)
[C#]
public static void PopupItemAttributes(
string itemID
)

[C++]
public:
static void PopupItemAttributes(
String itemID
)

[J#]
public static void PopupItemAttributes(
string itemID
)

[JScript]
public static function PopupItemAttributes(
itemID : String
)

Parameter

itemID
Holds the ID of the item for which to view/edit attributes.

PopupItemAttributes Method (String, Boolean)


The PopupItemAttributes() method opens the Attributes form
to display the item attributes for the specified item.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupItemAttributes( _
ByVal itemID As String, _
ByVal viewOnly As Boolean _
)

[C#]
public static void PopupItemAttributes(
string itemID,
bool viewOnly
)

[C++]
public:
static void PopupItemAttributes(
String itemID,
bool viewOnly
)

Wonderware Factelligence Client API Reference Guide

Attrs Class

59

[J#]
public static void PopupItemAttributes(
string itemID,
bool viewOnly
)

[JScript]
public static function PopupItemAttributes(
itemID : String,
viewOnly : bool
)

Parameters

itemID
Holds the ID of the item for which to view/edit attributes.
viewOnly
Holds a flag indicating whether or not the user should only
be allowed to view the attributes.

PopupJobAttrsDlg Method (String, String, Int32,


String)
The PopupJobAttrsDlg() method opens the job attributes
dialog to display any job attributes assigned to the specified
job. A job is specified by a work order ID, an operation ID,
and an operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupJobAttrsDlg( _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal jobDesc As String _
)

[C#]
public static void PopupJobAttrsDlg(
string woId,
string operId,
int seqNo,
string jobDesc
)

[C++]
public:
static void PopupJobAttrsDlg(
String woId,
String operId,
int seqNo,
String jobDesc

Wonderware Factelligence Client API Reference Guide

60

Chapter 4 API Classes

[J#]
public static void PopupJobAttrsDlg(
string woId,
string operId,
int seqNo,
string jobDesc
)

[JScript]
public static function PopupJobAttrsDlg(
woId : String,
operId : String,
seqNo : int,
jobDesc : String
)

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
jobDesc
Holds the description of the job.

PopupJobAttrsDlg() Method (String, String,


Int32, String, ColumnList)
The PopupJobAttrsDlg() method opens the job attributes
dialog to display any job attributes assigned to the specified
job. A job is specified by a work order ID, an operation ID,
and an operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupJobAttrsDlg( _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal jobDesc As String, _
ByVal columns As ColumnList _
)

[C#]
public static void PopupJobAttrsDlg(
string woId,
string operId,
int seqNo,

Wonderware Factelligence Client API Reference Guide

Attrs Class

61

string jobDesc,
ColumnList columns
)

[C++]
public:
static void PopupJobAttrsDlg(
String woId,
String operId,
int seqNo,
String jobDesc,
ColumnList columns
)

[J#]
public static void PopupJobAttrsDlg(
string woId,
string operId,
int seqNo,
string jobDesc,
ColumnList columns
)

[JScript]
public static function PopupJobAttrsDlg(
woId : String,
operId : String,
seqNo : int,
jobDesc : String,
columns : ColumnList
)

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
jobDesc
Holds the description of the job.
columns
Holds the list of columns in the queue grid.

PopupLotNoAttributes() Method (String, String)


The PopupLotNoAttributes() method opens the Attributes
form to display the lot number attributes for the specified
item/lot number pair.

Wonderware Factelligence Client API Reference Guide

62

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupLotNoAttributes( _
ByVal itemID As String, _
ByVal lotNo As String _
)

[C#]
public static void PopupLotNoAttributes(
string itemID,
string lotNo
)

[C++]
public:
static void PopupLotNoAttributes(
String itemID,
String lotNo
)

[J#]
public static void PopupLotNoAttributes(
string itemID,
string lotNo
)

[JScript]
public static function PopupLotNoAttributes(
itemID : String,
lotNo : String
)

Parameters

itemID
Holds the ID of the item which makes up half the key for
viewing and editing the attributes.
lotNo
Holds the lot number which makes up half the key for
viewing and editing the attributes.

PopupLotNoAttributes() Method (String, String,


Boolean, ColumnList)
The PopupLotNoAttributes() method opens the Attributes
form to display the lot number attributes for the specified
item/lot number pair.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupLotNoAttributes( _
ByVal itemID As String, _

Wonderware Factelligence Client API Reference Guide

Attrs Class

63

ByVal lotNo As String, _


ByVal viewOnly As Boolean, _
ByVal columns As ColumnList _
)

[C#]
public static void PopupLotNoAttributes(
string itemID,
string lotNo,
bool viewOnly,
ColumnList columns
)

[C++]
public:
static void PopupLotNoAttributes(
String itemID,
String lotNo,
bool viewOnly,
ColumnList columns
)

[J#]
public static void PopupLotNoAttributes(
string itemID,
string lotNo,
bool viewOnly,
ColumnList columns
)

[JScript]
public static function PopupLotNoAttributes(
itemID : String,
lotNo : String,
viewOnly : bool,
columns : ColumnList
)

Parameters

itemID
Holds the ID of the item which makes up half the key for
viewing and editing the attributes.
lotNo
Holds the lot number which makes up half the key for
viewing and editing the attributes.
viewOnly
Holds a flags whether attributes window should be view
only.
columns
Holds the list of columns in the inventory grid.

Wonderware Factelligence Client API Reference Guide

64

Chapter 4 API Classes

SetAttrValue() Method (String, Object, String,


String, String, String, String, Boolean)
The SetAttrValue() method adds an attribute or updates the
value of an existing attribute based on the passed in
attribute name and an associated filter item.
Syntax

[Visual Basic (Declaration)]


Public Shared Function SetAttrValue( _
ByVal attrName As String, _
ByVal attrVal As Object, _
ByVal lastEdit As String, _
ByVal modId As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String, _
ByVal bAdd As Boolean _
) As Boolean

[C#]
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
bool bAdd
)

[C++]
public:
static bool SetAttrValue(
String attrName,
Object attrVal,
String lastEdit,
String modId,
String tableName,
String filterField,
String filterValue,
bool bAdd
)

[J#]
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
bool bAdd

Wonderware Factelligence Client API Reference Guide

Attrs Class

65

[JScript]
public static function SetAttrValue(
attrName : String,
attrVal : Object,
lastEdit : String,
modId : String,
tableName : String,
filterField : String,
filterValue : String,
bAdd : bool
) : bool

Parameters

attrName
Attribute name.
attrVal
Attribute value.
lastEdit
Last edit time.
modId
Mod ID.
tableName
"Attribute" table name to be read, for example "item_attr"
for item attributes.
filterField
First filter field to be used, for example "item_ID".
filterValue
First filter value associated with the first filter field.
bAdd
Set true if the attribute is being added or false if the
attribute is being updated.
Return Value

Returns true if setting the attribute value succeeds and


false if setting the attribute value fails.

SetAttrValue() Method (String, Object, String,


String, String, String, String, String, String,
Boolean)
The SetAttrValue() method adds an attribute or updates the
value of an existing attribute based on the passed in
attribute name and an associated filter item. An optional
filter fields can also be supplied.

Wonderware Factelligence Client API Reference Guide

66

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Shared Function SetAttrValue( _
ByVal attrName As String, _
ByVal attrVal As Object, _
ByVal lastEdit As String, _
ByVal modId As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String, _
ByVal filterField1 As String, _
ByVal filterValue1 As String, _
ByVal bAdd As Boolean _
) As Boolean

[C#]
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1,
bool bAdd
)

[C++]
public:
static bool SetAttrValue(
String attrName,
Object attrVal,
String lastEdit,
String modId,
String tableName,
String filterField,
String filterValue,
String filterField1,
String filterValue1,
bool bAdd
)

[J#]
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1,
bool bAdd

Wonderware Factelligence Client API Reference Guide

Attrs Class

67

[JScript]
public static function SetAttrValue(
attrName : String,
attrVal : Object,
lastEdit : String,
modId : String,
tableName : String,
filterField : String,
filterValue : String,
filterField1 : String,
filterValue1 : String,
bAdd : bool
) : bool

Parameters

attrName
Attribute name.
attrVal
Attribute value.
lastEdit
Last edit time.
modId
Mod ID.
tableName
"Attribute" table name to be read, for example "item_attr"
for item attributes.
filterField
First filter field to be used, for example "item_ID".
filterValue
First filter value associated with the first filter field.
filterField1
Second filter field which can be used, for example
"item_ID".
filterValue1
Second filter value associated with the second filter field.
bAdd
Set true if the attribute is being added or false if the
attribute is being updated.
Return Value

Returns true if setting the attribute value succeeds and


false if setting the attribute value fails.

Wonderware Factelligence Client API Reference Guide

68

Chapter 4 API Classes

SetAttrValue() Method (String, Object, String,


String, String, String, String, String, String,
String, String, Boolean)
The SetAttrValue() method adds an attribute or updates the
value of an existing attribute based on the passed in
attribute name and an associated filter item. Two optional
filter fields may be specified.
Syntax

[Visual Basic (Declaration)]


Public Shared Function SetAttrValue( _
ByVal attrName As String, _
ByVal attrVal As Object, _
ByVal lastEdit As String, _
ByVal modId As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String, _
ByVal filterField1 As String, _
ByVal filterValue1 As String, _
ByVal filterField2 As String, _
ByVal filterValue2 As String, _
ByVal bAdd As Boolean _
) As Boolean

[C#]
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1,
string filterField2,
string filterValue2,
bool bAdd
)

[C++]
public:
static
String
Object
String
String
String
String
String
String
String
String

bool SetAttrValue(
attrName,
attrVal,
lastEdit,
modId,
tableName,
filterField,
filterValue,
filterField1,
filterValue1,
filterField2,

Wonderware Factelligence Client API Reference Guide

Attrs Class

69

String filterValue2,
bool bAdd
)

[J#]
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1,
string filterField2,
string filterValue2,
bool bAdd
)

[JScript]
public static function SetAttrValue(
attrName : String,
attrVal : Object,
lastEdit : String,
modId : String,
tableName : String,
filterField : String,
filterValue : String,
filterField1 : String,
filterValue1 : String,
filterField2 : String,
filterValue2 : String,
bAdd : bool
) : bool

Parameters

attrName
Attribute name.
attrVal
Attribute value.
lastEdit
Last edit time.
modId
Mod ID.
tableName
"Attribute" table name to be read, for example "item_attr"
for item attributes.
filterField
First filter field to be used, for example "item_ID".

Wonderware Factelligence Client API Reference Guide

70

Chapter 4 API Classes

filterValue
First filter value associated with the first filter field.
filterField1
Second filter field to be used, for example "item_ID".
filterValue1
Second filter value associated with the second filter field.
filterField2
Third filter field to be used, for example "item_ID".
filterValue2
Third filter value associated with the third filter field.
bAdd
Set true if the attribute is being added or false if the
attribute is being updated.
Return Value

Returns true if setting the attribute value succeeds and


false if setting the attribute value fails.

SetLotAttrs() Method
The SetLotAttrs() method adds or updates lot attributes.
LastEditAt is passed for updates to determine the lot
attribute record that is to be updated.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetLotAttrs( _
ByVal itemId As String, _
ByVal lotNo As String, _
ByVal attrId As Integer, _
ByVal attrValue As String, _
ByVal notes As String, _
ByVal lastEditAt As String _
)

[C#]
public static void SetLotAttrs(
string itemId,
string lotNo,
int attrId,
string attrValue,
string notes,
string lastEditAt
)

[C++]
public:
static void SetLotAttrs(
String itemId,
String lotNo,
int attrId,

Wonderware Factelligence Client API Reference Guide

ClientSession Class

71

String attrValue,
String notes,
String lastEditAt
)

[J#]
public static void SetLotAttrs(
string itemId,
string lotNo,
int attrId,
string attrValue,
string notes,
string lastEditAt
)

[JScript]
public static function SetLotAttrs(
itemId : String,
lotNo : String,
attrId : int,
attrValue : String,
notes : String,
lastEditAt : String
)

Parameters

itemId
Hold the item ID identifying the lot.
lotNo
Holds the lot number identifying the lot.
attrId
Holds the ID of the attribute to set.
attrValue
Holds the value of the attribute.
notes
Holds the notes for the attribute.
lastEditAt
Holds the last edit datetime. Only required for updates;
pass null for adds.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

ClientSession Class
The ClientSession class manages the Factelligence MES
session for an application. You can use it to start a session
with the Factelligence middleware, and log users into the
session. The ClientSession object has a property to indicate
Wonderware Factelligence Client API Reference Guide

72

Chapter 4 API Classes

the current user. Through the users, you can access the
entities that the users are logged on to and through the
entities, you access the jobs that are running on the entities.
There is only one ClientSession object for an application, and
the object exists from the time it is created until the
application ends. You get a reference to the ClientSession
object by calling the GetInstance() static method. The first
call to this method creates the ClientSession object.

ChangePassword() Method
The ChangePassword() method invokes the Change Password
dialog to allow the user to change their password. If the user
does not cancel the dialog, the user's password is changed to
the new password.
Syntax

[Visual Basic (Declaration)]


Public Function ChangePassword( _
ByVal userId As String, _
ByVal forceChange As Boolean _
) As Boolean

[C#]
public bool ChangePassword(
string userId,
bool forceChange
)

[C++]
public:
bool ChangePassword(
String userId,
bool forceChange
) sealed

[J#]
public bool ChangePassword(
string userId,
bool forceChange
)

[JScript]
public function ChangePassword(
userId : String,
forceChange : bool
) : bool

Parameters

userId
Holds the ID of the user whose password is being changed.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

73

forceChange
Holds a flag which is set true if a user must change their
password the next time they log on.
Return Value

Returns true if the password was changed successfully.

Exceptions

An exception is thrown if an error occurs while changing


the password.

ClearFormLoginStatus() Method
The ClearFormLoginStatus() method removes the form's name
from the Form Login Status collection. The form name is
used when there are multiple Factelligence controls on a
form that may request a log on. If the user cancels one login
request, the user should not be presented with login requests
from the rest of the controls on the form. This method should
be called when the form is being destroyed.
Syntax

[Visual Basic (Declaration)]


Public Sub ClearFormLoginStatus( _
ByVal formName As String _
)

[C#]
public void ClearFormLoginStatus(
string formName
)

[C++]
public:
void ClearFormLoginStatus(
String formName
) sealed

[J#]
public void ClearFormLoginStatus(
string formName
)

[JScript]
public function ClearFormLoginStatus(
formName : String
)

Parameter

formName
Holds the name of the form which is being destroyed.

Wonderware Factelligence Client API Reference Guide

74

Chapter 4 API Classes

CloseChildForms() Method
The CloseChildForms() method closes all open dialogs. This
method not works inside of InTouch.
Syntax

[Visual Basic (Declaration)]


Public Sub CloseChildForms( _
ByVal form As Form _
)

[C#]
public void CloseChildForms(
Form form
)

[C++]
public:
void CloseChildForms(
Form form
) sealed

[J#]
public void CloseChildForms(
Form form
)

[JScript]
public function CloseChildForms(
form : Form
)

Parameter

form
Holds the Form to close and search for children.

End Session() Method


The EndSession() method ends the current session with the
Factelligence middleware.
Syntax

[Visual Basic (Declaration)]


Public Sub EndSession()

[C#]

public void EndSession()

[C++]

public:
void EndSession() sealed

[J#]

Wonderware Factelligence Client API Reference Guide

ClientSession Class

75

public void EndSession()

[[JScript]#]
public

function EndSession()

Exceptions

An exception is thrown if the call to the middleware to end


the session fails.

GetCurUserCurEntInfo Method (Int32, Int32)


The GetCurUserCurEntInfo() method gets a DataRow from the
current user's entity status DataSet for the specified entity
and job position. The DataRow contains the information
about the job currently running on the entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetCurUserCurEntInfo( _
ByVal entID As Integer, _
ByVal jobPos As Integer _
) As DataRow

[C#]
public DataRow GetCurUserCurEntInfo(
int entID,
int jobPos
)

[C++]
public:
DataRow GetCurUserCurEntInfo(
int entID,
int jobPos
) sealed

[J#]
public DataRow GetCurUserCurEntInfo(
int entID,
int jobPos
)

[JScript]
public function GetCurUserCurEntInfo(
entID : int,
jobPos : int
) : DataRow

Parameters

entID
Holds the ID of the entity.
jobPos
Holds the job position of the entity.

Wonderware Factelligence Client API Reference Guide

76

Chapter 4 API Classes

Return Value

Returns a DataRow from the current user's entity status


DataSet for the specified entity and job position, or null if
the specified row is not found.

GetCurUserCurEntInfo Method (Object, Object)


The GetCurUserCurEntInfo() method gets the current user's
entity status DataSet. The DataSet can be filtered by
supplying a job position or entity ID. The DataSet contains
information about the jobs running on the entities.
Syntax

[Visual Basic (Declaration)]


Public Function GetCurUserCurEntInfo( _
ByVal jobPos As Object, _
ByVal entityID As Object _
) As DataSet

[C#]
public DataSet GetCurUserCurEntInfo(
object jobPos,
object entityID
)

[C++]
public:
DataSet GetCurUserCurEntInfo(
Object jobPos,
Object entityID
) sealed

[J#]
public DataSet GetCurUserCurEntInfo(
object jobPos,
object entityID
)

[JScript]
public function GetCurUserCurEntInfo(
jobPos : Object,
entityID : Object
) : DataSet

Parameters

jobPos
Holds an optional parameter used to specify the Job
Position. Pass a null to not specify a job position or an
integer representing the job position.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

77

entityID
Holds an optional parameter used to specify the Entity ID.
Pass a null to not specify an entity or an integer
representing the entity ID. If no entity is specified, the
current entity for the user is used.
Return Value

Returns a DataSet containing the rows which match the


supplied filter.

GetDS() Method
The GetDS() method gets a DataSet based on the XML
containing a call to the middleware.
Syntax

[Visual Basic (Declaration)]


Public Function GetDS( _
ByVal xmlRequest As String _
) As DataSet

[C#]
public DataSet GetDS(
string xmlRequest
)

[C++]
public:
DataSet GetDS(
String xmlRequest
) sealed

[J#]
public DataSet GetDS(
string xmlRequest
)

[JScript]
public function GetDS(
xmlRequest : String
) : DataSet

Parameter

xmlRequest
Holds an XML string containing a middleware request.
Return Value

Returns a DataSet based on the middleware command.

Exceptions

An exception is thrown if an error occurs while retrieving


the data from the database.

Wonderware Factelligence Client API Reference Guide

78

Chapter 4 API Classes

GetDSbySQL() Method
The GetDSbySQL() method gets a new DataSet based on the
SQL statement passed as a parameter.
Syntax

[Visual Basic (Declaration)]


Public Function GetDSbySQL( _
ByVal sql As String _
) As DataSet

[C#]
public DataSet GetDSbySQL(
string sql
)

[C++]
public:
DataSet GetDSbySQL(
String sql
) sealed

[J#]
public DataSet GetDSbySQL(
string sql
)

[JScript]
public function GetDSbySQL(
sql : String
) : DataSet

Parameter

sql
Holds the SQL statement to execute.
Return Value

Returns a DataSet based on the supplied SQL statement.

Exceptions

An exception is thrown if an error occurs while retrieving


the data from the database.

GetInstance() Method
The GetInstance() method is a class level method that returns
a client session object. The first time this method is called it
creates the ClientSession object. Thereafter, it returns the
ClientSession object created by the first call. The
ClientSession object is the main entry point into the
Factelligence Client API. It holds the list of logged in users
and the current user.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

79

Syntax

[Visual Basic (Declaration)]


Public Shared Function GetInstance() As
ClientSession

[C#]

public static ClientSession GetInstance()

[C++]
public:
static ClientSession GetInstance()

[J#]

public static ClientSession GetInstance()

[[JScript]#]

public static
ClientSession

function GetInstance() :

Returns

This method returns the ClientSession object.

GetLangStringsObject() Method
The GetLangStringsObject() method returns a LangStrings
object for the specified language. The LangStrings object
contains the language strings used by Factelligence for UI
and error messages.
Syntax

[Visual Basic (Declaration)]


Public Function GetLangStringsObject( _
ByVal langId As Integer _
) As LangStrings

[C#]

public LangStrings GetLangStringsObject(


int langId
)

[C++]
public:
LangStrings GetLangStringsObject(
int langId
) sealed

[J#]

public LangStrings GetLangStringsObject(


int langId
)

[JScript]
public

function GetLangStringsObject(

Wonderware Factelligence Client API Reference Guide

80

Chapter 4 API Classes

langId : int
) : LangStrings

Parameter

langId
Holds the ID of the language to get.
Return Value

Returns a LangStrings object for the specified language.

GetServerTime() Method
The GetServerTime() method returns the time from the
Database server.
Syntax

[Visual Basic (Declaration)]


Public Function GetServerTime() As Date

[C#]

public DateTime GetServerTime()

[C++]

public:
DateTime GetServerTime() sealed

[J#]

public DateTime GetServerTime()

[JScript]
public

function GetServerTime() : DateTime

Return Value

Returns a DateTime containing the time on the database


server.

Exceptions

An exception is thrown if an error occurs while getting the


time from the database server.

Login() Method
The Login() method attempts to log the specified user on to
the Factelligence session without prompting the user for a
user ID or password. The user's ID and password are passed
to the session as parameters. The session must exist or the
log on attempt fails.
Syntax

[Visual Basic (Declaration)]


Public Sub Login( _
ByVal userId As String, _
ByVal password As String _
)

Wonderware Factelligence Client API Reference Guide

ClientSession Class

81

[C#]
public void Login(
string userId,
string password
)

[C++]
public:
void Login(
String userId,
String password
) sealed

[J#]
public void Login(
string userId,
string password
)

[[JScript]#]
public function Login(
userId : String,
password : String
)

Parameters

userId
Hold the ID of the user logging on to the Factelligence
session.
password
Holds the password of the user logging on to the
Factelligence session.
Exceptions

An exception is thrown if the log on attempt fails.

Remarks

A Factelligence session can be started by calling


StartSession. To see if a session has already been started,
check the SessionID property. The value of this property is
-1 when no session is active.

LoginWithDialog() Method (String)


The LoginWithDialog() method opens the login form to allow a
user name and password to be entered. The form then
attempts to login the user using the information entered. If
the login form is canceled or errors, it records that fact along
with name of form that called for the login. This prevents the
login form from being popped up for any other controls on the
same form.

Wonderware Factelligence Client API Reference Guide

82

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Function LoginWithDialog( _
ByVal formName As String _
) As Boolean

[C#]

public bool LoginWithDialog(


string formName
)

[C++]
public:
bool LoginWithDialog(
String formName
) sealed

[J#]

public bool LoginWithDialog(


string formName
)

[JScript]
public

function LoginWithDialog(

formName : String
) : bool

Parameter

formName
Holds the name of the form requesting the login. Pass an
empty string "" to log on additional users.
Return Value

Returns true if the user logs in or false if the user cancels


the login or if there was an error while logging in.

LoginWithDialog() Method (String, Boolean,


Boolean)
The LoginWithDialog() method opens the login form to allow a
user name and password to be entered. The form then
attempts to login the user using the information entered. If
the login form is canceled or errors, it records that fact along
with name of form that called for the login. This prevents the
login form from being popped up for any other controls on the
same form.
Syntax

[Visual Basic (Declaration)]


Public Function LoginWithDialog( _

Wonderware Factelligence Client API Reference Guide

ClientSession Class

ByVal formName As String,

83

ByVal confirmCancel As Boolean,

ByVal disableCancel As Boolean _


) As Boolean

[C#]

public bool LoginWithDialog(


string formName,
bool confirmCancel,
bool disableCancel
)

[C++]
public:
bool LoginWithDialog(
String formName,
bool confirmCancel,
bool disableCancel
) sealed

[J#]

public bool LoginWithDialog(


string formName,
bool confirmCancel,
bool disableCancel
)

[JScript]
public

function LoginWithDialog(

formName : String,
confirmCancel : bool,
disableCancel : bool
) : bool

Parameters

formName
Holds the name of the form requesting the login. Pass an
empty string "" to log on additional users.
confirmCancel
Holds a true/false flag to set whether the 'cancel' is
confirmed in the login dialog.
disableCancel
Holds a true/false flag to set whether the 'cancel' button is
displayed on the login dialog.

Wonderware Factelligence Client API Reference Guide

84

Chapter 4 API Classes

Return Value

Returns true if the user logs in or false if the user cancels


the login or if there was an error while logging in.

LoginWithDialog() Method (String, Boolean,


Boolean, Boolean)
The LoginWithDialog() method opens the login form to allow a
user name and password to be entered. The form then
attempts to login the user using the information entered. If
the login form is canceled or errors, it records that fact along
with name of form that called for the login. This prevents the
login form from being popped up for any other controls on the
same form.
Syntax

[Visual Basic (Declaration)]


Public Function LoginWithDialog( _
ByVal formName As String,

ByVal confirmCancel As Boolean,

ByVal disableCancel As Boolean,

ByVal showAlwaysLoginCheckbox As Boolean _


) As Boolean

[C#]

public bool LoginWithDialog(


string formName,
bool confirmCancel,
bool disableCancel,
bool showAlwaysLoginCheckbox
)

[C++]
public:
bool LoginWithDialog(
String formName,
bool confirmCancel,
bool disableCancel,
bool showAlwaysLoginCheckbox
) sealed

[J#]

public bool LoginWithDialog(


string formName,
bool confirmCancel,
bool disableCancel,
bool showAlwaysLoginCheckbox

Wonderware Factelligence Client API Reference Guide

ClientSession Class

85

[JScript]
public

function LoginWithDialog(

formName : String,
confirmCancel : bool,
disableCancel : bool,
showAlwaysLoginCheckbox : bool
) : bool

Parameters

formName
Holds the name of the form requesting the login. Pass an
empty string "" to log on additional users.
confirmCancel
Holds a true/false flag to set whether the 'cancel' is
confirmed in the login dialog.
disableCancel
Holds a true/false flag to set whether the 'cancel' button is
displayed on the login dialog.
showAlwaysLoginCheckbox
Holds a true/false flag to set whether the 'Always login as
this user' checkbox should be shown if the system
parameter allows it.
Return Value

Returns true if the user logs in or false if the user cancels


the login or if there was an error while logging in.

LoginWithDialog() Method (String, Boolean,


Boolean, Boolean, String)
The LoginWithDialog() method opens the login form to allow a
user name and password to be entered. The form then
attempts to login the user using the information entered. If
the login form is canceled or errors, it records that fact along
with name of form that called for the login. This prevents the
login form from being popped up for any other controls on the
same form.
Syntax

[Visual Basic (Declaration)]


Public Function LoginWithDialog( _
ByVal formName As String,

ByVal confirmCancel As Boolean,

ByVal disableCancel As Boolean,

ByVal showAlwaysLoginCheckbox As Boolean,

Wonderware Factelligence Client API Reference Guide

86

Chapter 4 API Classes

ByVal versionNumber As String _


) As Boolean

[C#]

public bool LoginWithDialog(


string formName,
bool confirmCancel,
bool disableCancel,
bool showAlwaysLoginCheckbox,
string versionNumber
)

[C++]
public:
bool LoginWithDialog(
String formName,
bool confirmCancel,
bool disableCancel,
bool showAlwaysLoginCheckbox,
String versionNumber
) sealed

[J#]

public bool LoginWithDialog(


string formName,
bool confirmCancel,
bool disableCancel,
bool showAlwaysLoginCheckbox,
string versionNumber
)

[JScript]
public

function LoginWithDialog(

formName : String,
confirmCancel : bool,
disableCancel : bool,
showAlwaysLoginCheckbox : bool,
versionNumber : String
) : bool

Parameters

formName
Holds the name of the form requesting the login. Pass an
empty string "" to log on additional users.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

87

confirmCancel
Holds a true/false flag to set whether the 'cancel' is
confirmed in the login dialog.
disableCancel
Holds a true/false flag to set whether the 'cancel' button is
displayed on the login dialog.
showAlwaysLoginCheckbox
Holds a true/false flag to set whether the 'Always login as
this user' checkbox should be shown if the system
parameter allows it.
versionNumber
Holds the version number to display on the dialog.
Return Value

Returns true if the user logs in or false if the user cancels


the login or if there was an error while logging in.

LogOffAllUsers() Method
The LogOffAllUsers() method logs off all users without any
prompts.
Syntax

[Visual Basic (Declaration)]


Public Sub LogOffAllUsers()

[C#]

public void LogOffAllUsers()

[C++]

public:
void LogOffAllUsers() sealed

[J#]

public void LogOffAllUsers()

[[JScript]#]
public

function LogOffAllUsers()

LogOffCurrentUser() Method
The LogOffCurrentUser() method logs out the current user
from the session and opens the switch user dialog to login
another user.
Syntax

[Visual Basic (Declaration)]


Public Sub LogOffCurrentUser()
[C#]
public void LogOffCurrentUser()

[C++]

Wonderware Factelligence Client API Reference Guide

88

Chapter 4 API Classes

public:
void LogOffCurrentUser() sealed

[J#]

public void LogOffCurrentUser()

[JScript]
public

function LogOffCurrentUser()

Exceptions

An exception is thrown if an error occurs during the logout.

LogOffUser() Method (String)


The LogOffUser() method logs out the specified user from the
session. A prompt is displayed asking the user to confirm the
logout.
Syntax

[Visual Basic (Declaration)]


Public Sub LogOffUser( _
ByVal userID As String _
)

[C#]
public void LogOffUser(
string userID
)

[C++]
public:
void LogOffUser(
String userID
) sealed

[J#]

public void LogOffUser(


string userID
)

[JScript]
public

function LogOffUser(

userID : String
)

Parameter

userID
Holds the ID of the user who is to be logged out.
Exceptions

An exception is thrown if an error occurs while logging the


user off.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

89

LogOffUser() Method (String, Boolean)


The LogOffUser() method logs out the specified user from the
session. An optional prompt may be displayed asking the
user to confirm the logout.
Syntax

[Visual Basic (Declaration)]


Public Sub LogOffUser( _
ByVal userId As String,

ByVal askForConfirmation As Boolean _


)

[C#]
public void LogOffUser(
string userId,
bool askForConfirmation
)

[C++]
public:
void LogOffUser(
String userId,
bool askForConfirmation
) sealed

[J#]

public void LogOffUser(


string userId,
bool askForConfirmation
)

[JScript]
public

function LogOffUser(

userId : String,
askForConfirmation : bool
)

Parameters

userId
Holds the ID of the user who is to be logged out.
askForConfirmation
If true, a confirmation dialog displays asking the user if
they are sure they want to log off. If false, no confirmation
dialog appears.
Exceptions

An exception is thrown if an error occurs while logging the


user off.

Wonderware Factelligence Client API Reference Guide

90

Chapter 4 API Classes

OnRefreshControls() Method
The OnRefreshControls() method causes the current user's
entity status to be refreshed and causes a RefreshControls
event to be fired.
Syntax

[Visual Basic (Declaration)]


Public Sub OnRefreshControls()

[C#]

public void OnRefreshControls()

[C++]

public:
void OnRefreshControls() sealed

[J#]

public void OnRefreshControls()

[JScript]
public

function OnRefreshControls()

PopupConfigureMiddlewareAccess() Method
The PopupConfigureMiddlewareAccess() method opens a
dialog to configure the Middleware Access method. The
dialog offers DCOM and HTTP as options.
Syntax

[Visual Basic (Declaration)]


Public Sub PopupConfigureMiddlewareAccess()

[C#]

public void PopupConfigureMiddlewareAccess()

[C++]

public:
void PopupConfigureMiddlewareAccess() sealed

[J#]

public void PopupConfigureMiddlewareAccess()

[JScript]
public

function PopupConfigureMiddlewareAccess()

PopupSwitchUserDialog() Method (String, String)


The PopupSwitchUserDialog() method invokes the switch user
dialog. If called and no users are currently logged into the
session, the normal login is processed, otherwise the switch
user form is loaded. If a new user is logged on, the logon ent
form automatically displays.
Syntax

[Visual Basic (Declaration)]


Wonderware Factelligence Client API Reference Guide

ClientSession Class

91

Public Function PopupSwitchUserDialog( _


ByVal SwitchUserTo As String,

ByVal formName As String _


) As Boolean

[C#]

public bool PopupSwitchUserDialog(


string SwitchUserTo,
string formName
)

[C++]
public:
bool PopupSwitchUserDialog(
String SwitchUserTo,
String formName
) sealed

[J#]

public bool PopupSwitchUserDialog(


string SwitchUserTo,
string formName
)

[JScript]
public

function PopupSwitchUserDialog(

SwitchUserTo : String,
formName : String
) : bool

Parameters

SwitchUserTo
Holds the ID of the user to select in the list of users. Pass
empty string if no user should be selected.
formName
Holds the name of the calling form. Pass empty string if the
method is not being called from a form.
Return Value

Returns true if user switched successful.

Wonderware Factelligence Client API Reference Guide

92

Chapter 4 API Classes

PopupSwitchUserDialog() Method (String, String,


Boolean)
The PopupSwitchUserDialog() method invokes the switch user
dialog. If called and no users are currently logged into the
session, the normal login is processed, otherwise the switch
user form is loaded. If a new user is logged on, the log on ent
form only displays if the autoLogonEnts variable is set true.
Syntax

[Visual Basic (Declaration)]


Public Function PopupSwitchUserDialog( _
ByVal SwitchUserTo As String,
ByVal formName As String,

ByVal autoLogonEnts As Boolean _


) As Boolean

[C#]

public bool PopupSwitchUserDialog(


string SwitchUserTo,
string formName,
bool autoLogonEnts
)

[C++]
public:
bool PopupSwitchUserDialog(
String SwitchUserTo,
String formName,
bool autoLogonEnts
) sealed

[J#]

public bool PopupSwitchUserDialog(


string SwitchUserTo,
string formName,
bool autoLogonEnts
)

[JScript]
public

function PopupSwitchUserDialog(

SwitchUserTo : String,
formName : String,
autoLogonEnts : bool
) : bool

Wonderware Factelligence Client API Reference Guide

ClientSession Class

93

Parameters

SwitchUserTo
Holds the ID of the user to select in the list of users. Pass
emtpy string if no user should be selected.
formName
Holds the name of the calling form. Pass empty string if the
method is not being called from a form.
autoLogonEnts
Set true, if the form to log the new user onto an entity
should display after a new user logs in, and false if it should
not.
Return Value

Returns true if user switched successful.

ReadTextFile() Method
The ReadTextFile() method returns the contents of the
specified text file from the configured Projects folder on the
server.
Syntax

[Visual Basic (Declaration)]


Public Function ReadTextFile( _
ByVal fileName As String _
) As String

[C#]

public string ReadTextFile(


string fileName
)

[C++]
public:
String ReadTextFile(
String fileName
) sealed

[J#]

public string ReadTextFile(


string fileName
)

[JScript]
public

function ReadTextFile(

fileName : String
) : String

Wonderware Factelligence Client API Reference Guide

94

Chapter 4 API Classes

Parameters

fileName
Holds the file name including any extension, assuming the
configured projects folder as the parent folder.
Return Value

Returns a string containing the file's contents.

Exceptions

An exception is thrown if an error occurs while reading the


file.

RefreshCurUserStatusDataSet() Method
The RefreshCurUserStatusDataSet method updates the current
user's entity status. It creates a recordset that contains the
job information for all entities that the user is logged on. This
recordset can be retrieved by calling the
GetCurUserCurEntInfo() method.
Syntax

[Visual Basic (Declaration)]


Public Sub RefreshCurUserStatusDataSet()

[C#]

public void RefreshCurUserStatusDataSet()

[C++]

public:
void RefreshCurUserStatusDataSet() sealed

[J#]

public void RefreshCurUserStatusDataSet()

[JScript]
public

function RefreshCurUserStatusDataSet()

Exceptions

An exception is thrown if an error occurs while retrieving


the information from the database.

RegisterDNCControl() Method
The RegisterDNCControl() method registers a DNC control for
status updates from the DNC system. DNC status is only
checked if there is at least one control registered for updates.
Syntax

[Visual Basic (Declaration)]


Public Sub RegisterDNCControl( _
ByVal control As Control _
)

[C#]

Wonderware Factelligence Client API Reference Guide

ClientSession Class

95

public void RegisterDNCControl(


Control control
)

[C++]
public:
void RegisterDNCControl(
Control control
) sealed

[J#]

public void RegisterDNCControl(


Control control
)

[JScript]
public

function RegisterDNCControl(

control : Control
)

Parameter

control
Holds a reference with the DNC Control.

RemoveControlFromSingleSignOn() Method
The RemoveControlFromSingleSignOn() method removes the
control from the list of controls using single sign-on.
Syntax

[Visual Basic (Declaration)]


Public Sub RemoveControlFromSingleSignOn( _
ByVal control As Control _
)

[C#]
public void RemoveControlFromSingleSignOn(
Control control
)

[C++]
public:
void RemoveControlFromSingleSignOn(
Control control
) sealed

[J#]

public void RemoveControlFromSingleSignOn(


Control control
)

Wonderware Factelligence Client API Reference Guide

96

Chapter 4 API Classes

[JScript]
public

function RemoveControlFromSingleSignOn(

control : Control
)

Parameter

control
Holds a reference to the control no longer using single
sign-on.

SaveTextFile() Method
The SaveTextFile() method saves a text file into the
configured Projects folder on the server.
Syntax

[Visual Basic (Declaration)]


Public Sub SaveTextFile( _
ByVal fileName As String,

ByVal contents As String _


)

[C#]
public void SaveTextFile(
string fileName,
string contents
)

[C++]
public:
void SaveTextFile(
String fileName,
String contents
) sealed

[J#]

public void SaveTextFile(


string fileName,
string contents
)

[JScript]
public

function SaveTextFile(

fileName : String,
contents : String
)

Wonderware Factelligence Client API Reference Guide

ClientSession Class

97

Parameters

fileName
Holds the file name including any extension, assuming the
configured projects folder as the parent folder.
contents
Holds the text based contents to save.
Exceptions

An exception is thrown if an error occurs while saving the


text file.

SendXMLCmd() Method (String)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload checks
whether the command was executed successfully or not by
checking the <result> tag.
Syntax
[Visual Basic (Declaration)]
Public Sub SendXMLCmd( _
ByVal xmlCmd As String _
)

[C#]
public void SendXMLCmd(
string xmlCmd
)

[C++]
public:
void SendXMLCmd(
String xmlCmd
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd
)

[JScript]
public

function SendXMLCmd(

xmlCmd : String
)

Parameter

xmlCmd
Holds an XML string containing a middleware command.

Wonderware Factelligence Client API Reference Guide

98

Chapter 4 API Classes

Exceptions

An exception is thrown if an error occurs while passing the


command to the middleware or if the XMLParser cannot be
loaded.

SendXMLCmd() Method (String, XMLParser)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload
returns an XMLParser object with the XML response loaded
into it, whether the command was executed successfully or
not. No analysis or decoding is performed on the result.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

<OutAttribute> ByRef xmlParser As XMLParser _


)

[C#]
public void SendXMLCmd(
string xmlCmd,
out XMLParser xmlParser
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,
[OutAttribute] XMLParser% xmlParser
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */
XMLParser xmlParser
)

[JScript]
public

function SendXMLCmd(

xmlCmd : String,
OutAttribute xmlParser : XMLParser
)

Parameters

xmlCmd
Holds an XML string containing a middleware command.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

99

xmlParser
Holds an output parameter for returning an XML parser
containing the response from the middleware.
Exceptions

An exception is thrown if an error occurs while passing the


command to the middle.

SendXMLCmd() Method (String, DateTime)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload checks
whether the command was executed successfully or not by
checking the <result> tag, and then it extracts and returns
by reference the <last_edit_at> value in the XML response.
Use this method for any middleware command that returns a
last_edit_at in the XML response.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

<OutAttribute> ByRef lastEditAt As Date _


)

[C#]
public void SendXMLCmd(
string xmlCmd,
out DateTime lastEditAt
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,
[OutAttribute] DateTime% lastEditAt
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */
DateTime lastEditAt
)

[JScript]
public

function SendXMLCmd(

xmlCmd : String,
OutAttribute lastEditAt : DateTime

Wonderware Factelligence Client API Reference Guide

100

Chapter 4 API Classes

Parameters

xmlCmd
Holds an XML string containing a middleware command.
lastEditAt
Holds an output parameter for returning the last edit at
date/time.
Exceptions

Exception Throws an exception if a successful result is not


received for any reason, or if a valid last_edit_at value
cannot be found.

SendXMLCmd() Method (String, Int32)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload checks
whether the command was executed successfully or not by
checking the <result> tag, and then it extracts and returns
by reference the <identity> value in the XML response. Use
this method for any middleware command that returns an
identity value in the XML response.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

<OutAttribute> ByRef identity As Integer _


)

[C#]
public void SendXMLCmd(
string xmlCmd,
out int identity
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,
[OutAttribute] int% identity
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */ int
identity

Wonderware Factelligence Client API Reference Guide

ClientSession Class

101

[JScript]
public

function SendXMLCmd(

xmlCmd : String,
OutAttribute identity : int
)

Parameters

xmlCmd
Holds an XML string containing a middleware command.
identity
Holds an output parameter for returning the identity.
Exceptions

An exception is thrown if an error occurs while passing the


command to the middleware or if the XMLParser cannot be
loaded.

SendXMLCmd() Method (String, Int32, DateTime)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload checks
whether the command was executed successfully or not by
checking the <result> tag, and then it extracts and returns
by reference the <identity> value AND the <last_edit_at>
value in the XML response. Use this method for any
middleware command that returns an identity value and a
last_edit_at in the XML response.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

<OutAttribute> ByRef identity As Integer,

<OutAttribute> ByRef lastEditAt As Date _


)

[C#]
public void SendXMLCmd(
string xmlCmd,
out int identity,
out DateTime lastEditAt
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,

Wonderware Factelligence Client API Reference Guide

102

Chapter 4 API Classes

[OutAttribute] int% identity,


[OutAttribute] DateTime% lastEditAt
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */ int
identity,
/** @attribute OutAttribute() */ /** @ref */
DateTime lastEditAt
)

[JScript]
public

function SendXMLCmd(

xmlCmd : String,
OutAttribute identity : int,
OutAttribute lastEditAt : DateTime
)

Parameters

xmlCmd
Holds an XML string containing a middleware command.
identity
Holds an output parameter for returning the identity.
lastEditAt
Holds an output parameter for returning the last edit at
date/time.
Exceptions

Exception Throws an exception if a successful result is not


received for any reason, or if a valid identity or last_edit_at
value cannot be found.

SendXMLCmd() Method (String, Int32, String)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload checks
whether the command was executed successfully or not by
checking the <result> tag, and then it extracts and returns
by reference the <identity> value AND the <mod_id> value
in the XML response. Use this method for any middleware
command that returns an identity value and a mod_Id in the
XML response.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

Wonderware Factelligence Client API Reference Guide

ClientSession Class

<OutAttribute> ByRef identity As Integer,

103

<OutAttribute> ByRef modId As String _


)

[C#]
public void SendXMLCmd(
string xmlCmd,
out int identity,
out string modId
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,
[OutAttribute] int% identity,
[OutAttribute] String% modId
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */ int
identity,
/** @attribute OutAttribute() */ /** @ref */ string
modId
)

[JScript]
public

function SendXMLCmd(

xmlCmd : String,
OutAttribute identity : int,
OutAttribute modId : String
)

Parameters

xmlCmd
Holds an XML string containing a middleware command.
identity
Holds an output parameter for returning the identity.
modId
Holds an output parameter for returning the modID.
Exceptions

Exception Throws an exception if a successful result is not


received for any reason, or if a valid identity or mod_id
value cannot be found.

Wonderware Factelligence Client API Reference Guide

104

Chapter 4 API Classes

SendXMLCmd() Method (String, String)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload simply
returns the XML response to the caller as a string, whether
the command was executed successfully or not. No analysis
or decoding is performed on the result.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

<OutAttribute> ByRef xmlResponse As String _


)

[C#]
public void SendXMLCmd(
string xmlCmd,
out string xmlResponse
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,
[OutAttribute] String% xmlResponse
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */ string
xmlResponse
)

[JScript]
public

function SendXMLCmd(

xmlCmd : String,
OutAttribute xmlResponse : String
)

Parameters

xmlCmd
Holds an XML string containing a middleware command.
xmlResponse
Holds an output parameter for returning an XML string
representing the response from the middleware.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

105

Exceptions

An exception is thrown if an error occurs while passing the


command to the middleware.

SendXMLCmd() Method (String, String, Int32)


There are many overloads to the SendXMLCmd which
submits a command to the middleware. This overload checks
whether the command was executed successfully or not by
checking the <result> tag, and then it extracts and returns
by reference the <mod_id> value in the XML response. Use
this method for any middleware command that returns a
mod_id in the XML response.
Syntax

[Visual Basic (Declaration)]


Public Sub SendXMLCmd( _
ByVal xmlCmd As String,

<OutAttribute> ByRef modId As String,

<OutAttribute> ByRef VarForUniqueOverloading As


Integer _
)

[C#]
public void SendXMLCmd(
string xmlCmd,
out string modId,
out int VarForUniqueOverloading
)

[C++]
public:
void SendXMLCmd(
String xmlCmd,
[OutAttribute] String% modId,
[OutAttribute] int% VarForUniqueOverloading
) sealed

[J#]

public void SendXMLCmd(


string xmlCmd,
/** @attribute OutAttribute() */ /** @ref */ string
modId,
/** @attribute OutAttribute() */ /** @ref */ int
VarForUniqueOverloading
)

[JScript]
public

function SendXMLCmd(

Wonderware Factelligence Client API Reference Guide

106

Chapter 4 API Classes

xmlCmd : String,
OutAttribute modId : String,
OutAttribute VarForUniqueOverloading : int
)

Parameters

xmlCmd
Holds an XML string containing a middleware command.
modId
Holds an output parameter for returning the modID.
VarForUniqueOverloading
Not used. Needed to make the overload unique.
Exceptions

Exception Throws an exception if a successful result is not


received for any reason, or if a valid mod_id value cannot be
found.

StartLoggingXMLMsgs() Methods
The StartLoggingXMLMsgs() method starts a message logging
session. This logs all XML commands sent to the middleware
through the ClientSession object's SendXMLCmd methods.
Syntax

[Visual Basic (Declaration)]


Public Sub StartLoggingXMLMsgs( _
ByVal completeFilePath As String,

ByVal durationInSeconds As Integer,


ByVal alsoLogResponses As Boolean _
)

[C#]
public void StartLoggingXMLMsgs(
string completeFilePath,
int durationInSeconds,
bool alsoLogResponses
)

[C++]
public:
void StartLoggingXMLMsgs(
String completeFilePath,
int durationInSeconds,
bool alsoLogResponses
) sealed

[J#]

Wonderware Factelligence Client API Reference Guide

ClientSession Class

107

public void StartLoggingXMLMsgs(


string completeFilePath,
int durationInSeconds,
bool alsoLogResponses
)

[JScript]
public

function StartLoggingXMLMsgs(

completeFilePath : String,
durationInSeconds : int,
alsoLogResponses : bool
)

Parameters

completeFilePath
The complete file path.
durationInSeconds
After how many seconds the logging should automatically
terminate. Max = 3600 which = 1 hour.
alsoLogResponses
If true, the message responses are also logged. Useful for
diagnostics.

StartSession() Method
The StartSession() method starts a session with the
Factelligence middleware for the specified client type. The
client type is one of the types from the ClientTypes
enumeration which signifies the client that is currently using
the session. Examples of client types include Operator and
DataEditor.
The middleware checks that sufficient licenses of this client
type are available before allowing the session. If successful,
the session ID is saved as a private variable and exposed as a
read-only property.
Syntax

[Visual Basic (Declaration)]


Public Sub StartSession( _
ByVal clientType As ClientTypes _
)

[C#]
public void StartSession(
ClientTypes clientType
)

[C++]

Wonderware Factelligence Client API Reference Guide

108

Chapter 4 API Classes

public:
void StartSession(
ClientTypes clientType
) sealed

[J#]

public void StartSession(


ClientTypes clientType
)

[JScript]
public

function StartSession(

clientType : ClientTypes
)

Parameter

clientType
Holds the type of client starting the session.
Exceptions

An exception is thrown if the session cannot be started for


any reason.

StopLoggingXMLMsgs() Method
The StopLoggingXMLMsg() method terminates a message
logging session. This also saves the cached logs to the
specified file.
Syntax

[Visual Basic (Declaration)]


Public Sub StopLoggingXMLMsgs()

[C#]

public void StopLoggingXMLMsgs()

[C++]

public:
void StopLoggingXMLMsgs() sealed

[J#]

public void StopLoggingXMLMsgs()

[JScript]
public

function StopLoggingXMLMsgs()

SwitchUser() Method
The SwitchUser() method switches between users already
logged into the current session. This method sets the curUser
property and causes a UserChanged event to fire. This
method also changes the name of user associated with the

Wonderware Factelligence Client API Reference Guide

ClientSession Class

109

session in the Factelligence database. Setting the curUser


property updates the current user on the client-side, but it
does not change the database.
Syntax

[Visual Basic (Declaration)]


Public Function SwitchUser( _
ByVal swUserID As String,

ByVal UserPw As String _


) As Boolean

[C#]

public bool SwitchUser(


string swUserID,
string UserPw
)

[C++]
public:
bool SwitchUser(
String swUserID,
String UserPw
) sealed

[J#]

public bool SwitchUser(


string swUserID,
string UserPw
)

[JScript]
public

function SwitchUser(

swUserID : String,
UserPw : String
) : bool

Parameters

swUserID
Holds the ID of the user to switch.
UserPw
Holds the password of the user to switch.
Return Value

Returns true if the user is switched.

Wonderware Factelligence Client API Reference Guide

110

Chapter 4 API Classes

UnregisterDNCControl() Method
The UnregisterDNCControl() method removes a DNC control
from the list of controls that are receiving DNC status
updates.
Syntax

[Visual Basic (Declaration)]


Public Sub UnregisterDNCControl( _
ByVal control As Control _
)

[C#]
public void UnregisterDNCControl(
Control control
)

[C++]
public:
void UnregisterDNCControl(
Control control
) sealed

[J#]

public void UnregisterDNCControl(


Control control
)

[JScript]
public

function UnregisterDNCControl(

control : Control
)

Parameter

control
Holds a reference with the DNC Control.

UpdateSystemParameter() Method
The UpdateSystemParameter() method updates the value of
the system parameter that is identified by the input
parameter to the value that is passed in as an input
parameter.
Syntax

[Visual Basic (Declaration)]


Public Sub UpdateSystemParameter ( _
ByValue attrId As Integer, _
ByValue attrValue As Object
)

Wonderware Factelligence Client API Reference Guide

ClientSession Class

111

[C#]
public void UpdateSystemParameter (
int attrId,
object attrValue
)

[C++]
public:
void UpdateSystemParameter (
int attrId,
object attrValue
)

[J#]
public void UpdateSystemParameter (
int attrId,
object attrValue
)

[Jscript]
public function UpdateSystemParameter (
attrId

attrValue

int,
:

object

Parameters

attrId
Holds the ID of the system attribute.
attrValue
Holds the new value to set the attribute value.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

VerifyUser() Method
The VerifyUser() method verifies that the user ID matches an
existing user and that the password is correct for the user.
Syntax

[Visual Basic (Declaration)]


Public Sub VerifyUser( _
ByVal UserId As String,

ByVal UserPw As String _


)

[C#]

Wonderware Factelligence Client API Reference Guide

112

Chapter 4 API Classes

public void VerifyUser(


string UserId,
string UserPw
)

[C++]
public:
void VerifyUser(
String UserId,
String UserPw
) sealed

[J#]

public void VerifyUser(


string UserId,
string UserPw
)

[JScript]
public

function VerifyUser(

UserId : String,
UserPw : String
)

Parameters

UserId
Holds the ID of the user.
UserPw
Holds the password of the user.
Exceptions

An exception is thrown if the user cannot be verified.

ApplicationName Property
The ApplicationName property gets or sets the name of the
application creating the session. The application name is
passed to the Log on dialog for display.
Syntax

[[Visual Basic (Declaration)]]


Public Property ApplicationName As String

[[C#] ]

public string ApplicationName { get; set; }

[[C++] ]

public property string ApplicationName sealed


String get();
void set(String value);
}

Wonderware Factelligence Client API Reference Guide

ClientSession Class

113

[[J#] ]
/** property */
public string get_ApplicationName();
/** property */
public void set_ApplicationName(string value);

[[JScript] ]

public function get ApplicationName() : String


public function set ApplicationName(value : String);

ClientType Property
The ClientType property is a read-only property which
returns the client type as an enumerated value. The client
type is one of the types from the ClientTypes enumeration
which signifies the client that is currently using the session.
Examples of client types include Operator and DataEditor.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property ClientType As ClientTypes

[C#]

public ClientTypes ClientType { get; }

[C++]

public property ClientTypes ClientType sealed


ClientTypes get();
}

[J#]

/** property */
public ClientTypes get_ClientType();

[JScript]

public function get ClientType() : ClientTypes


public function get Constraints() : String

curUser Property
The curUser property is a read/write property which returns
or sets a reference to the current user object.
Syntax

[[Visual Basic (Declaration)]]


Public Property curUser As User

[C#]

public User curUser { get; set; }

[C++]

public property User curUser sealed


User get();
void set(User value);
}

[J#]

Wonderware Factelligence Client API Reference Guide

114

Chapter 4 API Classes

/** property */
public User get_curUser();
/** property */
public void set_curUser(User value);

[JScript]

public function get curUser() : User


public function set curUser(value : User);

DBMSName Property
The DBMSName property is a read-only property which
exposes the name of the database management system.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property DBMSName As String

[C#]

public string DBMSName { get; }

[C++]

public property string DBMSName sealed


String get();
}

[J#]

/** property */
public string get_DBMSName();

[JScript]

public function get DBMSName() : String

EntitiesRequired Property
The EntitiesRequired property gets or sets a flag to indicate
whether or not an application requires entities. If the flag is
true, an entity login (or job-based login) dialog is presented
when a user logs in through the Switch User dialog.
Syntax

[[Visual Basic (Declaration)]]


Public Property EntitiesRequired As Boolean

[C#]

public bool EntitiesRequired { get; set; }

[C++]

public property bool EntitiesRequired sealed


bool get();
void set(bool value);
}

[J#]

/** property */
public bool get_EntitiesRequired();
/** property */

Wonderware Factelligence Client API Reference Guide

ClientSession Class

115

public void set_EntitiesRequired(bool value);

[JScript]

public function get EntitiesRequired() : bool


public function set EntitiesRequired(value : bool);

IsHostedByInTouch Property
The IsHostedByInTouch property is a read-only property
which indicates whether or not InTouch is the host for the
Factelligence controls.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property IsHostedByInTouch As
Boolean

[C#]

public bool IsHostedByInTouch { get; }

[C++]

public property bool IsHostedByInTouch sealed


bool get();
}

[J#]

/** property */
public bool get_IsHostedByInTouch();

[JScript]

public function get IsHostedByInTouch() : bool

IsInTouchUserLoggedIn Property
The IsIntouchUserLoggedIn property is a read-only property
which indicates whether or not a user is logged into InTouch.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property IsInTouchUserLoggedIn As
Boolean

[C#]

public bool IsInTouchUserLoggedIn { get; }

[C++]

public property bool IsInTouchUserLoggedIn sealed


bool get();
}

[J#]

/** property */
public bool get_IsInTouchUserLoggedIn();

[JScript]

public function get IsInTouchUserLoggedIn() : bool

Wonderware Factelligence Client API Reference Guide

116

Chapter 4 API Classes

IsSingleSignOnEnabled Property
The IsSingleSignOnEnabled property is a read-only property
which gets the status of single sign-on in InTouch. If InTouch
security is turned on, then Factelligence attempts to use the
InTouch user for signing on to InTouch.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property IsSingleSignOnEnabled As
Boolean

[C#]

public bool IsSingleSignOnEnabled { get; }

[C++]

public property bool IsSingleSignOnEnabled sealed


bool get();
}

[J#]

/** property */
public bool get_IsSingleSignOnEnabled();

[JScript]

public function get IsSingleSignOnEnabled() : bool


c

LicenseInfo Property
The LicenseInfo property is a read-only property returns a
reference to the current LicenseInfo object.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property LicenseInfo As LicenseInfo

[C#]

public LicenseInfo LicenseInfo { get; }

[C++]

public property LicenseInfo LicenseInfo sealed


LicenseInfo get();
}

[J#]

/** property */
public LicenseInfo get_LicenseInfo();

[JScript]

public function get LicenseInfo() : LicenseInfo

Wonderware Factelligence Client API Reference Guide

ClientSession Class

117

MainForm Property
The MainForm property is a read-only property that gets the
value of the Main form of the application. If the top level
application is not a .Net program, such as, InTouch, the
property returns a null value.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property MainForm As Form

[C#]

public Form MainForm { get; }

[C++]

public property Form MainForm sealed


Form get();
}

[J#]

/** property */
public Form get_MainForm();

[JScript]

public function get MainForm() : Form

MESVersion Property
The MESVersion property is a read-only property that returns
the MES version to which this instance is connected.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property MESVersion As MESVersions

[C#]

public MESVersions MESVersion { get; }

[C++]

public property MESVersions MESVersion sealed


MESVersions get();
}

[J#]

/** property */
public MESVersions get_MESVersion();

[JScript]

public function get MESVersion() : MESVersions

MiddlewareAccess Property
The MiddlewareAccess property is a class-level property that
gets and sets the middleware access method.
Syntax

[[Visual Basic (Declaration)] ]

Wonderware Factelligence Client API Reference Guide

118

Chapter 4 API Classes

Public Shared Property MiddlewareAccess As


MiddlewareAccessType

[C#]

public static MiddlewareAccessType MiddlewareAccess


{ get; set; }

[C++]

public static property MiddlewareAccessType


MiddlewareAccess {
MiddlewareAccessType get();
void set(MiddlewareAccessType value);
}

[J#]

/** property */
public MiddlewareAccessType get_MiddlewareAccess();
/** property */
public void
set_MiddlewareAccess(MiddlewareAccessType value);

[JScript]

public function get MiddlewareAccess() :


MiddlewareAccessType
public function set MiddlewareAccess(value :
MiddlewareAccessType);

SelectForm Property
The SelectForm property gets an object which implements the
ISelectForm. This can be passed to the button bar to allow
Forms to be selected for the OpenForm button.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property SelectForm As ISelectForm

[C#]

public ISelectForm SelectForm { get; }

[C++]

public property ISelectForm SelectForm sealed


ISelectForm get();
}

[J#]

/** property */
public ISelectForm get_SelectForm();

[JScript]

public function get SelectForm() : ISelectForm

SessionId Property
The SessionId property is a read-only property that returns
the current session ID. If a session has not been started, the
property returns a value of -1.

Wonderware Factelligence Client API Reference Guide

ClientSession Class

119

Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property SessionId As Integer

[C#]

public int SessionId { get; }

[C++]
public property int SessionId sealed
int get();
}

[J#]

/** property */
public int get_SessionId();

[JScript]

public function get SessionId() : int

ShowLanguageIDs Property
The ShowLanguageIDs property determines whether language
IDs are shown for translatable strings. This can be helpful
when trying to translate to a new language as the you see the
string IDs in context. This property is used when creating a
new LangStrings object which is done when a user is added
to the system. Changing this property not affects the
LangStrings objects of any user already logged onto the
system. It is best to set this property at start-up.
Syntax

[[Visual Basic (Declaration)] ]


Public Property ShowLanguageIDs As Boolean

[C#]

public bool ShowLanguageIDs { get; set; }

[C++]

public property bool ShowLanguageIDs sealed


bool get();
void set(bool value);
}

[J#]

/** property */
public bool get_ShowLanguageIDs();
/** property */
public void set_ShowLanguageIDs(bool value);

[JScript]

public function get ShowLanguageIDs() : bool


public function set ShowLanguageIDs(value : bool);

Wonderware Factelligence Client API Reference Guide

120

Chapter 4 API Classes

SystemAttrs Property
The SystemAttrs property is a read-only property that returns
a reference to the current SystemAttr object. This object is
used to check the values of the system attributes.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property SystemAttrs As SystemAttrs

[C#]

public SystemAttrs SystemAttrs { get; }

[C++]

public property SystemAttrs SystemAttrs sealed


SystemAttrs get();
}

[J#]

/** property */
public SystemAttrs get_SystemAttrs();

[JScript]

public function get SystemAttrs() : SystemAttrs

TopLevelFont Property
The TopLevelFont property is a read-only property that
specifies the font of the parent form from which the Login
occurred.
Syntax

[[Visual Basic (Declaration)] ]


Public Property TopLevelFont As Font

[C#]

public Font TopLevelFont { get; set; }

[C++]

public property Font TopLevelFont sealed


Font get();
void set(Font value);
}

[J#]

/** property */
public Font get_TopLevelFont();
/** property */
public void set_TopLevelFont(Font value);

[JScript]

public function get TopLevelFont() : Font


public function set TopLevelFont(value : Font);

Wonderware Factelligence Client API Reference Guide

ClientSession Class

121

UIPlatform Property
The UIPlatform property is a class-level property that gets
and sets the middleware access method.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Property UIPlatform As UIPlatformType

[C#]

public static UIPlatformType UIPlatform { get; set;


}

[C++]

public static property UIPlatformType UIPlatform {


UIPlatformType get();
void set(UIPlatformType value);
}

[J#]

/** property */
public UIPlatformType get_UIPlatform();
/** property */
public void set_UIPlatform(UIPlatformType value);

[JScript]

public function get UIPlatform() : UIPlatformType


public function set UIPlatform(value :
UIPlatformType);

UserList Property
The UserList property is a read-only property that exposes a
list of users who are currently logged on to this Factelligence
session.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UserList As ICollection

[C#]

public ICollection UserList { get; }

[C++]

public property ICollection UserList sealed


ICollection get();
}

[J#]

/** property */
public ICollection get_UserList();

[JScript]

public function get UserList() : ICollection

Wonderware Factelligence Client API Reference Guide

122

Chapter 4 API Classes

Ent Class
The Ent class handles all the Factelligence MES
functionalities for an entity. An Ent object is created for each
entity that the user logs in. The Ent object creates service
objects for each capability of the entity (for example, a
JobExec object is created if the entity has the "can run jobs"
capability).

AddDirectory() Method (Int32, String)


The AddDirectory() method adds a directory to the directories
of a specified entity. If the directory is an upload directory, a
seqNo of -1 is specified. A seqNo of 0 or greater is specified for
a download directory giving the order of the directory in the
list of download directories. The directory is saved in the dir
table.
Syntax

[[Visual Basic (Declaration)] ]


Public Sub AddDirectory( _
ByVal seqNo As Integer, _
ByVal directory As String _
)

[[C#] ]

public void AddDirectory(


int seqNo,
string directory
)

[C++]

public:
void AddDirectory(
int seqNo,
String directory
) sealed

[[J#] ]

public void AddDirectory(


int seqNo,
string directory
)

[[JScript] ]

public function AddDirectory(


seqNo : int,
directory : String
)

Parameters

seqNo
Holds the sequence number of the directory. This specifies
the order of the download directories, for limiting user
access. A -1 is used if the directory is an upload directory.

Wonderware Factelligence Client API Reference Guide

Ent Class

123

directory
Holds the name of the directory which includes the path to
the directory.
Exceptions

An exception is thrown if an error occurs while writing the


record to the database.

AddDirectory() Method (Int32, Int32, String)


The AddDirectory() method adds a directory to the directories
of a specified entity. If the directory is an upload directory, a
seqNo of -1 is specified. A seqNo of 0 or greater is specified for
a download directory giving the order of the directory in the
list of download directories. The directory is saved in the dir
table.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddDirectory( _
ByVal entID As Integer,

ByVal seqNo As Integer,

ByVal directory As String _


)

[C#]
public static void AddDirectory(
int entID,
int seqNo,

string directory

[C++]
public:
static void AddDirectory(
int entID,
int seqNo,
String directory
)
[J#]
public static void AddDirectory(
int entID,
int seqNo,
string directory
)

Wonderware Factelligence Client API Reference Guide

124

Chapter 4 API Classes

[JScript]
public static

function AddDirectory(

entID : int,
seqNo : int,
directory : String
)

Parameters

entID
Holds the ID of the entity.
seqNo
Holds the sequence number of the directory. This specifies
the order of the download directories, for limiting user
access. A -1 is used if the directory is an upload directory.
directory
Holds the name of the directory.
Exceptions

An exception is thrown if an error occurs while retrieving


the records from the database.

AddShift() Method
The AddShift() method adds a shift to the entity shift
schedule of the current entity if the entity can schedule
shifts.
Syntax

[Visual Basic (Declaration)]


Public Sub AddShift ( _
ByValue startDay As Integer, _
ByValue shiftId As Integer, _
ByValue shiftStart As DateTime, _
ByValue shiftEnd As DateTime, _
ByValue break1Start As DateTime, _
ByValue break1End As DateTime, _
ByValue break2Start As DateTime, _
ByValue break2End As DateTime, _
ByValue break3Start As DateTime, _
ByValue break3End As DateTime
)

[C#]
public void AddShift (
int startDay,
int shiftId,

Wonderware Factelligence Client API Reference Guide

Ent Class

125

DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break2End,
DateTime break3Start,
DateTime break3End
)

[C++]
public:
void AddShift (
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break3Start,
DateTime break3End
)

[J#]
public void AddShift(
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break3Start,
DateTime break3End
)

[Jscript]
public function AddShift (
startDay :
shiftId :

int,
int,

shiftStart
shiftEnd

break1Start

DateTime,

DateTime,
:

DateTime,

Wonderware Factelligence Client API Reference Guide

126

Chapter 4 API Classes

break1End

break2Start
break2End

break3Start
break3End

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime

Parameters

startDay
Holds the day of the week on which shift applies.
shiftId
Holds the system shift that is added to the entities
schedule.
shiftStart
Holds the date/time containing the time that the shift
starts for the entity shift schedule.
shiftEnd
Holds the date/time containing the time that the shift ends
for the entity shift schedule.
break1Start
Holds the date/time containing the time that the first break
starts for the shift.
break1End
Holds the date/time containing the time that the first break
ends for the shift.
break2Start
Holds the date/time containing the time that the second
break starts for the shift.
break2End
Holds the date/time containing the time that the second
break ends for the shift.
break3Start
Holds the date/time containing the time that the third
break starts for the shift.
break3End
Holds the date/time containing the time that the third
break ends for the shift.

Wonderware Factelligence Client API Reference Guide

Ent Class

127

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

CopyEntityShiftSchedule() Method
The CopyEntityShiftSchedule() method takes a list of entity
IDs and a string containing ordered pairs of shifts and copies
the shift schedule from the entity defined by this entity object
into each entity in the entity list if the entity from the list can
schedule shifts. Only those shifts are copied from the shift ID
list which are identified.
Note If a shift ID list is not available, all shifts defined for the
entity are copied.
Syntax

[Visual Basic (Declaration)]


Public Sub CopyEntityShiftSchedule ( _
ByValue entIDs As List (Of Integer),
ByValue shiftIDs As String
)

[C#]
public void CopyEntityShiftSchedule(
List<int> entIDs,
List<int>shiftIDs
)

[C++]
public:
void CopyEntityShiftSchedule (
List<int> entIDs,
String shiftIDs
)

[J#]
public void CopyEntityShiftSchedule (
List<int> entIDs,
String shiftIDs
)

[Jscript]
public function CopyEntityShiftSchedule (
entIDs

shiftIDs:

List<int>
string

Wonderware Factelligence Client API Reference Guide

128

Chapter 4 API Classes

Parameters

entIDs
Holds a list of integers identifying the entities to which the
shift schedule is to be copied in the shift schedule.
shiftIDs
Holds a string of ordered pairs identifying the shifts that
are to be copied from the source entity to the shift schedule
of all entities in the entity list. The ordered pair is in the
form #:# where the first integer identifies the start day and
the second integer after the colon identifies the shift ID. To
copy all shifts for a day, specify #: without a shift ID. To
copy a shift for all days, specify:# without a start day.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DeleteShift() Method
The DeleteShift() method removes the shift identified by the
input parameters from the shift schedule of the entity
identified by the entity object.
Syntax

[Visual Basic (Declaration)]


Public Sub DeleteShift ( _
ByValue shiftId As Integer, _
ByValue startDay As Integer
)

[C#]
public void DeleteShift (
int shiftId,
int startDay
)

[C++]
public:
void DeleteShift (
int shiftId,
int startDay
)

[J#]
public void DeleteShift (
int shiftId,
int startDay
)

Wonderware Factelligence Client API Reference Guide

Ent Class

129

[Jscript]
public function DeleteShift (
shiftId

startDay

int,
int

Parameters

shiftId
Holds an integer defining the shift that is to be removed.
startDay
Holds the day of the week when the shift is to be removed.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

EndJob() Method
The EndJob() method ends the job that is identified by the
input parameters. If the job is a part of a batch, an attempt is
made to end all jobs in the batch. Ending a job changes the
job state to completed.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub EndJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String _


)

[C#]
public static void EndJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[C++]
public:
static void EndJob(
String woId,
String operId,
int seqNo,

Wonderware Factelligence Client API Reference Guide

130

Chapter 4 API Classes

String statusNotes
)

[J#]
public static void EndJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[JScript]
public static

function EndJob(

woId : String,
operId : String,
seqNo : int,
statusNotes : String
)

Parameters

woId
Holds the work order for identifying the job that is to be
completed.
operId
Holds the operation ID for identifying the job that is to be
completed.
seqNo
Holds the sequence number for identifying the job that is to
completed.
statusNotes
Holds the status notes that are to be saved with the job
when the job is completed. These notes are edited on the
dialog used to confirm that the user wants to complete the
job.
Exceptions

An exception is thrown if an error occurs.

EntIdFromName() Method
The EntIdFromName() method returns the entity ID of the
given entity name. The entity ID is a unique integer value
which represents each entity. If no entity is found, the
method returns the value of -1.
Syntax

[Visual Basic (Declaration)]


Public Shared Function EntIdFromName( _

Wonderware Factelligence Client API Reference Guide

Ent Class

131

ByVal entName As String _


) As Integer

[C#]

public static int EntIdFromName(


string entName
)

[C++]
public:
static int EntIdFromName(
String entName
)

[J#]
public static int EntIdFromName(
string entName
)

[JScript]
public static

function EntIdFromName(

entName : String
) : int

Parameter

entName
Holds the name of the entity to return the ID.
Return Value

Returns an int representing the ID of the named entity.

Exceptions

An exception is thrown if there is a problem accessing the


ent table.

GetDirectories() Method (seqNo)


The GetDirectories() method gets the directories that are
configured for the entity. If a sequence number is specified,
only the directory with a matching sequence number is
returned.
Syntax

[Visual Basic (Declaration)]


Public Function GetDirectories( _
ByVal seqNo As Object _
) As DataSet

[C#]

public DataSet GetDirectories(


object seqNo

Wonderware Factelligence Client API Reference Guide

132

Chapter 4 API Classes

[C++]
public:
DataSet GetDirectories(
Object seqNo
) sealed

[J#]

public DataSet GetDirectories(


object seqNo
)

[JScript]
public

function GetDirectories(

seqNo : Object
) : DataSet

Parameter

seqNo
Optional integer representing the sequence number of the
desired directory. This value can be set to null if all
directories are desired.
Return Value

Returns a DataSet containing the matching rows from the


dir table.

Exceptions

An exception is thrown if an error occurs while retreiving


the records from the database.

GetDirectories() Method (entID, seqNo)


The GetDirectories() method returns the directories for any
specified entity or all entities if no entity ID is supplied. If a
sequence number is supplied, it returns only the directories
which match the sequence number.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function GetDirectories( _
ByVal entID As Object, _
ByVal seqNo As Object _
) As DataSet

[[C#] ]

public static DataSet GetDirectories(


object entID,
object seqNo
)

[C++]

public:

Wonderware Factelligence Client API Reference Guide

Ent Class

133

static DataSet GetDirectories(


Object entID,
Object seqNo
)

[[J#] ]

public static DataSet GetDirectories(


object entID,
object seqNo
)

[JScript]

public static function GetDirectories(


entID : Object,
seqNo : Object
) : DataSet

Parameters

entID
Optional ID of the entity whose directories want to retrieve.
Pass null for the entID to return the directories of all
entities.
seqNo
Optional integer representing the sequence number of the
desired directory. This value can be set to null if all
directories are desired.
Return Value

Returns a DataSet containing the matching rows from the


dir table.

Exceptions

An exception is thrown if an error occurs while retreiving


the records from the database.

GetEntAttributes() Method
The GetEntAttributes() method returns a DataSet of entity
attributes. The data set can be filtered by an entity ID and/or
an attribute ID.
Syntax

[Visual Basic (Declaration)]


Public Function GetEntAttributes( _
ByVal entId As Object,

ByVal attrId As Object _


) As DataSet

[C#]

public DataSet GetEntAttributes(


object entId,
object attrId
)

Wonderware Factelligence Client API Reference Guide

134

Chapter 4 API Classes

[C++]
public:
DataSet GetEntAttributes(
Object entId,
Object attrId
) sealed

[J#]

public DataSet GetEntAttributes(


object entId,
object attrId
)

[JScript]
public

function GetEntAttributes(

entId : Object,
attrId : Object
) : DataSet

Parameters

entId
Holds an integer representing the entity ID to use as a filter
or null if no entity ID filter is to be used.
attrId
Holds an integer representing the attribute ID to use as a
filter or null if no attribute ID filter is to be used.
Return Value

Returns a DataSet with a row for every entity attribute


which matched the supplied filter.

Exceptions

Exception Throw if an error occurs while retrieving the


data from the database.

GetJobPos() Method
The GetJobPos() method returns the job position of the
specified job by determining which job exec for the current
entity the job is running on.
Syntax

[Visual Basic (Declaration)]


Public Function GetJobPos( _
ByVal woId As String,

ByVal operId As String,


ByVal seqNo As Integer _
) As Integer

Wonderware Factelligence Client API Reference Guide

Ent Class

135

[C#]
public int GetJobPos(
string woId,
string operId,
int seqNo
)

[C++]
public:
int GetJobPos(
String woId,
String operId,
int seqNo
) sealed

[J#]

public int GetJobPos(


string woId,
string operId,
int seqNo
)

[JScript]
public

function GetJobPos(

woId : String,
operId : String,
seqNo : int
) : int

Parameters

woId
Holds the work order of the job for which the job position is
retrieved.
operId
Holds the operation ID of the job for which the job position
is retrieved.
seqNo
Holds the sequence number of the job for which the job
position is retrieved.
Return Value

Returns an integer value that represents the job position on


the entity at which the specified job is running.

Wonderware Factelligence Client API Reference Guide

136

Chapter 4 API Classes

GetJobString() Method
The GetJobString() method returns a string containing the job
information for the job that is running at the specified job
position. The string contains the work order ID of the job
followed by a "_" followed by the operation ID of the job
followed by a "_" followed by the sequence number of the job.
A job is identified by a work order, operation, and sequence.
Syntax

[Visual Basic (Declaration)]


Public Function GetJobString( _
ByVal jobPos As Integer _
) As String

[C#]

public string GetJobString(


int jobPos
)

[C++]
public:
String GetJobString(
int jobPos
) sealed

[J#]

public string GetJobString(


int jobPos
)

[JScript]
public

function GetJobString(

jobPos : int
) : String

Parameter

jobPos
The job position where the job is that want the information
for in the form of a string.
Return Value

Returns a string containing the job identifiers for the job


running at the specified job position. The job identifiers
include the work order, operation, and sequence number.
The identifiers are separated by underscores in the string.

Wonderware Factelligence Client API Reference Guide

Ent Class

137

GetNumberOfJobsOnEntUserLoggedInto()
Method
The GetNumberOfJobsOnEntUserLoggedInto() method returns
the number of jobs running on the entity that the current
user is logged in.
Syntax

[Visual Basic (Declaration)]


Public Function GetNumberOfJobsOnEntUserLoggedInto() As
Integer

[C#]

public int GetNumberOfJobsOnEntUserLoggedInto()

[C++]

public:
int GetNumberOfJobsOnEntUserLoggedInto() sealed

[J#]

public int GetNumberOfJobsOnEntUserLoggedInto()

[JScript]

public function GetNumberOfJobsOnEntUserLoggedInto() :


int

Return Value

Returns an integer value that is the number of jobs that are


currently running on the entity that the current user is
logged in.

GetTagValue() Method
The GetTagValue() method returns the last value for the
specified tag.
Syntax

[Visual Basic (Declaration)]


Public Function GetTagValue( _
ByVal tagDesc As String,

ByVal bomPos As Object _


) As String

[C#]

public string GetTagValue(


string tagDesc,
object bomPos
)

[C++]
public:
String GetTagValue(

Wonderware Factelligence Client API Reference Guide

138

Chapter 4 API Classes

String tagDesc,
Object bomPos
) sealed

[J#]

public string GetTagValue(


string tagDesc,
object bomPos
)

[JScript]
public

function GetTagValue(

tagDesc : String,
bomPos : Object
) : String

Parameters

tagDesc
Holds the name of the tag to read.
bomPos
Optional. Holds the BOM position if required.
Return Value

Returns a string representing the value of the tag.

Exceptions

An exception is thrown if an error occurs while getting the


tag value from the database.

GetUsersOnEnt() Method
The GetUsersOnEnt() method returns a list of all users who
are logged into the current entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetUsersOnEnt() As ArrayList

[C#]

public ArrayList GetUsersOnEnt()

[C++]

public:
ArrayList GetUsersOnEnt() sealed

[J#]

public ArrayList GetUsersOnEnt()

[JScript]
public

function GetUsersOnEnt() : ArrayList

Return Value

Returns an ArrayList of User objects.

Wonderware Factelligence Client API Reference Guide

Ent Class

139

GetEntityShiftSchedule() Method
This method returns a DataSet containing all shifts defined
for the entity by the entity object.
Syntax

[Visual Basic (Declaration)]


Public Function GetEntityShiftSchedule ( _
) As DataSet

[C#]

public DataSet GetEntityShiftSchedule(


)

[C++]
public:
DataSet GetEntityShiftSchedule (
)

[J#]
public DataSet GetEntityShiftSchedule (
)

[Jscript]
public function GetEntityShiftSchedule (
)

DataSet

Return Value

Returns a DataSet containing all the shifts defined for the


entity by the entity object.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetEntAttributes() Method
The GetEntAttributes() method returns a DataSet of entity
attributes. The data set can be filtered by an entity ID and/or
an attribute ID.
Syntax

[Visual Basic (Declaration)]


Public Function GetEntAttributes( _
ByVal entId As Object,

ByVal attrId As Object _


) As DataSet

[C#]

public DataSet GetEntAttributes(


object entId,
object attrId

Wonderware Factelligence Client API Reference Guide

140

Chapter 4 API Classes

[C++]
public:
DataSet GetEntAttributes(
Object entId,
Object attrId
) sealed

[J#]

public DataSet GetEntAttributes(


object entId,
object attrId
)

[JScript]
public

function GetEntAttributes(

entId : Object,
attrId : Object
) : DataSet

Parameters

entId
Holds an integer representing the entity ID to use as a filter
or null if no entity ID filter is to be used.
attrId
Holds an integer representing the attribute ID to use as a
filter or null if no attribute ID filter is to be used.
Return Value

Returns a DataSet with a row for every entity attribute


which matched the supplied filter.

Exceptions

Exception throw if an error occurs while retrieving the data


from the database.

PauseJob() Method
The PauseJob() method pauses the specified job that is
currently running on this entity, or changes the paused state
to another paused state. The job status is set to New,
Suspended, or On Hold.
Syntax

[Visual Basic (Declaration)]


Public Sub PauseJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

Wonderware Factelligence Client API Reference Guide

Ent Class

ByVal curStateCd As JobStates,

ByVal newStateCd As JobStates,

ByVal editTime As String,

141

ByVal statusNotes As String,

ByVal concurrent_link As Integer _


)

[C#]
public void PauseJob(
string woId,
string operId,
int seqNo,
JobStates curStateCd,
JobStates newStateCd,
string editTime,
string statusNotes,
int concurrent_link
)

[C++]
public:
void PauseJob(
String woId,
String operId,
int seqNo,
JobStates curStateCd,
JobStates newStateCd,
String editTime,
String statusNotes,
int concurrent_link
) sealed

[J#]

public void PauseJob(


string woId,
string operId,
int seqNo,
JobStates curStateCd,
JobStates newStateCd,
string editTime,
string statusNotes,
int concurrent_link
)

[JScript]

Wonderware Factelligence Client API Reference Guide

142

Chapter 4 API Classes

public

function PauseJob(

woId : String,
operId : String,
seqNo : int,
curStateCd : JobStates,
newStateCd : JobStates,
editTime : String,
statusNotes : String,
concurrent_link : int
)

Parameters

woId
Holds the work order of the job to be paused.
operId
Holds the operation ID of the job to be paused.
seqNo
Holds the operation Sequence of the job to be paused.
curStateCd
Holds the current state of the job.
newStateCd
Holds the new state of the job. This should be New,
Suspended, or On Hold.
editTime
Holds the timestamp of the last edit of the job record in the
database. This must match the current value in the
database, or the record cannot be changed.
statusNotes
Holds the notes about pausing the job. This may be an
empty string.
concurrent_link
Holds the concurrent link value of the job which is the value
that indicates if this job is part of a batch jobs and, if so,
which other jobs in the queue it is batched with. Batched
jobs are all paused at one time.
Exceptions

An exception is thrown if the current job state for the job is


running but the job is not currently running on the machine
or if an error occurs while updating the database.

Wonderware Factelligence Client API Reference Guide

Ent Class

143

ProcessJobsBeforeLogoff() Method
The ProcessJobsBeforeLogoff() method processes the jobs
being logged off by the specified user by first checking the
system parameter to prompt for quantities to see if it is true.
If it is true, for each job the user is logging off, the user is
prompted to enter production quantities. It is then
determined if the user is the only user currently logged into
the job and if the job can run without an operator. If it
cannot, the job pauses before logging the user off of the job.
Syntax

[[Visual Basic (Declaration)] ]


Public Function ProcessJobsBeforeLogoff( _
ByVal theUser As User _
) As Boolean

[[C#] ]

public bool ProcessJobsBeforeLogoff(


User theUser
)

[[C++] ]

public:
bool ProcessJobsBeforeLogoff(
User theUser
) sealed

[[J#] ]

public bool ProcessJobsBeforeLogoff(


User theUser
)

[[JScript] ]

public function ProcessJobsBeforeLogoff(


theUser : User
) : bool

Parameter

theUser
Holds the user object containing user information for the
user that is logging off.
Return Value

Returns a boolean value indicating if any jobs were paused


because this is the only operator for the job and it cannot
run without an operator.

Exceptions

An exception is thrown if an attempt is made to pause one


of the jobs that the user is currently logged into and it fails.

Wonderware Factelligence Client API Reference Guide

144

Chapter 4 API Classes

PromptForQuantities() Method
Overloaded. The PromptForQuantities() method prompts the
user for production quantities for each running job that the
user is logged into on the entity.
Syntax

[Visual Basic (Declaration)]


Public Sub PromptForQuantities()

[C#]

public void PromptForQuantities()

[C++]

public:
void PromptForQuantities() sealed

[J#]

public void PromptForQuantities()

[JScript]
public

function PromptForQuantities()

PromptForQuantities() Method (String, String,


String, Int32, Double, Double, Double, String)
The PromptForQuantities() method prompts the user for the
production quantities for the specified job.
Syntax

[Visual Basic (Declaration)]


Public Function PromptForQuantities( _
ByVal item_id As String,
ByVal wo_id As String,

ByVal oper_id As String,

ByVal seq_no As Integer,

ByVal qtyProd As Double,

ByVal qtyRej As Double,

ByVal qtyStart As Double,

ByVal jobDesc As String _


) As Boolean

[C#]

public bool PromptForQuantities(


string item_id,
string wo_id,
string oper_id,
int seq_no,
double qtyProd,

Wonderware Factelligence Client API Reference Guide

Ent Class

145

double qtyRej,
double qtyStart,
string jobDesc
)

[C++]
public:
bool PromptForQuantities(
String item_id,
String wo_id,
String oper_id,
int seq_no,
double qtyProd,
double qtyRej,
double qtyStart,
String jobDesc
) sealed

[J#]

public bool PromptForQuantities(


string item_id,
string wo_id,
string oper_id,
int seq_no,
double qtyProd,
double qtyRej,
double qtyStart,
string jobDesc
)

[JScript]
public

function PromptForQuantities(

item_id : String,
wo_id : String,
oper_id : String,
seq_no : int,
qtyProd : double,
qtyRej : double,
qtyStart : double,
jobDesc : String
) : bool

Wonderware Factelligence Client API Reference Guide

146

Chapter 4 API Classes

Parameters

item_id
Holds the item that is being produced by the job.
wo_id
Holds the work order ID of the job.
oper_id
Holds the operation ID of the job.
seq_no
Holds the sequence number of the job.
qtyProd
Holds the current quantity of the job that has been
produced as good.
qtyRej
Holds the current quantity of the job that has been
produced as scrap.
qtyStart
Holds the start quantity of the job.
jobDesc
Holds the job description of the specified job. It is used in
the title of the Add Production dialog.
Return Value

Returns a boolean flag indicating whether production was


added for the item.

PrepareProductionAttributes() Method
The PrepareProductionAttributes() method accepts a set of
values for all production attributes and creates a data entry
job to support logging utilization against these attributes.
Syntax

[Visual Basic (Declaration)]


Public Function PrepareProductionAttributes( _
ByValue item As String, _
ByValue itemClass As String, _
ByValue ItemUOM As String,_
ByValue workOrder As String, _
ByValue operation As String, _
ByValue targetProdRate As Double, _
ByValue uom As Integer, _
ByValue batchSize As Double, _
ByValue startQty As Double, _
ByValue reqdQty As Double,_

Wonderware Factelligence Client API Reference Guide

Ent Class

147

ByValue operator As String


) As String

[C#]
public string PrepareProductionAttributes (
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[C++]
public:
string PrepareProductionAttributes (
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[J#]
public string PrepareProductionAttributes (
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,

Wonderware Factelligence Client API Reference Guide

148

Chapter 4 API Classes

double batchSize,
double startQty,
double reqdQty,
string operator
)

[Jscript]
public function PrepareProductionAttributes (
item

string,

itemClass
itemUOM

string,

string,

workOrder

string,

operation

string,

targetProdRate
uom

double,

int,

batchSize

double,

startQty

double,

reqdQty

double,

operator

string

) : string

Parameters

item
Holds a string identifying the item for the data entry job.
itemClass
Holds a string identifying the item class ID of the item.
itemUOM
Holds a string which is description to identify the unit of
measure for the item.
workOrder
Holds a string identifying the work order for the data entry
job.
operation
Holds a string identifying the operation for the data entry
job.
targetProdRate
Holds a floating-point value indicating the target
production rate.
uom
Holds an integer indicating the unit of measure for the
target production rate.

Wonderware Factelligence Client API Reference Guide

Ent Class

149

batchSize
Holds a floating-point value indicating the batch size for the
data entry job.
startQty
Holds a floating-point value indicating the start quantity
for the data entry job.
reqdQty
Holds a floating-point value indicating the required
quantity for the data entry job.
operator
Holds a string identifying the user ID to associate with the
entity.
Return Value

A string containing any warnings given when attempting to


stop any running jobs and start the new job specified by the
production attributes.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

SetCurJobExec() Method (Int32)


The SetCurJobExec() method sets the current job exec to the
job position specified. This makes the job running at the
specified job position.
Syntax

[Visual Basic (Declaration)]


Public Sub SetCurJobExec( _
ByVal jobPos As Integer _
)

[C#]
public void SetCurJobExec(
int jobPos
)

[C++]
public:
void SetCurJobExec(
int jobPos
) sealed

[J#]

public void SetCurJobExec(


int jobPos
)

Wonderware Factelligence Client API Reference Guide

150

Chapter 4 API Classes

[JScript]
public

function SetCurJobExec(

jobPos : int
)

Parameter

jobPos
Holds the job position of the entities job exec objects that is
to be set as the current job exec meaning it contains the job
the user is currently working on.
Exceptions

Thrown if the job position is not a legitimate position for the


current entity.

SetCurJobExec() Method (String, String, Int32)


The SetCurJobExec() method sets the current job exec to the
job position on which the specified job is running. This sets
the specified job as the current job that the user is working
on.
Syntax

[Visual Basic (Declaration)]


Public Sub SetCurJobExec( _
ByVal woId As String,

ByVal operId As String,


ByVal seqNo As Integer _
)

[C#]
public void SetCurJobExec(
string woId,
string operId,
int seqNo
)

[C++]
public:
void SetCurJobExec(
String woId,
String operId,
int seqNo
) sealed

[J#]

public void SetCurJobExec(


string woId,

Wonderware Factelligence Client API Reference Guide

Ent Class

151

string operId,
int seqNo
)

[JScript]
public

function SetCurJobExec(

woId : String,
operId : String,
seqNo : int
)

Parameters

woId
Holds the work order of the job that is to be made the
current job.
operId
Holds the operation ID of the job that is to be made the
current job.
seqNo
Holds the operation sequence of the job that is to be made
the current job.
Exceptions

An exception is thrown if the specified job is not running on


one of the entities job execs.

SetEntAttributes() Method
The SetEntAttributes() method sets the value of the specified
entity attribute for the given entity.
Syntax

[Visual Basic (Declaration)]


Public Sub SetEntAttributes( _
ByVal entId As Integer,
ByVal attrId As Integer,

_
_

ByVal attrValue As String,

ByVal lastEditAt As String _


)

[C#]
public void SetEntAttributes(
int entId,
int attrId,
string attrValue,
string lastEditAt
)

Wonderware Factelligence Client API Reference Guide

152

Chapter 4 API Classes

[C++]
public:
void SetEntAttributes(
int entId,
int attrId,
String attrValue,
String lastEditAt
) sealed

[J#]

public void SetEntAttributes(


int entId,
int attrId,
string attrValue,
string lastEditAt
)

[JScript]
public

function SetEntAttributes(

entId : int,
attrId : int,
attrValue : String,
lastEditAt : String
)

Parameters

entId
Holds the ID of the entity for which the attribute is set.
attrId
Holds the ID of the entity for which the attribute is set.
attrValue
Holds the new value of the attribute.
lastEditAt
Holds the timestamp for the last edit of the value for an
existing attribute. This must match the time stamp in the
database or the update fails. For a new attribute, this value
is passed as a null.
Exceptions

An exception is thrown if an error occurs while writing.

SetTagValue() Method
The SetTAgValue() method sets the last value for the specified
tag. If the tag is a BOM tag, then the BOM position must be
specified.

Wonderware Factelligence Client API Reference Guide

Ent Class

153

Syntax

[Visual Basic (Declaration)]


Public Sub SetTagValue( _
ByVal TagDesc As String,

ByVal TagValue As String,

ByVal BomPos As Object _


)

[C#]
public void SetTagValue(
string TagDesc,
string TagValue,
object BomPos
)

[C++]
public:
void SetTagValue(
String TagDesc,
String TagValue,
Object BomPos
) sealed

[J#]

public void SetTagValue(


string TagDesc,
string TagValue,
object BomPos
)

[JScript]
public

function SetTagValue(

TagDesc : String,
TagValue : String,
BomPos : Object
)

Parameters

TagDesc
Holds the name of the tag to read.
TagValue
Holds the new value for the tag.
BomPos
Optional. Holds the BOM position. Set to null if the tag is
not a BOM tag.

Wonderware Factelligence Client API Reference Guide

154

Chapter 4 API Classes

Exceptions

An exception is thrown if an error occurs while updating the


value in the databsase.

StartJob() Method
The StartJob() method starts a specified job on the entity. It
searches for the first available job position and starts the job
at that position. The entity contains multiple job positions if
it can run multiple jobs at one time. A job position is
available if no job is currently running on the exec.
Syntax

[Visual Basic (Declaration)]


Public Sub StartJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String _


)

[C#]
public void StartJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[C++]
public:
void StartJob(
String woId,
String operId,
int seqNo,
String statusNotes
) sealed

[J#]

public void StartJob(


string woId,
string operId,
int seqNo,
string statusNotes
)

[JScript]

Wonderware Factelligence Client API Reference Guide

Ent Class

public

155

function StartJob(

woId : String,
operId : String,
seqNo : int,
statusNotes : String
)

Parameters

woId
Holds the work order of the job to be started.
operId
Holds the operation ID of the job to be started.
seqNo
Holds the operation sequence number of the job to be
started.
statusNotes
Holds the notes about starting the job. This may be an
empty string.
Exceptions

An exception is thrown if no available job_exec is found or if


an error occurs while updating the database.

UpdateEntity() Method
The UpdateEntity() method updates the entity that is
identified by the entity object with the new values supplied.
Syntax

[Visual Basic (Declaration)]


Public Sub UpdateEntity( _
ByValue entityName As String, _
ByValue description As String, _
ByValue parentEntId As Integer, _
ByValue site As Integer, _
ByValue hourlyCost As Double, _
ByValue canScheduleJobs As Boolean, _
ByValue canRunJobs As Boolean, _
ByValue canCaptureUtil As Boolean, _
ByValue canCaptureLabor As Boolean, _
ByValue canDoDNC As Boolean, _
ByValue canTrackOEE As Boolean, _
ByValue canSchedShifts As Boolean, _
ByValue canStore As Boolean, _
ByValue canLogData As Boolean, _

Wonderware Factelligence Client API Reference Guide

156

Chapter 4 API Classes

ByValue canShip As Boolean, _


ByValue canReceive As Boolean, _
ByValue canCopyFolders As Boolean, _
ByValue curShiftId As Integer, _
ByValue curShiftStartTime As DateTime, _
ByValue identicalJobExecs As Integer, _
ByValue spare1 As String, _
ByValue spare2 As String, _
ByValue spare3 As String, _
ByValue spare4 As String
)

[C#]
public void UpdateEntity (
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

Ent Class

157

void UpdateEntity (
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[J#]
public void UpdateEntity (
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,

Wonderware Factelligence Client API Reference Guide

158

Chapter 4 API Classes

bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[Jscript]
public function UpdateEntity (
entityName :

string,

description

string,

parentEntId

int,

site

int,

hourlyCost

double,

canScheduleJobs
canRunJobs

canCaptureLabor
:

canTrackOEE
:

canReceive

bool,

bool,
:

bool,

bool,
bool,
:

canCopyFolders
curShiftId

bool,

canLogData
canShip

bool,

bool,

canSchedShifts
canStore

bool,

bool,

canCaptureUtil
canDoDNC

bool,
:

bool,

int,

curShiftStartTime

DateTime,

identicalJobExecs

int,

spare1

string,

spare2

string,

spare3

string,

spare4

string

Wonderware Factelligence Client API Reference Guide

Ent Class

159

Parameters

entityName
Holds a string to identify a unique entity name.
description
Holds a string to identify the entity description.
parentEntId
Holds an integer to identify the parent entity ID. Null if top
level.
site
Holds an integer to identify the ancestor entity. Is null if
entity above sites, or for single-site systems. If entity is a
site, site is equal to the entity ID.
hourlyCost
The cost of running.
canScheduleJobs
Holds a flag indicating whether jobs are scheduled to this
entity.
canRunJobs
Holds a flag indicating whether jobs are run on this entity.
canCaptureUtil
Holds a flag indicating whether an entity can capture
utilization data.
canCaptureLabor
Holds a flag indicating whether labor data is captured on
this entity.
canDoDNC
Holds a flag indicating whether this entity can
communicate with machine tools.
canTrackOEE
Holds a flag indicating whether OEE statistics are captured
on this entity.
canScheduleShifts
Holds a flag indicating whether shifts are scheduled for this
entity.
canStore
Holds a flag indicating whether this entity is a warehouse
or storage location.
canLogData
Holds a flag indicating whether this entity can log data.
canShip
Holds a flag indicating whether shipments are made from
this entity.

Wonderware Factelligence Client API Reference Guide

160

Chapter 4 API Classes

canReceive
Holds a flag indicating whether material is received at this
entity.
canCopyFolders
Holds a flag indicating whether files in folders for this
entity are copied to its download directories.
curShiftId
Holds an integer indicating the current shift on this entity.
curShiftStartTime
Holds a date/time of the current shift start time on the
entity.
identicalJobExecs
Holds an integer indicating the number of identical
positions that can run independent jobs on this entity.
spare1
Holds a string used to save information for this entity.
spare2
Holds a string used to save information for this entity.
spare3
Holds a string used to save information for this entity.
spare4
Holds a string used to save information for this entity.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UpdateJobExec() Method
The UpdateJobExec() method updates the job exec record for
the entity that is identified by this entity object.
Syntax

[Visual Basic (Declaration)]


Public Sub UpdateJobExec( _
ByValue jobPos As Integer, _
ByValue nextJobOnly As Boolean, _
ByValue itemBasedDesc As Boolean, _
ByValue jobEndConfirmMessage As String, _
ByValue defToEntID As Integer, _
ByValue defRejectEntID As Integer, _
ByValue defFromEntID As Integer, _
ByValue defProdReasCD As Integer, _
ByValue defConsReasCD As Integer, _

Wonderware Factelligence Client API Reference Guide

Ent Class

161

ByValue defLotNo as String, _


ByValue defSubLotNo as String, _
ByValue autoLoadJobSpecs As Boolean, _
ByValue autoSeqStartOption As Boolean, _
ByValue autoJobStartOption As Boolean, _
ByValue autoJobEndOption As Boolean, _
ByValue inclClassReas As Boolean, _
ByValue mustCompleteSteps As Boolean, _
ByValue mustProdReqdQty As Boolean, _
ByValue localMovableConsEnt As Boolean, _
ByValue localMovableProdEnt As Boolean, _
ByValue runWithoutOperator As Boolean, _
ByValue applyPostExecFCCounts As Boolean, _
ByValue suppressStartQtyPrompt As Boolean, _
ByValue allowZeroQtySplit As Boolean, _
ByValue autoAllocQtyToRunningJob As Boolean, _
ByValue curWOID As String, _
ByValue curOperID As String, _
ByValue curSeqNo As Integer, _
ByValue curStepNo As Integer, _
ByValue curStepStart As DateTime, _
ByValue spare1 As String, _
ByValue spare2 As String, _
ByValue spare3 As String, _
ByValue spare4 As String
)

[C#]
public void UpdateJobExec (
int jobPos,
bool nextJobOnly,
bool itemBasedDesc,
string jobEndConfirmMessage,
int defToEntID,
int defRejectEntID,
int defFromEntID,
int defProdReasCD,
int defConsReasCD,
string defLotNo,
string defSubLotNo,
bool autoLoadJobSpecs,

Wonderware Factelligence Client API Reference Guide

162

Chapter 4 API Classes

bool autoSeqStartOption,
bool autoJobStartOption,
bool

autoJobEndOption,

bool inclClassReas,
bool mustCompleteSteps,
bool mustProdReqdQty,
bool localMovableConsEnt,
bool localMovableProdEnt,
bool runWithoutOperator,
bool applyPostExecFCCounts,
bool suppressStartQtyPrompt,
bool allowZeroQtySplit,
bool autoAllocQtyToRunningJob,
string curWOID,
string curOperID,
int curSeqNo,
int curStepNo,
DateTime curStepStart,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
void UpdateJobExec (
int jobPos,
bool nextJobOnly,
bool itemBasedDesc,
string jobEndConfirmMessage,
int defToEntID,
int defRejectEntID,
int defFromEntID,
int defProdReasCD,
int defConsReasCD,
string defLotNo,
string defSubLotNo,
bool autoLoadJobSpecs,
bool autoSeqStartOption,
bool autoJobStartOption,

Wonderware Factelligence Client API Reference Guide

Ent Class

bool

163

autoJobEndOption,

bool inclClassReas,
bool mustCompleteSteps,
bool mustProdReqdQty,
bool localMovableConsEnt,
bool localMovableProdEnt,
bool runWithoutOperator,
bool applyPostExecFCCounts,
bool suppressStartQtyPrompt,
bool allowZeroQtySplit,
bool autoAllocQtyToRunningJob,
string curWOID,
string curOperID,
int curSeqNo,
int curStepNo,
DateTime curStepStart,
string spare1,
string spare2,
string spare3,
string spare4
)

[J#]
public void UpdateJobExec (
int jobPos,
bool nextJobOnly,
bool itemBasedDesc,
string jobEndConfirmMessage,
int defToEntID,
int defRejectEntID,
int defFromEntID,
int defProdReasCD,
int defConsReasCD,
string defLotNo,
string defSubLotNo,
bool autoLoadJobSpecs,
bool autoSeqStartOption,
bool autoJobStartOption,
bool

autoJobEndOption,

bool inclClassReas,
bool mustCompleteSteps,

Wonderware Factelligence Client API Reference Guide

164

Chapter 4 API Classes

bool mustProdReqdQty,
bool localMovableConsEnt,
bool localMovableProdEnt,
bool runWithoutOperator,
bool applyPostExecFCCounts,
bool suppressStartQtyPrompt,
bool allowZeroQtySplit,
bool autoAllocQtyToRunningJob,
string curWOID,
string curOperID,
int curSeqNo,
int curStepNo,
DateTime curStepStart,
string spare1,
string spare2,
string spare3,
string spare4
)

[Jscript]
public function UpdateJobExec(
jobPos

int,

nextJobOnly

itemBasedDesc

bool,
:

bool,

jobEndConfirmMessage
defToEntID

int,

int,

defProdReasCD

int,

defConsReasCD

int,

defLotNo

defSubLotNo

string,

int,

defRejectEntID
defFromEntID

string,
:

string,

autoLoadJobSpecs

bool,

autoSeqStartOption

bool,

autoJobStartOption

bool,

autoJobEndOption

inclClassReas

bool,

mustCompleteSteps
mustProdReqdQty

bool,

bool,

bool,

localMovableConsEnt

bool,

localMovableProdEnt

bool,

Wonderware Factelligence Client API Reference Guide

Ent Class

runWithoutOperator

bool,

applyPostExecFCCounts

suppressStartQtyPrompt
allowZeroQtySplit

curOperID
curSeqNo

bool,
bool,

string,

int,
:

DateTime,

spare1

string,

spare2

string,

spare3

string,

int,

curStepStart

spare4

bool,

string,
:

curStepNo

bool,

autoAllocQtyToRunningJob
curWOID

165

string

Parameters

jobPos
Holds an integer identifying the job exec position to update.
nextJobOnly
Holds a flag indicating whether to start the next job or
select any job to start.
itemBasedDesc
Holds a flag indicating that messages should use the item
description and not the operation description.
jobEndConfirmMessage
Holds a string which is the operation end confirm message.
defToEntID
Holds an integer identifying the default storage entity for
good production items, and rejects if def_reject_ent_id is
null.
defRejectEntID
Holds an integer identifying the default storage entity for
reject production.
defFromEntID
Holds an integer identifying default storage entity for item
issues.
defProdReasCD
Holds an integer identifying the default reason code for
good production.
defConsReasCD
Holds an integer identifying the default reason code for
normal consumption.

Wonderware Factelligence Client API Reference Guide

166

Chapter 4 API Classes

defLotNo
Holds a string identifying the default lot number for
production.
defSubLotNo
Holds a string identifying the default sublot number for
production.
autoLoadJobSpecs
Holds a flag indicating whether auto load job specs to tags.
autoSeqStartOption
Holds an integer identifying an enumeration of conditions
to automatically start the job with the current W/O and op.
and next seq_no: -=Don't start automatically, 1=Start job
with next sequence when previous done.
autoJobStartOption
Holds an integer identifying an enumeration of conditions
to automatically start a job. 0=Don't start automatically,
1=Start next scheduled job as soon as ready, 2=Start next
scheduled job with W/O specified in tag that just changed.
autoJobEndOption
Holds an integer identifying an enumeration of conditions
to automatically end a job 0=Don't end automatically,
1=when QtyDone>=QtyReqd.
inclClassReas
Holds a flag indicating if item reasons for item class should
also be available to choose from if there are entity-related
item reasons defined.
mustCompleteSteps
Holds a flag indicating if all steps must be
completed/bypassed to end the job.
mustProdReqdQty
Holds a flag indicating whether the required quantity must
be produced (good) to end the job.
localMovableConsEnt
Holds a flag indicating if movable storage entities supplying
consumption need to be in/at the entity producing it.
localMovableProdEnt
Holds a flag indicating if movable storage entities receiving
production need to be in/at the entity producing it.
runWithoutOperator
Holds a flag indicating if jobs may run without an operator
logged onto the entity; if no, running jobs are suspended
when the last operator logs off.

Wonderware Factelligence Client API Reference Guide

Ent Class

167

applyPostExecFCCounts
Holds a flag indicating if production counts received from
Factory Connector when no job is running should be applied
to the last job that ran on the entity. No suggests that
such counts are ignored.
suppressStartQtyPrompt
Holds a flag indicating if a prompt to specify a quantity to
start when the Start Some button is pressed should be
suppressed.
allowZeroQtySplit
Holds a flag indicating if default quantities to be used from
Start some are 0.
autoAllocQtyToRunning Job
Holds a flag indicating if overages in reported production
are to be covered by moving quantities from a scheduled,
non-running job if available.
curWOID
Holds a string identifying the current work order on this
entity.
curOperID
Holds a string identifying the current operation on this
entity.
curSeqNo
Holds an integer identifying the current operation split.
curStepNo
Holds an integer identifying the last step started on this
entity.
curStepStart
Holds a DateTime which is when the last step was started
on this entity.
spare1
Holds a string used for additional information.
spare2
Holds a string used for additional information.
spare3
Holds a string used for additional information.
spare4
Holds a string used for additional information.

UpdateShift() Method
The UpdateShift() method updates the shift defined by the
input parameters for the entity that is identified by the ent
object.

Wonderware Factelligence Client API Reference Guide

168

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Sub UpdateShift ( _
ByValue startDay As Integer, _
ByValue shiftId As Integer, _
ByValue shiftStart As DateTime, _
ByValue shiftEnd As DateTime, _
ByValue break1Start As DateTime, _
ByValue break1End As DateTime, _
ByValue break2Start As DateTime, _
ByValue break2End As DateTime, _
ByValue break3Start As DateTime, _
ByValue break3End As DateTime
)

[C#]
public void UpdateShift (
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break2End,
DateTime break3Start,
DateTime break3End
)

[C++]
public:
void UpdateShift (
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break3Start,
DateTime break3End
)

[J#]

Wonderware Factelligence Client API Reference Guide

Ent Class

169

public void UpdateShift(


int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break3Start,
DateTime break3End
)

[Jscript]
public function UpdateShift (
startDay :
shiftId :

int,
int,

shiftStart
shiftEnd

break1Start
break1End

break2Start
break2End

break3Start
break3End

DateTime,

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime

Parameters

startDay
Holds the day of the week on which shift applies.
shiftId
Holds the system shift that the shift is for in the entities
schedule.
shiftStart
Holds the date/time containing the time that the shift
starts for the entity shift schedule.
shiftEnd
Holds the date/time containing the time that the shift ends
for the entity shift schedule.
break1Start
Holds the date/time containing the time that the first break
starts for the shift.

Wonderware Factelligence Client API Reference Guide

170

Chapter 4 API Classes

break1End
Holds the date/time containing the time that the first break
ends for the shift.
break2Start
Holds the date/time containing the time that the second
break starts for the shift.
break2End
Holds the date/time containing the time that the second
break ends for the shift.
break3Start
Holds the date/time containing the time that the third
break starts for the shift.
break3End
Holds the date/time containing the time that the third
break ends for the shift.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

CanCaptureLabor Property
The CanCaptureLabor property is a read-only property that
determines if the current entity can capture labor.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CanCaptureLabor As Boolean

[C#]
public bool CanCaptureLabor { get; }

[C++]

public property bool CanCaptureLabor sealed


bool get();
}

[J#]

/** property */
public bool get_CanCaptureLabor();

[JScript]

public function get CanCaptureLabor() : bool

CanCaptureUtil Property
The CanCaptureUtil property is a read-only property that
determines whether this entity can capture utilization.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

Ent Class

171

Public ReadOnly Property CanCaptureUtil As Boolean

[C#]

public bool CanCaptureUtil { get; }

[C++]

public property bool CanCaptureUtil sealed


bool get();
}

[J#]

/** property */
public bool get_CanCaptureUtil();

[JScript]

public function get CanCaptureUtil() : bool

CanDoDNC Property
The CanDoDNC property is a read-only property which
determines if this entity can do DNC.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CanDoDNC As Boolean

[C#]

public bool CanDoDNC { get; }

[C++]

public property bool CanDoDNC sealed


bool get();
}

[J#]

/** property */
public bool get_CanDoDNC();

[JScript]

public function get CanDoDNC() : bool

CanLogData Property
The CanLogData property is a read-only property that
determines if the current entity can log data.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CanLogData As Boolean

[C#]

public bool CanLogData { get; }

[C++]

public property bool CanLogData sealed


bool get();
}

[J#]

Wonderware Factelligence Client API Reference Guide

172

Chapter 4 API Classes

/** property */
public bool get_CanLogData();

[JScript]

public function get CanLogData() : bool

CanRunJobs Property
The CanRunJobs property is a read-only property that
determines whether this entity can run jobs.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CanRunJobs As Boolean

[C#]

public bool CanRunJobs { get; }


npublic property bool CanRunJobs sealed
bool get();
}

[J#]

/** property */
public bool get_CanRunJobs();

[JScript]

public function get CanRunJobs() : bool

CanSchedJobs Property
The CanSchedJobs property is a read-only property which
determines if the current entity can schedule jobs.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CanSchedJobs As Boolean

[C#]

public bool CanSchedJobs { get; }

[C++]

public property bool CanSchedJobs sealed


bool get();
}

[J#]

/** property */
public bool get_CanSchedJobs();

[JScript]

public function get CanSchedJobs() : bool

CanSchedShifts Property
The CanSchedShifts property is a read-only property which
determines if the current entity can schedule shifts.

Wonderware Factelligence Client API Reference Guide

Ent Class

173

Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CanSchedShifts As Boolean

[C#]

public bool CanSchedShifts { get; }

[C++]

public property bool CanSchedShifts sealed


bool get();
}

[J#]

/** property */
public bool get_CanSchedShifts();

[JScript]

public function get CanSchedShifts() : bool

CanStore Property
The CanStore property is a read-only property which
determines if the current entity can store inventory.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CanStore As Boolean

[C#]

public bool CanStore { get; }

[C++]

public property bool CanStore sealed


bool get();
}

[J#]

/** property */
public bool get_CanStore();

[JScript]

public function get CanStore() : bool

CanTrackOEE Property
The CanTrackOEE property is a read-only property that
determines whether this entity can track OEE.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CanTrackOEE As Boolean

[C#]

public bool CanTrackOEE { get; }

[C++]

public property bool CanTrackOEE sealed

Wonderware Factelligence Client API Reference Guide

174

Chapter 4 API Classes

bool get();
}

[J#]

/** property */
public bool get_CanTrackOEE();

[JScript]

public function get CanTrackOEE() : bool

CertExec Property
The CertExec property is a read-only property which exposes
the CertExec object that handles the certification functions
for the current entity.
This property is only available if the current entity can run
jobs.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CertExec As CertExec

[C#]

public CertExec CertExec { get; }

[C++]

public property CertExec CertExec sealed


CertExec get();
}

[J#]

/** property */
public CertExec get_CertExec();

[JScript]

public function get CertExec() : CertExec

CurShiftDesc Property
The CurShiftDesc property is a read-only property that
specifies the current shift description.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CurShiftDesc As String

[C#]

public string CurShiftDesc { get; }

[C++]

public property string CurShiftDesc sealed


String get();
}

[J#]

/** property */

Wonderware Factelligence Client API Reference Guide

Ent Class

175

public string get_CurShiftDesc();

[JScript]

public function get CurShiftDesc() : String

CurShiftID Property
The CurShiftID property is a read-only property that specifies
the current shift ID.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurShiftID As Integer

[C#]

public int CurShiftID { get; }

[C++]

public property int CurShiftID sealed


int get();
}

[J#]

/** property */
public int get_CurShiftID();

[JScript]

public function get CurShiftID() : int

CurShiftStartTime Property
The CurShiftStartTime property is a read-only property that
specifies the current shift start time.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurShiftStartTime As Date

[C#]

public DateTime CurShiftStartTime { get; }

[C++]

public property DateTime CurShiftStartTime sealed


DateTime get();
}

[J#]

/** property */
public DateTime get_CurShiftStartTime();

[JScript]

public function get CurShiftStartTime() : DateTime

Wonderware Factelligence Client API Reference Guide

176

Chapter 4 API Classes

DNCExec Property
The DNCExec property is a read-only property which exposes
the DNCExec object that handles the DNC functions for the
current entity.
The property is available only if the entity has the ability to
do DNC.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DNCExec As DNCExec

[C#]

public DNCExec DNCExec { get; }

[C++]

public property DNCExec DNCExec sealed


DNCExec get();
}

[J#]

/** property */
public DNCExec get_DNCExec();

[JScript]

public function get DNCExec() : DNCExec

EntDesc Property
The EntDesc property is a read-only property which exposes
the description of the entity represented by this entity.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property EntDesc As String

[C#]

public string EntDesc { get; }

[C++]

public property string EntDesc sealed


String get();
}

[J#]

/** property */
public string get_EntDesc();

[JScript]

public function get EntDesc() : String

EntID Property
The EntID property is a read-only property that specifies the
ID of the entity represented by this Ent object.

Wonderware Factelligence Client API Reference Guide

Ent Class

177

Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property EntId As Integer

[C#]

public int EntId { get; }

[C++]

public property int EntId sealed


int get();
}

[J#]

/** property */
public int get_EntId();

[JScript]

public function get EntId() : int

EntName Property
The EntName property is a read-only property that specifies
the name of the entity represented by the entity object.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property EntName As String

[C#]

public string EntName { get; }

[C++]

public property string EntName sealed


String get();
}
[J#]
/** property */
public string get_EntName();

[JScript]

public function get EntName() : String

FoldersExec Property
The FoldersExec property is a read-only property which
exposes the FoldersExec object that handles folders functions
for this entity.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property FoldersExec As FoldersExec

[C#]

public FoldersExec FoldersExec { get; }

[C++]

Wonderware Factelligence Client API Reference Guide

178

Chapter 4 API Classes

public property FoldersExec FoldersExec sealed


FoldersExec get();
}

[J#]

/** property */
public FoldersExec get_FoldersExec();

[JScript]

public function get FoldersExec() : FoldersExec

JobExec Property
The JobExec property is a read-only property that specifies
the JobExec object that handles job execution functions for
this entity.
This property is only available if the entity can run jobs.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property JobExec As JobExec

[C#]

public JobExec JobExec { get; }

[C++]

public property JobExec JobExec sealed


JobExec get();
}

[J#]

/** property */
public JobExec get_JobExec();

[JScript]

public function get JobExec() : JobExec

LaborExec Property
The LaborExec property is a read-only property which
exposes the LaborExec object that handles the Labor
functions for this entity.
This property is only available if the current entity can
capture labor.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property LaborExec As LaborExec

[C#]

public LaborExec LaborExec { get; }

[C++]

public property LaborExec LaborExec sealed


LaborExec get();

Wonderware Factelligence Client API Reference Guide

Ent Class

179

[J#]

/** property */
public LaborExec get_LaborExec();

[JScript]

public function get LaborExec() : LaborExe

NumberOfJobsEntCanRun Property
The NumberOfJobsEntCanRun property is a read-only
property that specifies the maximum number of jobs the
current entity can run consecutively based on its maximum
number of defined job_execs.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property NumberOfJobsEntCanRun As
Integer

[C#]

public int NumberOfJobsEntCanRun { get; }

[C++]

public property int NumberOfJobsEntCanRun sealed


int get();
}

[J#]

/** property */
public int get_NumberOfJobsEntCanRun();

[JScript]

public function get NumberOfJobsEntCanRun() : int

NumberOfRunningJobs Property
The NumberOfRunningJobs property is a read-only property
that specifies the number of jobs currently running on the
entity. This value is greater than one only if entity can run
more than one job at a time.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property NumberOfRunningJobs As
Integer

[C#]

public int NumberOfRunningJobs { get; }

[C++]

public property int NumberOfRunningJobs sealed


int get();
}

Wonderware Factelligence Client API Reference Guide

180

Chapter 4 API Classes

[J#]
/** property */
public int get_NumberOfRunningJobs();

[JScript]

public function get NumberOfRunningJobs() : int

OEEExec Property
The OEEExec property is a read-only property that exposes
the OEE data for the current entity.
This property is available only if the entity can track OEE.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property OEEExec As OEEExec

[C#]

public OEEExec OEEExec { get; }

[C++]

public property OEEExec OEEExec sealed


OEEExec get();
}

[J#]

/** property */
public OEEExec get_OEEExec();

[JScript]

public function get OEEExec() : OEEExec

Site Property
The Site property is a read-only property that exposes the
entity ID of the site at which the current entity is located. If
this property is equal to the EntID of the ent object, this
entity is the site. If this property is null, the entity is above
sites, or is part of a single-site system.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property Site As Integer

[C#]

public int Site { get; }

[C++]

public property int Site sealed


int get();
}

[J#]

/** property */

Wonderware Factelligence Client API Reference Guide

Ent Class

181

public int get_Site();

[JScript]

public function get Site() : int

SiteName Property
The SiteName property is a read-only property that exposes
the name of the site at which this entity is located.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property SiteName As String

[C#]

public string SiteName { get; }

[C++]

public property string SiteName sealed


String get();
}

[J#]

/** property */
public string get_SiteName();

[JScript]

public function get SiteName() : String

StorageExec Property
The StorageExec property is a read-only property that
exposes the StorageExec object that handles the Inventory
functions for this Ent object.
This property is only available if the entity can store
inventory.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property StorageExec As StorageExec

[C#]

public StorageExec StorageExec { get; }

[C++]

public property StorageExec StorageExec sealed


StorageExec get();
}

[J#]

/** property */
public StorageExec get_StorageExec();

[JScript]

public function get StorageExec() : StorageExec

Wonderware Factelligence Client API Reference Guide

182

Chapter 4 API Classes

User Property
The User property is a read-only property that specifies the
parent User object for the current entity.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property User As User

[C#]

public User User { get; }

[C++]

public property User User sealed


User get();
}

[J#]

/** property */
public User get_User();

[JScript]

public function get User() : User

UtilExec Property
The UtilExec property is a read-only property that exposes
the UtilExec object that handles utilization execution
functions for this Ent object.
This property is only available if the entity can capture
utilization.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UtilExec As UtilExec

[C#]

public UtilExec UtilExec { get; }

[C++]

public property UtilExec UtilExec sealed


UtilExec get();
}

[J#]

/** property */
public UtilExec get_UtilExec();

[JScript]

public function get UtilExec() : UtilExec

Wonderware Factelligence Client API Reference Guide

Ents Class

183

Ents Class
The Ents class handles the Factelligence MES functionality
for entities which are not the currently selected entity. This
is a static class (Module in Visual Basic) so cannot be
inherited or instantiated.

AddEntity() Method
The AddEntity() method adds a new entity to the parent
entity specified and returns the entity ID that is generated.
Syntax

[Visual Basic (Declaration)]


Public Shared Function AddEntity( _
ByValue entityName As String, _
ByValue description As String, _
ByValue parentEntId As Integer, _
ByValue site As Integer, _
ByValue hourlyCost As Double, _
ByValue canScheduleJobs As Boolean, _
ByValue canRunJobs As Boolean, _
ByValue canCaptureUtil As Boolean, _
ByValue canCaptureLabor As Boolean, _
ByValue canDoDNC As Boolean, _
ByValue canTrackOEE As Boolean, _
ByValue canSchedShifts As Boolean, _
ByValue canStore As Boolean, _
ByValue canLogData As Boolean, _
ByValue canShip As Boolean, _
ByValue canReceive As Boolean, _
ByValue canCopyFolders As Boolean, _
ByValue curShiftId As Integer, _
ByValue curShiftStartTime As DateTime, _
ByValue identicalJobExecs As Integer, _
ByValue spare1 As String, _
ByValue spare2 As String, _
ByValue spare3 As String, _
ByValue spare4 As String
) As Integer

[C#]

public static int AddEntity (


string entityName,

Wonderware Factelligence Client API Reference Guide

184

Chapter 4 API Classes

string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
static int AddEntity (
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,

Wonderware Factelligence Client API Reference Guide

Ents Class

185

bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[J#]
public static int AddEntity (
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[Jscript]

Wonderware Factelligence Client API Reference Guide

186

Chapter 4 API Classes

public static function AddEntity (


entityName :

string,

description

string,

parentEntId

int,

site

int,

hourlyCost

double,

canScheduleJobs
canRunJobs

canCaptureLabor
:

canTrackOEE
:

canReceive

bool,

bool,
:

bool,

bool,
bool,
:

canCopyFolders
curShiftId

bool,

canLogData
canShip

bool,

bool,

canSchedShifts
canStore

bool,

bool,

canCaptureUtil
canDoDNC

bool,
:

bool,

int,

curShiftStartTime

DateTime,

identicalJobExecs

int,

spare1

string,

spare2

string,

spare3

string,

spare4

string

int

Parameters

entityName
Holds a string identifying a unique entity name.
description
Holds a string identifying the entity description.
parentEntId
Holds an integer identifying the parent entity ID. Null if
top level.
site
Holds an integer identifying an ancestor entity that defines
the site of this entity. If = ent_id, this entity is a site. Null
for entities above sites, or for single-site systems.
hourlyCost
Holds the cost of running.

Wonderware Factelligence Client API Reference Guide

Ents Class

187

canScheduleJobs
Holds a flag indicating whether jobs are scheduled to this
entity.
canRunJobs
Holds a flag indicating whether jobs are run on this entity.
canCaptureUtil
Holds a flag indicating whether an entity captures
utilization data.
canCaptureLabor
Holds a flag indicating whether labor data is captured on
this entity.
canDoDNC
Holds a flag indicating whether this entity communicates
with machine tools.
canTrackOEE
Holds a flag indicating whether OEE statistics are captured
on this entity.
canScheduleShifts
Holds a flag indicating whether shifts are scheduled for this
entity.
canStore
Holds a flag indicating whether this entity is a warehouse
or storage location.
canLogData
A flag indicating whether this entity logs data.
canShip
Holds a flag indicating whether shipments are made from
this entity.
canReceive
Holds a flag indicating whether material is received at this
entity.
canCopyFolders
Holds a flag indicating whether files in folders for this
entity are copied to its download directories.
curShiftId
Holds an integer indicating the current shift on this entity.
curShiftStartTime
Holds a date/time of the current shift start time on the
entity.
identicalJobExecs
Holds an integer indicating the number of identical
positions that run independent jobs on this entity.

Wonderware Factelligence Client API Reference Guide

188

Chapter 4 API Classes

spare1
Holds a string used to save information for this entity.
spare2
Holds a string used to save information for this entity.
spare3
Holds a string used to save information for this entity.
spare4
Holds a string used to save information for this entity.
Return Value

Returns an integer value that is the entity ID assigned to


the new entity that is created.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

AddEntLink() Method
The AddEntLink() method adds an entity ID and a parent
entity ID. It adds a link record to define a parent entity as a
parent of the entity defined by the entId parameter.
Syntax

[Visual Basic (Declaration)]


Public Sub AddEntLink( _
ByValue entId As Integer, _
ByValue parentEntId As Integer
)

[C#]
public static void AddEntLink (
int entID,
int parentEntId
)

[C++]
public:
static void AddEntLink (
int entId,
int parentEntId
)

[J#]
public static void AddEntLink (
int entId,
int parentEntId
)

Wonderware Factelligence Client API Reference Guide

Ents Class

189

[Jscript]
public static function AddEntity (
entID

int,

parentEntId

int

Parameters

entID
Holds an integer identifying the entity that is being linked
to parent entity.
parentEntId
Holds an integer to identify the parent entity ID that is to
be set as a parent of the entity.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DeleteEntity() Method
The DeleteEntity() method removes the specified entity from
the database.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub DeleteEntity( _
ByValue entId As Integer
)

[C#]
public static void DeleteEntity (
int entId
)

[C++]
public:
static void DeleteEntity (
int entId
)

[J#]
public static void DeleteEntity (
int entId
)

[Jscript]
public static function DeleteEntity (
entId :

int

Wonderware Factelligence Client API Reference Guide

190

Chapter 4 API Classes

Parameter

entId
Holds an integer identifying the entity to be deleted.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DeleteEntLink() Method
The DeleteEntLink() method takes an entity ID and a parent
entity ID and deletes any link record that defines the parent
entity as a parent of the entity defined by the entID
parameter.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub DeleteEntLink( _
ByValue entId As Integer, _
ByValue parentEntID As Integer
)
[C#]
public static void DeleteEntLink (
int entId,
int parentEntID
)

[C++]
public:
static void DeleteEntLink (
int entId,
int parentEntID
)

[J#]
public static void DeleteEntLink (
int entId,
int parentEntID
)

[Jscript]
public static function DeleteEntLink (
entId :

int,

parentEntID
)

Wonderware Factelligence Client API Reference Guide

int

Ents Class

191

Parameters

entId
Holds an integer identifying the entity which any links to
the parent ent id are being deleted.
parentEntId
Holds an integer identifying the parent entity which any
links to the entity are being deleted.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetCountsAndDuration() Method
The GetCountsAndDuration() method returns a DataSet
containing one row for each utilization state, reason group, or
reason. It has columns for the ID, description, count or
duration, color (valid only for utilization states and reasons),
and an active flag which is set true for the current utilization
state, reason group, or reasonOEEExec.
Syntax

[Visual Basic (Declaration)]


Public Function GetCountsAndDuration( _
ByValue entId As Integer, _
ByValue type As CountsAndDurationGraphStyle, _
ByValue filterType As FilterType, _
ByValue filterDuration As Integer, _
ByValue filterTimeUnit As FilterTimeUnits,_
ByValue filterTimeStart As Integer, _
ByValue filterTimeEnd As Integer, _
ByValue drillDownFilter As Integer, _
ByValue oeeStatusFilter As OEEStatusFilter
) As DataSet

[C#]

public DataSet GetCountsAndDuration(


int entId,
CountsAndDurationGraphStyle

type,

FilterType filterType,
int filterDuration,
FilterTimeUnits filterTimeUnit,
int filterTimeStart,
int filterTimeEnd,
int drillDownFilter,
OEEStatusFilter oeeStatusFilter

Wonderware Factelligence Client API Reference Guide

192

Chapter 4 API Classes

[C++]
public:
DataSet GetCountsAndDuration(
int entId,
CountsAndDurationGraphStyle type,
FilterType filterType,
int filterDuration,
FilterTimeUnits filterTimeUnit,
int filterTimeStart,
int filterTimeEnd,
int drillDownFilter,
OEEStatusFilter oeeStatusFilter
)

[J#]
public DataSet GetCountsAndDuration(
int entId,
CountsAndDurationGraphStyle type,
FilterType filterType,
int filterDuration,
FilterTimeUnits filterTimeUnit,
int filterTimeStart,
int filterTimeEnd,
int drillDownFilter,
OEEStatusFilter oeeStatusFilter
)

[Jscript]
public function GetCountsAndDuration(
entId
type

:
:

int,
CountsAndDurationGraphStyle,

filterType

FilterType,

filterDuration

int,

filterTimeUnit

FilterTimeUnits,

filterTimeStart
filterTimeEnd

int,

int,

drillDownFilter

int,

oeeStatusFilter

OEEStatusFilter

DataSet

Wonderware Factelligence Client API Reference Guide

Ents Class

193

Parameters

entId
Holds the entity for retrieving counts and duration data.
type
Holds a CountsAndDurationGraphType enumeration value
that specifies the type of data that is shown in the Pareto
graph of the KPI control.
filterType
Holds a FilterType enumeration value that gives the type of
data to filter.
filterDuration
Holds a an integer value that specifies the value of N if
filterType is LastNHours.
filterTimeUnti
Holds a FilterTimeUnit enumeration value which specifies
the time unit for a custom filter (if the FilterType is
Custom).
filterTimeStart
Holds an integer that specifies the start of the filter period
relative to now if the filterType is Custom.
filterTimeEnd
Holds an integer which specifies the end of the filter period
relative to now if the filterType is Custom.
this user group.
drillDownFilter
An integer which specifies a reason group or utilization
state to drill down by.
oeeStatusFilter
Holds a OEEStatusFilter enumeration value that specifies
if the data should be filtered by OEE Status.
Return Value

Returns a DataSet containing one row for each utilization


state, reason group, or reason. It has columns for the ID,
description, count or duration, color (valid only for
utilization states and reasons), and an active flag which is
set to true for the current utilization state, reason group, or
reasonOEEExec.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

194

Chapter 4 API Classes

GetEntChildren() Method
The GetEntChildren() method returns a DataSet containing
all the children entities for the specified entity that can have
a jobs scheduled to them.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetEntChildren( _
ByVal entId As Long _
) As DataSet

[C#]

public static DataSet GetEntChildren(


long entId
)

[C++]
public:
static DataSet GetEntChildren(
__int64 entId
)

[J#]
public static DataSet GetEntChildren(
long entId
)

[JScript]
public static

function GetEntChildren(

entId : long
) : DataSet

Parameter

entId
Holds the ID of the entity that is the parent entity for whom
the children entities are retrieved.
Return Value

Returns a DataSet containing entity information for all of


the entities which are children of the specified entity and
can have jobs scheduled to them.

Exceptions

An exception is thrown if error when retrieving data for the


entities from the database.

Wonderware Factelligence Client API Reference Guide

Ents Class

195

GetEntityFromComboBoxEntry Method (Object,


Int32, String)
The GetEntityFromComboBoxEntry() method returns the
entity ID and entity name for the entity selected in the combo
box. If no entity is selected, it returns a -1 for the entity ID.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub GetEntityFromComboBoxEntry( _
ByVal comboBoxEntry As Object,

<OutAttribute> ByRef entID As Integer,

<OutAttribute> ByRef entName As String _


)

[C#]
public static void GetEntityFromComboBoxEntry(
object comboBoxEntry,
out int entID,
out string entName
)

[C++]
public:
static void GetEntityFromComboBoxEntry(
Object comboBoxEntry,
[OutAttribute] int% entID,
[OutAttribute] String% entName
)

[J#]
public static void GetEntityFromComboBoxEntry(
object comboBoxEntry,
/** @attribute OutAttribute() */ /** @ref */ int
entID,
/** @attribute OutAttribute() */ /** @ref */ string
entName
)

[JScript]
public static

function GetEntityFromComboBoxEntry(

comboBoxEntry : Object,
OutAttribute entID : int,
OutAttribute entName : String
)

Wonderware Factelligence Client API Reference Guide

196

Chapter 4 API Classes

Parameters

comboBoxEntry
Holds a EntityComboBoxData entry from the combo box.
entID
Returns the ID of the entity or -1 of no entity.
entName
Returns the name of the entity.

GetEntityFromComboBoxEntry Method (Object,


Generic Nullable, String)
The GetEntityFromComboBoxEntry() method returns the
entity ID and entity name for the entity selected in the combo
box. If no entity is selected, it returns a -1 for the entity ID.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub GetEntityFromComboBoxEntry( _
ByVal comboBoxEntry As Object,

<OutAttribute> ByRef entID As Nullable(Of Integer),


_
<OutAttribute> ByRef entName As String _
)

[C#]
public static void GetEntityFromComboBoxEntry(
object comboBoxEntry,
out Nullable<int> entID,
out string entName
)

[C++]
public:
static void GetEntityFromComboBoxEntry(
Object comboBoxEntry,
[OutAttribute] Nullable<int>% entID,
[OutAttribute] String% entName
)

[J#]
public static void GetEntityFromComboBoxEntry(
object comboBoxEntry,
/** @attribute OutAttribute() */ /** @ref */
Nullable<int> entID,
/** @attribute OutAttribute() */ /** @ref */ string
entName

Wonderware Factelligence Client API Reference Guide

Ents Class

197

[JScript]
public static

function GetEntityFromComboBoxEntry(

comboBoxEntry : Object,
OutAttribute entID : Nullable<int>,
OutAttribute entName : String
)

Parameters

comboBoxEntry
Holds a EntityComboBoxData entry from the combo box.
entID
Returns the ID of the entity or null of no entity.
entName
Returns the name of the entity.

GetEntProperties() Method
The GetEntProperties() method gets the configured properties
for the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetEntProperties( _
ByVal entId As Long _
) As DataSet

[C#]

public static DataSet GetEntProperties(


long entId
)

[C++]
public:
static DataSet GetEntProperties(
__int64 entId
)

[J#]
public static DataSet GetEntProperties(
long entId
)

[JScript]
public static

function GetEntProperties(

entId : long
) : DataSet

Wonderware Factelligence Client API Reference Guide

198

Chapter 4 API Classes

Parameter

entId
Holds the ID of the entity whose configured properties want
to retrieve.
Return Value

Returns a DataSet containing all of the properties


configured for the specified entity.

Exceptions

An exception is thrown if there is an error retrieving the


properties for the specified entity from the database.

NumberOfJobsRunning() Method
The NumberOfJobsRunning() method returns the number of
jobs currently running on the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Shared Function NumberOfJobsRunning( _
ByVal entId As Long _
) As Integer

[C#]

public static int NumberOfJobsRunning(


long entId
)

[C++]
public:
static int NumberOfJobsRunning(
__int64 entId
)

[J#]
public static int NumberOfJobsRunning(
long entId
)

[JScript]
public static

function NumberOfJobsRunning(

entId : long
) : int

Parameter

entId
Holds the ID of the entity want to know the number of jobs
running on.

Wonderware Factelligence Client API Reference Guide

Ents Class

199

Return Value

Returns an integer value which represents the number of


jobs currently running on the specified entity.

Exceptions

An exception is thrown if there is an error retrieve job exec


data for the specified entity.

PopulateEntityComboBox() Method (ComboBox,


Boolean)
The PopulateEntityComboBox() method populates the
specified combo box with the data in the Ent table. It
includes an empty entry in the combo box if requested. Each
entity is added as an entity object to the combo box. The
entity object includes the entity name and the entity ID. The
name is displayed in the combo box.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopulateEntityComboBox( _
ByVal comboBox As ComboBox,

ByVal includeEmptyEntName As Boolean _


)

[C#]
public static void PopulateEntityComboBox(
ComboBox comboBox,
bool includeEmptyEntName
)

[C++]
public:
static void PopulateEntityComboBox(
ComboBox comboBox,
bool includeEmptyEntName
)

[J#]
public static void PopulateEntityComboBox(
ComboBox comboBox,
bool includeEmptyEntName
)

[JScript]
public static

function PopulateEntityComboBox(

comboBox : ComboBox,
includeEmptyEntName : bool
)

Wonderware Factelligence Client API Reference Guide

200

Chapter 4 API Classes

Parameters

comboBox
Holds the combo box to populate.
includeEmptyEntName
Holds a flag to indicate whether or not an empty entry
should be added to the combo box.

PopulateEntityComboBox() Method (ComboBox,


DataTable, Boolean)
The PopulateEntityComboBox() method populates the
specified combo box with the data in the supplied data table.
The table must include an entity ID and an ent_name
column. It includes an empty entry in the combo box if
requested
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopulateEntityComboBox( _
ByVal comboBox As ComboBox,
ByVal table As DataTable,

ByVal includeEmptyEntName As Boolean _


)

[C#]
public static void PopulateEntityComboBox(
ComboBox comboBox,
DataTable table,
bool includeEmptyEntName
)

[C++]
public:
static void PopulateEntityComboBox(
ComboBox comboBox,
DataTable table,
bool includeEmptyEntName
)

[J#]
public static void PopulateEntityComboBox(
ComboBox comboBox,
DataTable table,
bool includeEmptyEntName
)

[JScript]

Wonderware Factelligence Client API Reference Guide

Ents Class

public static

201

function PopulateEntityComboBox(

comboBox : ComboBox,
table : DataTable,
includeEmptyEntName : bool
)

Parameters

comboBox
Holds the combo box to populate.
table
Holds the table holding the entity data.
includeEmptyEntName
Holds a flag to indicate whether or not an empty entry
should be added to the combo box.

PrepareProductionAttributes() Method
The PrepareProductionAttributes() method accepts a set of
values for all production attributes and creates a data entry
job to support logging utilization against these attributes.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PrepareProductionAttributes( _
ByValue entId As Integer, _
ByValue item As String, _
ByValue itemClass As String, _
By Value itemUOM As String, _
ByValue workOrder As String, _
ByValue operation As String, _
ByValue targetProdRate As Double, _
ByValue uom As Integer, _
ByValue batchSize As Double, _
ByValue startQty As Double, _
ByValue reqdQty As Double,_
ByValue operator As String
) As String

[C#]

public static string PrepareProductionAttributes (


int entId,
string item,
string itemClass,
string itemUOM,
string workOrder,

Wonderware Factelligence Client API Reference Guide

202

Chapter 4 API Classes

string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[C++]
public:
static string PrepareProductionAttributes (
int entId,
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[J#]
public static string PrepareProductionAttributes (
int entId,
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[Jscript]
public static function PrepareProductionAttributes (

Wonderware Factelligence Client API Reference Guide

Ents Class

entId
item

:
:

int,
string,

itemClass
itemUOM

string,

string,

workOrder

string,

operation

string,

targetProdRate
uom

startQty
reqdQty

:
:

operator
:

double,

int,

batchSize

203

double,
double,

double,
string

string

Parameters

entId
Holds an integer identifying the entity to start the data
entry job.
item
Holds a string identifying the item for the data entry job.
itemClass
Holds a string identifying the item class ID of the item.
itemUOM
Holds an string which is a description used to identify the
unit of measure of the item.
workOrder
Holds a string identifying the work order for the data entry
job.
operation
Holds a string identifying the operation for the data entry
job.
targetProdRate
Holds a floating-point value indicating the target
production rate.
uom
Holds an integer indicating the unit of measure for the
target production rate.
batchSize
Holds a floating-point value indicating the batch size for the
data entry job.
startQty
Holds a floating-point value indicating the start quantity
for the data entry job.

Wonderware Factelligence Client API Reference Guide

204

Chapter 4 API Classes

reqdQty
Holds a floating-point value indicating the required
quantity for the data entry job.
operator
Holds a string identifying the user ID to associate with the
entity.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

PrepareProductionAttributes() Method
The PrepareProductionAttributes() method accepts a set of
values for all production attributes and creates a data entry
job to support logging utilization against these attributes.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PrepareProductionAttributes( _
ByValue entName As String, _
ByValue site As String, _
ByValue item As String, _
ByValue itemClass As String, _
ByValue itemUOM As String, _
ByValue workOrder As String, _
ByValue operation As String, _
ByValue targetProdRate As Double, _
ByValue uom As Integer, _
ByValue batchSize As Double, _
ByValue startQty As Double, _
ByValue reqdQty As Double,_
ByValue operator As String
)

C#]
public static string PrepareProductionAttributes (
string entName,
string site,
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

Ents Class

205

static string PrepareProductionAttributes (


string entName,
string site,
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double reqdQty,
double startQty,
string operator
)

[J#]
public static string PrepareProductionAttributes (
string entName,
string site,
string item,
string itemClass,
string itemUOM,
string workOrder,
string operation,
double targetProdRate,
int uom,
double batchSize,
double startQty,
double reqdQty,
string operator
)

[Jscript]
public static function PrepareProductionAttributes (
entName : string,
site : string,
item : string,
itemClass : string,
itemUOM : string,
workOrder : string,
operation : string,
targetProdRate : double,
uom : int,
batchSize : double,
startQty : double,
reqdQty : double,
operator : string
) : string

Parameters

entName
Identifies the entity that the data entry job is to be started
on.

Wonderware Factelligence Client API Reference Guide

206

Chapter 4 API Classes

site
Optionally specifies the ancestor entity of the entity that
the data entry job is to be started on. It's used to identify
the entity since entity names are not always unique across
all sites.
item
Holds a string identifying the item for the data entry job.
itemClass
Holds a string identifying the item class ID of the item.
itemUOM
Holds a string which is a description for identifying the unit
of measure of the item.
workOrder
Holds a string identifying the work order for the data entry
job.
operation
Holds a string identifying the operation for the data entry
job.
targetProdRate
Holds a floating-point value indicating the target
production rate.
uom
Holds an integer indicating the unit of measure for the
target production rate.
batchSize
Holds a floating-point value indicating the batch size for the
data entry job.
startQty
Holds a floating-point value indicating the start quantity
for the data entry job.
reqdQty
A floating-point value indicating the required quantity for
the data entry job.
operator
Holds a string identifying the user ID to associate with the
entity.

Wonderware Factelligence Client API Reference Guide

Ents Class

207

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

SelectEntityInComboBox() Method (ComboBox,


Int32)
The SelectEntityInComboBox() method selects the specified
entity in the supplied combo box. If an empty entry has been
added to the combo box it may be selected by supplying -1.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SelectEntityInComboBox( _
ByVal comboBox As ComboBox,

ByVal entID As Integer _


)

[C#]
public static void SelectEntityInComboBox(
ComboBox comboBox,
int entID
)

[C++]
public:
static void SelectEntityInComboBox(
ComboBox comboBox,
int entID
)

[J#]
public static void SelectEntityInComboBox(
ComboBox comboBox,
int entID
)

[JScript]
public static

function SelectEntityInComboBox(

comboBox : ComboBox,
entID : int
)

Parameters

comboBox
Holds the combo box containing the entity data.

Wonderware Factelligence Client API Reference Guide

208

Chapter 4 API Classes

entID
Holds the ID of the entity to select or -1 for the empty entry.

SelectEntityInComboBox() Method (ComboBox,


Generic Nullable)
The SelectEntityInComboBox() method selects the specified
entity in the supplied combo box. If an empty entry has been
added to the combo box it may be selected by supplying null.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SelectEntityInComboBox( _
ByVal comboBox As ComboBox,

ByVal entID As Nullable(Of Integer) _


)

[C#]
public static void SelectEntityInComboBox(
ComboBox comboBox,
Nullable<int> entID
)

[C++]
public:
static void SelectEntityInComboBox(
ComboBox comboBox,
Nullable<int> entID
)

[J#]
public static void SelectEntityInComboBox(
ComboBox comboBox,
Nullable<int> entID
)

[JScript]
public static

function SelectEntityInComboBox(

comboBox : ComboBox,
entID : Nullable<int>
)

Parameters

comboBox
Holds the combo box containing the entity data.
entID
Holds the ID of the entity to select or null for the empty
entry.

Wonderware Factelligence Client API Reference Guide

Ents Class

209

UpdateEntity() Method
The UpdateEntity() method updates the entity specified with
the new values supplied.
Syntax
[Visual Basic (Declaration)]
Public Sub UpdateEntity( _
ByValue entID As Integer, _
ByValue entityName As String, _
ByValue description As String, _
ByValue parentEntId As Integer, _
ByValue site As Integer, _
ByValue hourlyCost As Double, _
ByValue canScheduleJobs As Boolean, _
ByValue canRunJobs As Boolean, _
ByValue canCaptureUtil As Boolean, _
ByValue canCaptureLabor As Boolean, _
ByValue canDoDNC As Boolean, _
ByValue canTrackOEE As Boolean, _
ByValue canSchedShifts As Boolean, _
ByValue canStore As Boolean, _
ByValue canLogData As Boolean, _
ByValue canShip As Boolean, _
ByValue canReceive As Boolean, _
ByValue canCopyFolders As Boolean, _
ByValue curShiftId As Integer, _
ByValue curShiftStartTime As DateTime, _
ByValue identicalJobExecs As Integer, _
ByValue spare1 As String, _
ByValue spare2 As String, _
ByValue spare3 As String, _
ByValue spare4 As String
)

[C#]
public void UpdateEntity (
int entID,
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,

Wonderware Factelligence Client API Reference Guide

210

Chapter 4 API Classes

bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
void UpdateEntity (
int entID,
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,

Wonderware Factelligence Client API Reference Guide

Ents Class

211

bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[J#]
public void UpdateEntity (
int entID,
string entityName,
string description,
int parentEntId,
int site,
double hourlyCost,
bool canScheduleJobs,
bool canRunJobs,
bool canCaptureUtil,
bool canCaptureLabor,
bool canDoDNC,
bool canTrackOEE,
bool canSchedShifts,
bool canStore,
bool canLogData,
bool canShip,
bool canReceive,
bool canCopyFolders,
int curShiftId,
DateTime curShiftStartTime,
int identicalJobExecs,
string spare1,
string spare2,
string spare3,
string spare4
)

[Jscript]
public function UpdateEntity (
entID

int,

Wonderware Factelligence Client API Reference Guide

212

Chapter 4 API Classes

entityName :

string,

description

string,

parentEntId

int,

site

int,

hourlyCost

double,

canScheduleJobs
canRunJobs

canCaptureLabor
:

canTrackOEE
:

canReceive

bool,

bool,
:

bool,

bool,
bool,
:

canCopyFolders
curShiftId

bool,

canLogData
canShip

bool,

bool,

canSchedShifts
canStore

bool,

bool,

canCaptureUtil
canDoDNC

bool,
:

bool,

int,

curShiftStartTime

DateTime,

identicalJobExecs

int,

spare1

string,

spare2

string,

spare3

string,

spare4

string

Parameters

entID
Holds an integer identifying the entity updating.
entityName
Holds a string identifying the unique entity name.
description
Holds a string identifying the entity description.
parentEntId
Holds an integer identifying the parent entity ID. Null if
top level.
site
Holds an integer identifying the ancestor entity defines the
site of this entity. Is null if entity above sites, or for
single-site systems. If entity is a site, site is equal to the
entity ID.

Wonderware Factelligence Client API Reference Guide

Ents Class

213

hourlyCost
The cost of running.
canScheduleJobs
Holds a flag indicating whether jobs are scheduled to this
entity.
canRunJobs
Holds a flag indicating whether jobs are run on this entity.
canCaptureUtil
Holds a flag indicating whether an entity captures
utilization data.
canCaptureLabor
Holds a flag indicating whether labor data is captured on
this entity.
canDoDNC
Holds a flag indicating whether this entity communicates
with machine tools.
canTrackOEE
Holds a flag indicating whether OEE statistics are captured
on this entity.
canSchedShifts
Holds a flag indicating whether shifts are scheduled for this
entity.
canStore
Holds a flag indicating whether this entity is a warehouse
or storage location.
canLogData
Holds a flag indicating whether this entity logs data.
canShip
Holds a flag indicating whether shipments are made from
this entity.
canReceive
Holds a flag indicating whether material is received at this
entity.
canCopyFolders
Holds a flag indicating whether files in folders for this
entity are copied to its download directories.
curShiftId
Holds an integer indicating the current shift on this entity.
curShiftStartTime
Holds a date/time of the current shift start time on the
entity.

Wonderware Factelligence Client API Reference Guide

214

Chapter 4 API Classes

identicalJobExecs
Holds an integer indicating the number of identical
'positions' that can run independent jobs on this entity.
spare1
Holds a string used to save information for this entity.
spare2
Holds a string used to save information for this entity.
spare3
Holds a string used to save information for this entity.
spare4
Holds a string used to save information for this entity.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UpdateJobExec() Method
The UpdateJobExec() method updates the Job Exec record for
the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Sub UpdateJobExec( _
ByValue entID As Integer, _
ByValue jobPos As Integer, _
ByValue nextJobOnly As Boolean, _
ByValue itemBasedDesc As Boolean, _
ByValue jobEndConfirmMessage As String, _
ByValue defToEntID As Integer, _
ByValue defRejectEntID As Integer, _
ByValue defFromEntID As Integer, _
ByValue defProdReasCD As Integer, _
ByValue defConsReasCD As Integer, _
ByValue defLotNo as String, _
ByValue defSubLotNo as String, _
ByValue autoLoadJobSpecs As Boolean, _
ByValue autoSeqStartOption As Boolean, _
ByValue autoJobStartOption As Boolean, _
ByValue autoJobEndOption As Boolean, _
ByValue inclClassReas As Boolean, _
ByValue mustCompleteSteps As Boolean, _
ByValue mustProdReqdQty As Boolean, _
ByValue localMovableConsEnt As Boolean, _

Wonderware Factelligence Client API Reference Guide

Ents Class

215

ByValue localMovableProdEnt As Boolean, _


ByValue runWithoutOperator As Boolean, _
ByValue applyPostExecFCCounts As Boolean, _
ByValue suppressStartQtyPrompt As Boolean, _
ByValue allowZeroQtySplit As Boolean, _
ByValue autoAllocQtyToRunningJob As Boolean, _
ByValue curWOID As String, _
ByValue curOperID As String, _
ByValue curSeqNo As Integer, _
ByValue curStepNo As Integer, _
ByValue curStepStart As DateTime, _
ByValue spare1 As String, _
ByValue spare2 As String, _
ByValue spare3 As String, _
ByValue spare4 As String
)

[C#]
public void UpdateJobExec (
int entID,
int jobPos,
bool nextJobOnly,
bool itemBasedDesc,
string jobEndConfirmMessage,
int defToEntID,
int defRejectEntID,
int defFromEntID,
int defProdReasCD,
int defConsReasCD,
string defLotNo,
string defSubLotNo,
bool autoLoadJobSpecs,
bool autoSeqStartOption,
bool autoJobStartOption,
bool

autoJobEndOption,

bool inclClassReas,
bool mustCompleteSteps,
bool mustProdReqdQty,
bool localMovableConsEnt,
bool localMovableProdEnt,
bool runWithoutOperator,

Wonderware Factelligence Client API Reference Guide

216

Chapter 4 API Classes

bool applyPostExecFCCounts,
bool suppressStartQtyPrompt,
bool allowZeroQtySplit,
bool autoAllocQtyToRunningJob,
string curWOID,
string curOperID,
int curSeqNo,
int curStepNo,
DateTime curStepStart,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
void UpdateJobExec (
int entID,
int jobPos,
bool nextJobOnly,
bool itemBasedDesc,
string jobEndConfirmMessage,
int defToEntID,
int defRejectEntID,
int defFromEntID,
int defProdReasCD,
int defConsReasCD,
string defLotNo,
string defSubLotNo,
bool autoLoadJobSpecs,
bool autoSeqStartOption,
bool autoJobStartOption,
bool

autoJobEndOption,

bool inclClassReas,
bool mustCompleteSteps,
bool mustProdReqdQty,
bool localMovableConsEnt,
bool localMovableProdEnt,
bool runWithoutOperator,
bool applyPostExecFCCounts,

Wonderware Factelligence Client API Reference Guide

Ents Class

217

bool suppressStartQtyPrompt,
bool allowZeroQtySplit,
bool autoAllocQtyToRunningJob,
string curWOID,
string curOperID,
int curSeqNo,
int curStepNo,
DateTime curStepStart,
string spare1,
string spare2,
string spare3,
string spare4
)

[J#]
public void UpdateJobExec (
int entID,
int jobPos,
bool nextJobOnly,
bool itemBasedDesc,
string jobEndConfirmMessage,
int defToEntID,
int defRejectEntID,
int defFromEntID,
int defProdReasCD,
int defConsReasCD,
string defLotNo,
string defSubLotNo,
bool autoLoadJobSpecs,
bool autoSeqStartOption,
bool autoJobStartOption,
bool

autoJobEndOption,

bool inclClassReas,
bool mustCompleteSteps,
bool mustProdReqdQty,
bool localMovableConsEnt,
bool localMovableProdEnt,
bool runWithoutOperator,
bool applyPostExecFCCounts,
bool suppressStartQtyPrompt,
bool allowZeroQtySplit,

Wonderware Factelligence Client API Reference Guide

218

Chapter 4 API Classes

bool autoAllocQtyToRunningJob,
string curWOID,
string curOperID,
int curSeqNo,
int curStepNo,
DateTime curStepStart,
string spare1,
string spare2,
string spare3,
string spare4
)

[Jscript]
public function UpdateJobExec(
entID

jobPos

int,

int,

nextJobOnly

itemBasedDesc

bool,
:

bool,

jobEndConfirmMessage
defToEntID

int,

int,

defProdReasCD

int,

defConsReasCD

int,

defLotNo

defSubLotNo

string,

int,

defRejectEntID
defFromEntID

string,
:

string,

autoLoadJobSpecs

bool,

autoSeqStartOption

bool,

autoJobStartOption

bool,

autoJobEndOption

inclClassReas

bool,

mustCompleteSteps
mustProdReqdQty

bool,

bool,

bool,

localMovableConsEnt

bool,

localMovableProdEnt

bool,

runWithoutOperator

bool,

applyPostExecFCCounts

suppressStartQtyPrompt
allowZeroQtySplit

Wonderware Factelligence Client API Reference Guide

string,

bool,

bool,

autoAllocQtyToRunningJob
curWOID

bool,

bool,

Ents Class

curOperID
curSeqNo

:
:

curStepNo

string,
int,

curStepStart

int,
:

DateTime,

spare1

string,

spare2

string,

spare3

string,

spare4

219

string

Parameters

entID
Holds an integer identifying the entity whose job exec want
to update.
jobPos
Holds an integer identifying the job exec position want to
update.
nextJobOnly
Holds a flag indicating whether to start the next job or
select any job to start.
itemBasedDesc
Holds a flag indicating that messages should use item
descriptions not operation descriptions.
jobEndConfirmMessage
Holds a string which is the operation end confirm message.
defToEntID
Holds an integer identifying the default storage entity for
good production items, and rejects if def_reject_ent_id is
null.
defRejectEntID
Holds an integer identifying the default storage entity for
reject production.
defFromEntID
Holds an integer identifying default storage entity for item
issues.
defProdReasCD
Holds an integer identifying the default reason code for
good production.
defConsReasCD
Holds an integer identifying the default reason code for
normal consumption.

Wonderware Factelligence Client API Reference Guide

220

Chapter 4 API Classes

defLotNo
Holds a string identifying the default lot number for
production.
defSubLotNo
Holds a string identifying the default sublot number for
production.
autoLoadJobSpecs
Holds a flag indicating if should auto load job specs to tags.
autoSeqStartOption
Holds an integer identifying an enumeration of conditions
to automatically start the job with the current W/O and op.
and next seq_no: -=Don't start automatically, 1=Start job
with next sequence when previous done.
autoJobStartOption
Holds an integer identifying an enumeration of conditions
to automatically start a job. 0=Don't start automatically,
1=Start next scheduled job as soon as ready, 2=Start next
scheduled job with W/O specified in tag that just changed.
autoJobEndOption
Holds an integer identifying an enumeration of conditions
to automatically end a job 0=Don't end automatically,
1=when QtyDone>=QtyReqd.
inclClassReas
Holds a flag indicating if item reasons for item class should
also be available to choose from if there are entity-related
item reasons defined.
mustCompleteSteps
Holds a flag indicating if all steps must be
completed/bypassed to end job.
mustProdReqdQty
Holds a flag indicating whether required quantity must be
produced (good) to end the job.
localMovableConsEnt
Holds a flag indicating if movable storage entities supplying
consumption need to be in/at the entity producing it.
localMovableProdEnt
Holds a flag indicating if movable storage entities receiving
production need to be in/at the entity producing it.
runWithoutOperator
Holds a flag indicating if jobs may run without an operator
logged onto the entity; if no, running jobs are suspended
when last operator logs off.

Wonderware Factelligence Client API Reference Guide

Ents Class

221

applyPostExecFCCounts
Holds a flag indicating if production counts received from
Factory Connector when no job is running should be applied
to the last job that ran on the entity. No suggests that
such counts are ignored.
suppressStartQtyPrompt
Holds a flag indicating if a prompt to specify a quantity to
start when the Start Some button is pressed should be
suppressed.
allowZeroQtySplit
Holds a flag indicating if default quantities to be used from
Start some are 0.
autoAllocQtyToRunning Job
Holds a flag indicating if overages in reported production
are to be covered by moving quantities from a scheduled,
non-running job if available.
curWOID
Holds a string identifying the current work order on this
entity.
curOperID
Holds a string identifying the current operation on this
entity.
curSeqNo
Holds an integer identifying the current operation split.
curStepNo
Holds an integer identifying the last step started on this
entity.
curStepStart
Holds a DateTime which is when the last step was started
on this entity.
spare1
Holds a string used to save information for this entity.
spare2
Holds a string used to save information for this entity.
spare3
Holds a string used to save information for this entity.
spare4
Holds a string used to save information for this entity.

UpdateOEEExec() Method
The UpdateOEEExec() method updates the OEE Exec record
for the entity passed in.

Wonderware Factelligence Client API Reference Guide

222

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Shared Sub UpdateOEEExec( _
ByValue entId As Integer, _
ByValue jobEntId As Integer, _
ByValue utilEntId As Integer, _
ByValue targetOEEPercent As Double, _
ByValue targetPerformancePercent As Double, _
ByValue targetQualityPercent As Double, _
ByValue defProdRate As Double, _
ByValue defProdUOM As Integer
)

[C#]
public static void UpdateOEEExec (
int entId,
int jobEntId,
int utilEntId,
double targetOEEPercent,
double targetPerformancePercent,
double targetQualityPercent,
double defProdRate,
int defProdUOM
)

[C++]
public:
static void UpdateOEEExec (
int entId,
int jobEntId,
int utilEntId,
double targetOEEPercent,
double targetPerformancePercent,
double targetQualityPercent,
double defProdRate,
int defProdUOM
)

[J#]
public static void UpdateOEEExec (
int entId,
int jobEntId,
int utilEntId,
double targetOEEPercent,

Wonderware Factelligence Client API Reference Guide

Ents Class

223

double targetPerformancePercent,
double targetQualityPercent,
double defProdRate,
int defProdUOM
)

[Jscript]
public static function UpdateOEEExec(
entId

jobEntId

int,
:

utilEntId

int,

int,

targetOEEPercent

double,

targetPerformancePercent
targetQualityPercent
defProdRate
defProdUOM

:
:

double,

double,

double,
int

Parameters

entId
Holds an integer identifying the entity whose oee_exec
record is to be updated.
jobEntId
Holds an integer identifying the entity to get production
data.
utilEntId
Holds an integer identifying the entity to get utilization
data.
targetOEEPercent
Holds a float that is gives the target OEE as a percentage.
targetPerformancePercent
Holds a float that gives the target performance as a
percentage.
targetQualityPercent
Holds a float that gives the target quality as a percentage.
defProdRate
Holds a float that gives the default production rate so OEE
is calculated if item unknown is a straight monitoring
application.
defProdUOM
Holds an integer identifying the unit of measure of the
default production rate.

Wonderware Factelligence Client API Reference Guide

224

Chapter 4 API Classes

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UpdateUtilExec() Method
The UpdateUtilExec() method updates the Util Exec record for
the entity that is passed in.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub UpdateUtilExec( _
ByValue entId As Integer, _
ByValue curStateCd As Integer, _
ByValue curReasCd As Integer, _
ByValue curReasStart As DateTime, _
ByValue targetUtilPercent As Double, _
ByValue currentUtil As Double, _
ByValue jobStartReasCd As Integer, _
ByValue jobEndReasCd As Integer, _
ByValue unKnownReasonCd As Integer, _
ByValue shiftStartReasCd As Integer, _
ByValue shiftEndReasCd As Integer
)

[C#]
public static void UpdateUtilExec (
int entId,
int curStateCd,
int curReasCd,
DateTime curReasStart,
double targetUtilPercent,
double currentUtil,
int jobStartReasCd,
int jobEndReasCd,
int unKnownReasonCd,
int shiftStartReasCd,
int shiftEndReasCd
)

[C++]
public:
static void UpdateUtilExec (
int entId,
int curStateCd,

Wonderware Factelligence Client API Reference Guide

Ents Class

225

int curReasCd,
DateTime curReasStart,
double targetUtilPercent,
double currentUtil,
int jobStartReasCd,
int jobEndReasCd,
int unKnownReasonCd,
int shiftStartReasCd,
int shiftEndReasCd
)

[J#]
public static void UpdateUtilExec (
int entId,
int curStateCd,
int curReasCd,
DateTime curReasStart,
double targetUtilPercent,
double currentUtil,
int jobStartReasCd,
int jobEndReasCd,
int unKnownReasonCd,
int shiftStartReasCd,
int shiftEndReasCd
)

[Jscript]
public static function UpdateUtilExec(
entId

int,

curStateCd
curReasCd

:
:

curReasStart

int,
int,
:

DateTime,

targetUtilPercent
currentUtil

jobStartReasCd
jobEndReasCd

double,

double,
:

int,

int,

unKnownReasonCd

shiftStartReasCd
shiftEndReasCd

int,

int,

int

Wonderware Factelligence Client API Reference Guide

226

Chapter 4 API Classes

Parameters

entId
Holds an integer identifying the entity whose util_exec
record is to be updated.
curStateCd
Holds an integer identifying the current state of this entity.
curReasCd
Holds an integer identifying the current reason of this
entity.
curReasStart
Holds a date/time identifying when the current entity
reason started in UTC.
targetUtilPercent
Holds a float identifying the target entity utilization as a
percentage.
currentUtil
Holds a float identifying the current entity utilization =
RT/(RT+DT).
jobStartReasCd
Holds an integer identifying the default reason when job
starts.
jobEndReasCd
Holds an integer identifying the default reason when job
ends.
unKnownReasonCd
Holds an integer identifying the default reason when
unknown reason from I/O.
shiftStartReasCd
Holds an integer identifying the default reason when a
valid shift starts. (Only applied if a job is not running on
this entity.)
shiftEndReasCd
Holds an integer identifying the default reason when a
valid shift ends. (Only applied if a job is not running on the
entity.)
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

Jobs Class

227

Jobs Class
The Jobs class provides Factelligence MES functionality for a
job when not in the context of a currently running job. All
information identifying the job must be provided. All
methods in this class are static.

AddConsDirect() Method
The AddConsDirect() method adds consumption information
directly for an item, not necessarily through a job that has
run on an entity. This means that consumption can be added
to the item even if there is no job that produces this identified
item.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddConsDirect( _
ByVal userId As String,

ByVal fromEntId As Integer,


ByVal itemId As String,

ByVal qtyCons As Double,

ByVal reasCd As Integer,

ByVal gradeCd As Integer,

ByVal statusCd As Integer,


ByVal lotNo As String,

ByVal shiftId As Integer,

ByVal shiftStart As String,


ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal entId As Integer,

ByVal spare1 As String,

ByVal spare2 As String,

ByVal spare3 As String,

ByVal spare4 As String,

ByVal item_scrapped As Integer _


)

[C#]
public static void AddConsDirect(
string userId,
int fromEntId,
string itemId,
double qtyCons,

Wonderware Factelligence Client API Reference Guide

228

Chapter 4 API Classes

int reasCd,
int gradeCd,
int statusCd,
string lotNo,
int shiftId,
string shiftStart,
string woId,
string operId,
int seqNo,
int entId,
string spare1,
string spare2,
string spare3,
string spare4,
int item_scrapped
)

[C++]
public:
static void AddConsDirect(
String userId,
int fromEntId,
String itemId,
double qtyCons,
int reasCd,
int gradeCd,
int statusCd,
String lotNo,
int shiftId,
String shiftStart,
String woId,
String operId,
int seqNo,
int entId,
String spare1,
String spare2,
String spare3,
String spare4,
int item_scrapped
)

[J#]

Wonderware Factelligence Client API Reference Guide

Jobs Class

229

public static void AddConsDirect(


string userId,
int fromEntId,
string itemId,
double qtyCons,
int reasCd,
int gradeCd,
int statusCd,
string lotNo,
int shiftId,
string shiftStart,
string woId,
string operId,
int seqNo,
int entId,
string spare1,
string spare2,
string spare3,
string spare4,
int item_scrapped
)

[JScript]
public static

function AddConsDirect(

userId : String,
fromEntId : int,
itemId : String,
qtyCons : double,
reasCd : int,
gradeCd : int,
statusCd : int,
lotNo : String,
shiftId : int,
shiftStart : String,
woId : String,
operId : String,
seqNo : int,
entId : int,
spare1 : String,
spare2 : String,
spare3 : String,

Wonderware Factelligence Client API Reference Guide

230

Chapter 4 API Classes

spare4 : String,
item_scrapped : int
)

Parameters

userId
Holds the ID of the user to whom to attribute consumption.
fromEntId
Holds an entity ID of the storage entity from which the
quantity was consumed.
itemId
The item that is being consumed.
qtyCons
Holds the consumption quantity being added.
reasCd
Holds an item reason code for the quantity consumed.
gradeCd
Holds an item grade for the quantity consumed. Pass -1 if
not used.
statusCd
Holds the item status for the quantity consumed. Pass -1 if
not used.
lotNo
Holds the lot number for the item that is being consumed.
Pass null if not used to identify the item_cons record.
shiftId
Holds the shift ID for the shift in which this item was
consumed. Pass -1 if not used to identify the item_cons
record.
shiftStart
Holds the shift start of the shift in which this item was
consumed. Pass null if not used to identify the item_cons
record.
woId
Holds the work order ID of a job that the item was
consumed by. Pass null if not used to identify the item_cons
record.
operId
Holds the operation ID of a job that the item was consumed
by. Pass null if not used to identify the item_cons record.
seqNo
Holds the sequence number of a job that the item was
consumed by. Pass -1 if not used to identify the item_cons
record.

Wonderware Factelligence Client API Reference Guide

Jobs Class

231

entId
Holds the ID of the entity that the job that the item
consumed by ran on. Pass -1 if not used to identify the
item_cons record.
spare1
Holds an optional value for the spare1 field of the job. Pass
null if not used.
spare2
Holds an optional value for the spare2 field of the job. Pass
null if not used.
spare3
Holds an optional value for the spare3 field of the job. Pass
null if not used.
spare4
Holds an optional value for the spare4 field of the job. Pass
null if not used.
item_scrapped
Flag specifying if item was consumed as scrap. Pass 0 for
normal consumption.
Exceptions

An exception is thrown if an error occurs while updating the


database.

AddConsPostExec() Method
The AddConsPostExec() method adds consumption data for
the specified job after the job has run on the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddConsPostExec( _
ByVal userID As String,

ByVal entID As Integer,

ByVal bomPos As Object,

ByVal qty As Double,

ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

ByVal shiftStart As Date,

ByVal shiftID As Integer,

ByVal reasCd As Object,

ByVal itemID As String,

ByVal lotNo As String,

ByVal fgLotNo As String,

Wonderware Factelligence Client API Reference Guide

232

Chapter 4 API Classes

ByVal fromEntID As Object,


ByVal extRef As String,

ByVal spare1 As String,

ByVal spare2 As String,

ByVal spare3 As String,

ByVal spare4 As String,

ByVal rowID As Integer _


)

[C#]
public static void AddConsPostExec(
string userID,
int entID,
object bomPos,
double qty,
string woID,
string operID,
int seqNo,
DateTime shiftStart,
int shiftID,
object reasCd,
string itemID,
string lotNo,
string fgLotNo,
object fromEntID,
string extRef,
string spare1,
string spare2,
string spare3,
string spare4,
int rowID
)

[C++]
public:
static void AddConsPostExec(
String userID,
int entID,
Object bomPos,
double qty,
String woID,
String operID,

Wonderware Factelligence Client API Reference Guide

Jobs Class

233

int seqNo,
DateTime shiftStart,
int shiftID,
Object reasCd,
String itemID,
String lotNo,
String fgLotNo,
Object fromEntID,
String extRef,
String spare1,
String spare2,
String spare3,
String spare4,
int rowID
)

[J#]
public static void AddConsPostExec(
string userID,
int entID,
object bomPos,
double qty,
string woID,
string operID,
int seqNo,
DateTime shiftStart,
int shiftID,
object reasCd,
string itemID,
string lotNo,
string fgLotNo,
object fromEntID,
string extRef,
string spare1,
string spare2,
string spare3,
string spare4,
int rowID
)

[JScript]
public static

function AddConsPostExec(

Wonderware Factelligence Client API Reference Guide

234

Chapter 4 API Classes

userID : String,
entID : int,
bomPos : Object,
qty : double,
woID : String,
operID : String,
seqNo : int,
shiftStart : DateTime,
shiftID : int,
reasCd : Object,
itemID : String,
lotNo : String,
fgLotNo : String,
fromEntID : Object,
extRef : String,
spare1 : String,
spare2 : String,
spare3 : String,
spare4 : String,
rowID : int
)

Parameters

userID
Holds the ID of the user to whom to attribute consumption.
entID
Holds the ID of the entity on which the job ran.
bomPos
Holds the BOM position of the item. It is an optional
parameter used to identify an item_cons record to add
consumption to an existing row if there is one. If this
parameter is not to be used to identify an item_cons record,
it should be set to null.
qty
Holds the consumption quantity being added.
woID
Holds the ID of the work order.
operID
Holds the ID of the operation.
seqNo
Holds the sequence number of the operation.

Wonderware Factelligence Client API Reference Guide

Jobs Class

235

shiftStart
Holds the start of the shift during which consumption
occurred.
shiftID
Holds the ID of the shift.
reasCd
Holds the reason code of the item being consumed. This is
an optional parameter that is used to identify an item_cons
record to add consumption to the existing row if there is
one. If the reason code is null, it is not used when
identifying the item_cons record.
itemID
Holds the item being consumed. This is an optional
parameter that is used to identify an item_cons record to
add consumption to the existing row if there is one. If the
item ID is null, it is not used when identifying the
item_cons record.
lotNo
Holds the lot number of the item being consumed. This is
an optional parameter that is used to identify an item_cons
record to add consumption to the existing row if there is
one. If the lot number is null, it is not used when identifying
the item_cons record.
fgLotNo
Holds the finished goods lot number of the item being
consumed. This is an optional parameter that is used to
identify an item_cons record to add consumption to the
existing row if there is one. If the fgLotNo is null, it is not
used when identifying the item_cons record.
fromEntID
Holds the storage entity ID. This is an optional parameter
that is used to identify an item_cons record to add
consumption to the existing row if there is one. If the
fromEntID is null, it is not used when identifying the
item_cons record.
.extRef
Holds the external reference of the item being consumed.
This is an optional parameter that is used to identify an
item_cons record to add consumption to the existing row if
there is one. If the extRef is null, it is not used when
identifying the item_cons record.
spare1
Holds an optional value for spare1. Set to null if not used.
spare2
Holds an optional value for spare2. Set to null if not used.

Wonderware Factelligence Client API Reference Guide

236

Chapter 4 API Classes

spare3
Holds an optional value for spare3. Set to null if not used.
spare4
Holds an optional value for spare4. Set to null if not used.
rowID
Holds an optional value for row_id. Set to -1 if not used.
Exceptions

An exception is thrown if an error occurs while updating the


database.

AddJobEvent() Method
The AddJobEvent() method adds a job event to the specified
job. Job events include things such as, a certification signoff,
adding production, adding consumption, reclassifying
production, reclassifying consumption, completing a step,
changing job specifications, and changing a job state.
Syntax

[Visual Basic (Declaration)]


Public Shared Function AddJobEvent( _
ByVal eventTime As Date,
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

ByVal stepNo As Object,

ByVal eventType As Object,


ByVal bomPos As Object,
ByVal lotNo As Object,
ByVal itemID As Object,

_
_
_

ByVal certName As Object,

ByVal doneByUserID As Object,

ByVal checkedByUserID As Object,


ByVal itemProdRowID As Object,

ByVal itemConsRowID As Object,

ByVal specID As Object,

ByVal comments As Object,


ByVal value1 As Object,

ByVal value2 As Object,

ByVal value3 As Object,

ByVal value4 As Object,

ByVal value5 As Object,

ByVal value6 As Object,

Wonderware Factelligence Client API Reference Guide

Jobs Class

ByVal value7 As Object,

ByVal value8 As Object,

ByVal value9 As Object,

ByVal value10 As Object,


ByVal entID As Integer,

237

_
_

ByVal jobPos As Object _


) As Boolean

[C#]

public static bool AddJobEvent(


DateTime eventTime,
string woID,
string operID,
int seqNo,
object stepNo,
object eventType,
object bomPos,
object lotNo,
object itemID,
object certName,
object doneByUserID,
object checkedByUserID,
object itemProdRowID,
object itemConsRowID,
object specID,
object comments,
object value1,
object value2,
object value3,
object value4,
object value5,
object value6,
object value7,
object value8,
object value9,
object value10,
int entID,
object jobPos
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

238

Chapter 4 API Classes

static bool AddJobEvent(


DateTime eventTime,
String woID,
String operID,
int seqNo,
Object stepNo,
Object eventType,
Object bomPos,
Object lotNo,
Object itemID,
Object certName,
Object doneByUserID,
Object checkedByUserID,
Object itemProdRowID,
Object itemConsRowID,
Object specID,
Object comments,
Object value1,
Object value2,
Object value3,
Object value4,
Object value5,
Object value6,
Object value7,
Object value8,
Object value9,
Object value10,
int entID,
Object jobPos
)

[J#]
public static bool AddJobEvent(
DateTime eventTime,
string woID,
string operID,
int seqNo,
object stepNo,
object eventType,
object bomPos,
object lotNo,

Wonderware Factelligence Client API Reference Guide

Jobs Class

239

object itemID,
object certName,
object doneByUserID,
object checkedByUserID,
object itemProdRowID,
object itemConsRowID,
object specID,
object comments,
object value1,
object value2,
object value3,
object value4,
object value5,
object value6,
object value7,
object value8,
object value9,
object value10,
int entID,
object jobPos
)

[JScript]
public static

function AddJobEvent(

eventTime : DateTime,
woID : String,
operID : String,
seqNo : int,
stepNo : Object,
eventType : Object,
bomPos : Object,
lotNo : Object,
itemID : Object,
certName : Object,
doneByUserID : Object,
checkedByUserID : Object,
itemProdRowID : Object,
itemConsRowID : Object,
specID : Object,
comments : Object,
value1 : Object,

Wonderware Factelligence Client API Reference Guide

240

Chapter 4 API Classes

value2 : Object,
value3 : Object,
value4 : Object,
value5 : Object,
value6 : Object,
value7 : Object,
value8 : Object,
value9 : Object,
value10 : Object,
entID : int,
jobPos : Object
) : bool

Parameters

eventTime
Holds the timestamp for the job event.
woID
Holds the work order ID of the job
operID
Holds the operation ID of the job.
seqNo
Holds the operation sequence number.
stepNo
Optionally holds the step number. Pass null if not used.
eventType
Optionally holds the event type. Pass null if not used.
bomPos
Optionally holds the BOM position. Pass null if not used.
lotNo
Optionally holds the lot number. Pass null if not used.
itemID
Optionally holds the item ID. Pass null if not used.
certName
Optionally holds the certification name. Pass null if not
used.
doneByUserID
Optionally holds the ID of the user who did the event. Pass
null if not used.
checkedByUserID
Optionally holds the ID of the user who checked the event.
Pass null if not used.

Wonderware Factelligence Client API Reference Guide

Jobs Class

241

itemProdRowID
Optionally holds the ID of the row in the item_prod table.
Pass null if not used.
itemConsRowID
Optionally hold the ID of the row in the item_cons table.
Pass null if not used.
specID
Optionally holds the ID of the specification used. Pass null
if not used.
comments
Optionally holds a comment about the event. Pass null if
not used.
value1
Optionally holds the first value for the job event. Pass null
if not used.
value2
Optionally holds the second value for the job event. Pass
null if not used.
value3
Optionally holds the third value for the job event. Pass null
if not used.
value4
Optionally holds the fourth value for the job event. Pass
null if not used.
value5
Optionally holds the fifth value for the job event. Pass null
if not used.
value6
Optionally holds the sixth value for the job event. Pass null
if not used.
value7
Optionally holds the seventh value for the job event. Pass
null if not used.
value8
Optionally holds the eighth value for the job event. Pass
null if not used.
value9
Optionally holds the ninth value for the job event. Pass null
if not used.
value10
Optionally holds the tenth value for the job event. Pass null
if not used.

Wonderware Factelligence Client API Reference Guide

242

Chapter 4 API Classes

entID
Optionally holds the ID of the entity on which the event
occurred. Pass null if not used.
jobPos
Optionally holds the job_pos.
Return Value

Returns true if the event is recorded or false if the event is


not recorded.

Exceptions

An exception is thrown if the error from the middleware.

AddProd () Method
The AddProd() method adds the specified amount of
production to the specified entity with the specified reason
code.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddProd ( _
ByValue entName As String, _
ByValue site As String, _
ByValue qty As Double, _
ByValue reasCd As Integer
)

[C#]
public void AddProd (
string entName,
string site,
double qty,
int reasCd
)

[C++]
public:
void AddProd (
string entName,
string site,
double qty,
int reasCd
)

[J#]
public void AddProd (
string entName,
string site,

Wonderware Factelligence Client API Reference Guide

Jobs Class

243

double qty,
int reasCd
)

[Jscript]
public function AddProd (
entName : string,
site : string,
qty : double,
reasCd : int
)

Parameters

entName
Holds a string specifying the entity name of the entity to
which production is added.
site
Holds a string specifying the name of the ancestor entity
that defines the site of the entity. Used to identify the
entity specified by entName since entity names may not be
unique.
Null if the entity name is unique across all sites.
qty
Holds an double specifying the amount of production that is
to be added.
reasCD
Holds an integer specifying the reason that uniquely
identifies grade and status of the goods produced.

AddProdPostExec() Method
The AddProdPostExec() method adds production data for the
specified job after the job has run on the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddProdPostExec( _
ByVal userID As String,

ByVal entID As Integer,

ByVal qty As Double,


ByVal woID As String,

_
_

ByVal operID As String,

ByVal seqNo As Integer,

ByVal shiftStart As Date,

ByVal shiftID As Integer,

ByVal itemID As String,

Wonderware Factelligence Client API Reference Guide

244

Chapter 4 API Classes

ByVal reasCd As Object,


ByVal lotNo As String,

_
_

ByVal toEntID As Object,

ByVal processed As Object,

ByVal byProduct As Object,

ByVal extRef As String,

ByVal moveStatus As Object,


ByVal spare1 As String,

ByVal spare2 As String,

ByVal spare3 As String,

ByVal spare4 As String _


)

[C#]
public static void AddProdPostExec(
string userID,
int entID,
double qty,
string woID,
string operID,
int seqNo,
DateTime shiftStart,
int shiftID,
string itemID,
object reasCd,
string lotNo,
object toEntID,
object processed,
object byProduct,
string extRef,
object moveStatus,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
static void AddProdPostExec(
String userID,
int entID,

Wonderware Factelligence Client API Reference Guide

Jobs Class

245

double qty,
String woID,
String operID,
int seqNo,
DateTime shiftStart,
int shiftID,
String itemID,
Object reasCd,
String lotNo,
Object toEntID,
Object processed,
Object byProduct,
String extRef,
Object moveStatus,
String spare1,
String spare2,
String spare3,
String spare4
)

[J#]
public static void AddProdPostExec(
string userID,
int entID,
double qty,
string woID,
string operID,
int seqNo,
DateTime shiftStart,
int shiftID,
string itemID,
object reasCd,
string lotNo,
object toEntID,
object processed,
object byProduct,
string extRef,
object moveStatus,
string spare1,
string spare2,
string spare3,

Wonderware Factelligence Client API Reference Guide

246

Chapter 4 API Classes

string spare4
)

[JScript]
public static

function AddProdPostExec(

userID : String,
entID : int,
qty : double,
woID : String,
operID : String,
seqNo : int,
shiftStart : DateTime,
shiftID : int,
itemID : String,
reasCd : Object,
lotNo : String,
toEntID : Object,
processed : Object,
byProduct : Object,
extRef : String,
moveStatus : Object,
spare1 : String,
spare2 : String,
spare3 : String,
spare4 : String
)

Parameters

userID
Holds the ID of the user to whom to attribute production
entID
Holds the ID of the entity on which the job ran.
qty
Holds the production quantity being added.
woID
Holds the ID of the work order.
operID
Holds the ID of the operation.
seqNo
Holds the sequence number of the operation.
shiftStart
Holds the start of the shift during which production
occurred.
Wonderware Factelligence Client API Reference Guide

Jobs Class

247

shiftID
Holds the ID of the shift.
itemID
Holds an optional ID of the item being produced. Set to null
if not used.
reasCd
Holds an optional item reason code for the quantity
produced. Set to null if not used.
lotNo
Holds an optional lot number for the quantity produced. Set
to null if not used.
toEntID
Holds an optional ID of the storage entity to which the
quantity was produced. Set to null if not used.
processed
Holds an optional flag to mark if the quantity was
processed. Set to null if not used.
byProduct
Holds an optional flag to tell if a byproduct was produced.
Set to null if not used.
extRef
Holds an optional external reference. Set to null if not used.
moveStatus
Holds an optional move status. Set to null if not used.
spare1
Holds an optional value for spare1. Set to null if not used.
spare2
Holds an optional value for spare2. Set to null if not used.
spare3
Holds an optional value for spare3. Set to null if not used.
spare4
Holds an optional value for spare4. Set to null if not used.
Exceptions

An exception is thrown if an error occurs while updating the


database.

EndJob() Method
The EndJob() method ends the job that is identified by the
input parameters. If the job is part of a batch, an attempt is
made to end all jobs in the batch. Ending a job puts the job
state into a completed state.

Wonderware Factelligence Client API Reference Guide

248

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Shared Sub EndJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String _


)

[C#]
public static void EndJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[C++]
public:
static void EndJob(
String woId,
String operId,
int seqNo,
String statusNotes
)

[J#]
public static void EndJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[JScript]
public static

function EndJob(

woId : String,
operId : String,
seqNo : int,
statusNotes : String
)

Parameters

woId
Holds the work order identifying the job that is to be
completed.

Wonderware Factelligence Client API Reference Guide

Jobs Class

249

operId
Holds the operation ID identifying the job that is to be
completed.
seqNo
Holds the sequence number identifying the job that is to
completed.
statusNotes
Holds the status notes that are to be saved with the job
when the job is completed. These notes are edited on the
dialog used to confirm that the user wants to complete the
job.
Exceptions

An exception is thrown if an error occurs.

EndAllJobs () Method
The EndAllJobs() method attempts to end all jobs that are
currently running on the entity specified. Any failure to end
a job results in an error message being added to the end of
the return string. All error messages in this return string are
separated by a semi colon and contain the job
information(wo/op/seq) and any message returned by the
middleware.
Syntax

[Visual Basic (Declaration)]


Public Shared Function AddProd ( _
ByValue entName As String, _
ByValue statusNotes As String
) As String

[C#]

public string AddProd (


string entName,
string statusNotes
)

[C++]
public:
string AddProd (
string entName,
string statusNotes
)

[J#]
public string AddProd (
string entName,

Wonderware Factelligence Client API Reference Guide

250

Chapter 4 API Classes

string statusNotes
)

[Jscript]
public function AddProd (
entName : string,
statusNotes : string
) : string

Parameters

entName
Holds a string which is the entity name of the entity that
all jobs running on should be ended.
statusNotes
Holds a string contains any status notes that are to be
added to the event when ending a job that is currently
running on the entity specified.

GetAllJobStates() Method
The GetAllJobStates() method returns a DataSet containing
the job states defined. A job state is the production state of a
job. Examples include: running, paused, completed,
cancelled.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAllJobStates() As DataSet

[C#]

public static DataSet GetAllJobStates()

[C++]

public:
static DataSet GetAllJobStates()

[J#]

public static DataSet GetAllJobStates()

[JScript]

public static

function GetAllJobStates() : DataSet

Return Value

Returns a DataSet containing a row for each job state.

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

GetConfirmation() Method
The GetConfirmation() method returns confirmation from the
user that he wants to perform a specific action on a job by
prompting with a dialog box confirming that the state

Wonderware Factelligence Client API Reference Guide

Jobs Class

251

selected is the state the user wants to put. Permitted actions


are Starting, Pausing, and Ending jobs. Status notes are
passed by reference in case the user modifies them when
changing the job state.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetConfirmation( _
ByVal jobState As JobStates,
ByVal action As String,

ByVal woDesc As String,

ByVal operId As String,

ByVal jobDesc As String,

ByRef statusNotes As String,

ByVal userCanAppend As Boolean,


ByVal userCanEdit As Boolean,

ByVal batchJobs As Boolean _


) As Boolean

[C#]

public static bool GetConfirmation(


JobStates jobState,
string action,
string woDesc,
string operId,
string jobDesc,
ref string statusNotes,
bool userCanAppend,
bool userCanEdit,
bool batchJobs
)

[C++]
public:
static bool GetConfirmation(
JobStates jobState,
String action,
String woDesc,
String operId,
String jobDesc,
String% statusNotes,
bool userCanAppend,
bool userCanEdit,
bool batchJobs

Wonderware Factelligence Client API Reference Guide

252

Chapter 4 API Classes

[J#]
public static bool GetConfirmation(
JobStates jobState,
string action,
string woDesc,
string operId,
string jobDesc,
string statusNotes,
bool userCanAppend,
bool userCanEdit,
bool batchJobs
)

[JScript]
public static

function GetConfirmation(

jobState : JobStates,
action : String,
woDesc : String,
operId : String,
jobDesc : String,
statusNotes : String,
userCanAppend : bool,
userCanEdit : bool,
batchJobs : bool
) : bool

Parameters

jobState
Holds the job state that user wants to put.
action
Holds the action the user wants to perform. These actions
include Start, End, or Pause.
woDesc
Holds the description of the work order that this job is
performing.
operId
Holds the operation ID of the job that user is confirming to
perform the specified action on.
jobDesc
Holds the description of the job that the user is confirming
to perform the specified action on.

Wonderware Factelligence Client API Reference Guide

Jobs Class

253

statusNotes
Holds the statusNotes of the job that the user is confirming
to perform the specified action on. If the user has the
privileges for appending or editing notes, these notes can be
edited when performing one of the specified actions as the
status of the job is being changed.
userCanAppend
Holds a flag indicating whether or not the user has the
privilege to append to the status notes of the job. This
means that the user can add to the notes that are already
present, but cannot delete anything that was previously
entered.
userCanEdit
Holds a flag indicating whether or not the user has the
privilege to edit the status notes of the job. The user can
added to as well as delete from the current status notes of
the job.
batchJobs
Holds a flag indicating that this job is part of a batch of
jobs. If a job is part of a batch, all jobs in that batch are
started, paused or ended at the same time.
Return Value

Returns true if the users does confirm the action, returns


false if not or if the call fails for any reason.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetDownstreamOperations() Method
The GetDownstreamOperations() method returns the
downstream operations for the specified job and returns a
DataSet containing the work order, operation, and sequence
number of these downstream operations. Downstream
operations are those operations of the job that occur in the
same job route as the specified job.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetDownstreamOperations( _
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer _


) As DataSet

[C#]

public static DataSet GetDownstreamOperations(

Wonderware Factelligence Client API Reference Guide

254

Chapter 4 API Classes

string woID,
string operID,
int seqNo
)

[C++]
public:
static DataSet GetDownstreamOperations(
String woID,
String operID,
int seqNo
)

[J#]
public static DataSet GetDownstreamOperations(
string woID,
string operID,
int seqNo
)

[JScript]
public static

function GetDownstreamOperations(

woID : String,
operID : String,
seqNo : int
) : DataSet

Parameters

woID
Holds the work order ID of the job whose downstream
operations want to retrieve.
operID
Holds the operation ID of the job whose downstream
operations want to retrieve.
seqNo
Holds the sequence number of the job whose downstream
operations want to retrieve.
Return Value

Returns a DataSet containing the downstream operations.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

Wonderware Factelligence Client API Reference Guide

Jobs Class

255

GetDownstreamProduction() Method
The GetDownstreamProduction() method, gets DataSet of
Item_Prod records, for the specified job. Lot and sublot are
optional parameters that can be supplied and are used to
filter the item_prod records to those that have the produced
item as part of the specified lot and/or sublot.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetDownstreamProduction( _
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

ByVal lotNo As String,

ByVal sublotNo As String _


) As DataSet

[C#]

public static DataSet GetDownstreamProduction(


string woID,
string operID,
int seqNo,
string lotNo,
string sublotNo
)

[C++]
public:
static DataSet GetDownstreamProduction(
String woID,
String operID,
int seqNo,
String lotNo,
String sublotNo
)

[J#]
public static DataSet GetDownstreamProduction(
string woID,
string operID,
int seqNo,
string lotNo,
string sublotNo
)

[JScript]

Wonderware Factelligence Client API Reference Guide

256

Chapter 4 API Classes

public static

function GetDownstreamProduction(

woID : String,
operID : String,
seqNo : int,
lotNo : String,
sublotNo : String
) : DataSet

Parameters

woID
Holds the job's work order ID.
operID
Holds the job's operation ID.
seqNo
Holds the job's sequence number.
lotNo
Holds the lot number of the produced item.
sublotNo
Holds the sublot number of the lot of the produced item.
Return Value

Returns a DataSet containing the downstream production


information for the specified job.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetJob() Method
The GetJob() method gets all of the job data for the specified
job. Job data includes current job state, the job priority, the
required finish time, and quantity produced. A job is
specified by a work order, an operation, and a sequence
number.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer _


) As DataRow

[C#]

public static DataRow GetJob(


string woId,

Wonderware Factelligence Client API Reference Guide

Jobs Class

257

string operId,
int seqNo
)

[C++]
public:
static DataRow GetJob(
String woId,
String operId,
int seqNo
)

[J#]
public static DataRow GetJob(
string woId,
string operId,
int seqNo
)

[JScript]
public static

function GetJob(

woId : String,
operId : String,
seqNo : int
) : DataRow

Parameters

woId
Holds the work order ID of the job.
operId
Holds the operation ID of the job.
seqNo
Holds the sequence number of the operation.
Return Value

Returns a DataSet containing the information about the


job.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetJobEvents() Method
The GetJobEvents() method returns a DataSet containing all
job event data for the specified job. Job Events include things
such as, a certification signoff, adding production, adding
consumption, reclassifying production, reclassifying

Wonderware Factelligence Client API Reference Guide

258

Chapter 4 API Classes

consumption, completing a step, changing job specifications,


and changing a job state. The data can be optionally filtered
by step number and/or lot number.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobEvents( _
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

ByVal stepNo As Object,

ByVal lotNo As String _


) As DataSet

[C#]

public static DataSet GetJobEvents(


string woID,
string operID,
int seqNo,
object stepNo,
string lotNo
)

[C++]
public:
static DataSet GetJobEvents(
String woID,
String operID,
int seqNo,
Object stepNo,
String lotNo
)

[J#]
public static DataSet GetJobEvents(
string woID,
string operID,
int seqNo,
object stepNo,
string lotNo
)

[JScript]
public static

function GetJobEvents(

woID : String,
operID : String,

Wonderware Factelligence Client API Reference Guide

Jobs Class

259

seqNo : int,
stepNo : Object,
lotNo : String
) : DataSet

Parameters

woID
Holds the work order ID of the job for which event data is
desired.
operID
Holds the operation ID of the job for which event data is
desired.
seqNo
Holds the operation sequence number of the job for which
event data is desired.
stepNo
Holds the step number to filter the job event data by. Set to
null to ignore.
lotNo
Holds the lot number to filter the job even data by. Set to an
empty string to ignore.
Return Value

Returns a DataSet containing a row for each job event that


matches the filter.

Exceptions

An exception is thrown if an error occurs while retrieving


the data.

GetJobExecData() Method
The GetJobExecData() method gets all information for the
specified job position on the entity supplied. This method is
used to retrieve job exec information when there is no current
entity and/or the job is not running. An entity contains a job
exec object for each job position. Job based login uses this to
read the SuppressStartSomeQtyPrompt, AllowZeroQtySplit,
and AutoAllocateQtyToRunningJob flags.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobExecData( _
ByVal ent_id As Integer,

ByVal job_pos As Integer _


) As DataSet

[C#]

public static DataSet GetJobExecData(

Wonderware Factelligence Client API Reference Guide

260

Chapter 4 API Classes

int ent_id,
int job_pos
)

[C++]
public:
static DataSet GetJobExecData(
int ent_id,
int job_pos
)

[J#]
public static DataSet GetJobExecData(
int ent_id,
int job_pos
)

[JScript]
public static

function GetJobExecData(

ent_id : int,
job_pos : int
) : DataSet

Parameters

ent_id
Holds an entity, for which job exec data for a job position is
retrieved.
job_pos
Holds a position of the job, for which job exec data is
retrieved.
Return Value

Returns a DataSet containing the job exec data for the job
position on the entity supplied.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetJobAttrs() Method (String, String, Int32)(Jobs


Class)
The GetJobAttrs() method retrieves all defined job attributes
for the specified job from the database.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobAttrs( _
ByVal woId As String,

Wonderware Factelligence Client API Reference Guide

Jobs Class

ByVal operId As String,

261

ByVal seqNo As Integer _


) As DataSet

[C#]

public static DataSet GetJobAttrs(


string woId,
string operId,
int seqNo
)

[C++]
public:
static DataSet GetJobAttrs(
String woId,
String operId,
int seqNo
)

[J#]
public static DataSet GetJobAttrs(
string woId,
string operId,
int seqNo
)

[JScript]
public static

function GetJobAttrs(

woId : String,
operId : String,
seqNo : int
) : DataSet

Parameters

woId
Holds the work order identifying the job attributes for the
job retrieved.
operId
Holds the operation identifying the job attributes for the job
retrieved.
seqNo
Holds the sequence number identifying the job attributes
for the job retrieved.
Return Value

Returns a DataSet containing 0 or more rows from each


defined attribute for this job.

Wonderware Factelligence Client API Reference Guide

262

Chapter 4 API Classes

Exceptions

An exception is thrown if an error occurs while updating the


database.

GetJobAttrs() Method (String, String, Int32,


Int32)(Jobs Class)
The GetJobAttrs method retrieves the specified job attribute.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobAttrs( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal attrId As Integer _


) As DataRow

[C#]

public static DataRow GetJobAttrs(


string woId,
string operId,
int seqNo,
int attrId
)

[C++]
public:
static DataRow GetJobAttrs(
String woId,
String operId,
int seqNo,
int attrId
)

[J#]
public static DataRow GetJobAttrs(
string woId,
string operId,
int seqNo,
int attrId
)

[JScript]
public static

function GetJobAttrs(

woId : String,

Wonderware Factelligence Client API Reference Guide

Jobs Class

263

operId : String,
seqNo : int,
attrId : int
) : DataRow

Parameters

woId
Holds the work order identifying the job attributes for the
job retrieved.
operId
Holds the operation identifying the job attributes for the job
retrieved.
seqNo
Holds the sequence number identifying the job attributes
for the job retrieved.
attrId
Holds the attribute ID of the attribute that is requested for
this job.
Return Value
Returns a DataRow containing the specified job attribute's
data if it exists, else null.
Exceptions

An exception is thrown if an error occurs while updating the


database.

GetJobBomAvailSubst() Method (Jobs Class)


The GetJobBomAvailSubst() method returns a DataView
containing all available substitute items for consumption.
Available substitutes items are defined as those items which
are the intersection of the substitutes for the current job, and
the union of the substitutes of all the upstream jobs that
produce the same item as the current one at the job's BOM
position 0.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobBomAvailSubst( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer _


) As DataView

[C#]

public static DataView GetJobBomAvailSubst(


string woId,

Wonderware Factelligence Client API Reference Guide

264

Chapter 4 API Classes

string operId,
int seqNo
)

[C++]
public:
static DataView GetJobBomAvailSubst(
String woId,
String operId,
int seqNo
)

[J#]
public static DataView GetJobBomAvailSubst(
string woId,
string operId,
int seqNo
)

[JScript]
public static

function GetJobBomAvailSubst(

woId : String,
operId : String,
seqNo : int
) : DataView

Parameters

woId
Holds the work order ID of the job for retrieving substitute
items.
operId
Holds the operation ID of the job for retrieving substitute
items.
seqNo
Holds the sequence number of the job for retrieving
substitute items.
Return Value

Returns a dataview of all available substitutes items for


consumption.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

Wonderware Factelligence Client API Reference Guide

Jobs Class

265

GetJobBOMData() Method
The GetJobBOMData() method gets the BOM data for the
specified job. A job is specified by a work order ID, an
operation ID, and an operation sequence number. If a BOM
position is specified, only the BOM data for that item is
returned.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobBOMData( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal BOMPos As Object _


) As DataSet

[C#]

public static DataSet GetJobBOMData(


string woId,
string operId,
int seqNo,
object BOMPos
)

[C++]
public:
static DataSet GetJobBOMData(
String woId,
String operId,
int seqNo,
Object BOMPos
)

[J#]
public static DataSet GetJobBOMData(
string woId,
string operId,
int seqNo,
object BOMPos
)

[JScript]
public static

function GetJobBOMData(

woId : String,
operId : String,
seqNo : int,

Wonderware Factelligence Client API Reference Guide

266

Chapter 4 API Classes

BOMPos : Object
) : DataSet

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
BOMPos
Optionally holds the position in the BOM for an individual
item. Set to null if not used in which case all BOM data for
the job is returned.
Return Value

Returns a DataSet containing the BOM records.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobBOMProducibles() Method (Jobs Class)


The GetJobBOMProducibles method returns a DataView
containing all the items that can be produced at the specified
operation. The producible items are the items produced at
BOM position 0 and any of its substitutes along with all by
products and their substitutes. If a substitute is being
produced, the column current_subst in the returned dataview
contains an integer value identifying which alternative item
is being produced. Otherwise, the current_subst column
contains a null.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobBOMProducibles( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal BOMPos As Object _


) As DataView

[C#]

public static DataView GetJobBOMProducibles(


string woId,
string operId,
int seqNo,

Wonderware Factelligence Client API Reference Guide

Jobs Class

267

object BOMPos
)

[C++]
public:
static DataView GetJobBOMProducibles(
String woId,
String operId,
int seqNo,
Object BOMPos
)

[J#]
public static DataView GetJobBOMProducibles(
string woId,
string operId,
int seqNo,
object BOMPos
)

[JScript]
public static

function GetJobBOMProducibles(

woId : String,
operId : String,
seqNo : int,
BOMPos : Object
) : DataView

Parameters

woId
Holds the work order ID.
operId
Holds the operation ID.
seqNo
Holds the operation sequence number.
BOMPos
Holds an optional BOM position. If all BOM positions are to
be returned, set this parameter to null.
Return Value

Returns a data view containing rows for all the producible


items. A data view is used because the middleware returns
consumables as well as producibles, so the consumables are
filtered out in the DataView and the rows are sorted by job
position and preference.

Wonderware Factelligence Client API Reference Guide

268

Chapter 4 API Classes

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobBomSubst() Method (Jobs Class)


The GetJobBomSubst method returns a DataView containing
all substitute items for a job at the BOM position specified.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobBomSubst( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal bom_pos As Integer _


) As DataView

[C#]

public static DataView GetJobBomSubst(


string woId,
string operId,
int seqNo,
int bom_pos
)

[C++]
public:
static DataView GetJobBomSubst(
String woId,
String operId,
int seqNo,
int bom_pos
)

[J#]
public static DataView GetJobBomSubst(
string woId,
string operId,
int seqNo,
int bom_pos
)

[JScript]
public static

function GetJobBomSubst(

woId : String,
operId : String,

Wonderware Factelligence Client API Reference Guide

Jobs Class

269

seqNo : int,
bom_pos : int
) : DataView

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobBomSubstitutesForSerializedItem()
Method
The GetJobBomSubstitutesForSerializedItem() method returns
a dataview containing serialized item substitutes for all of
the consumable BOM items of the specified job. A dataview is
used in order to filter the data to contain records in which the
item of the job is a serialized item.
Syntax

[Visual Basic (Declaration)]


Public Shared Function
GetJobBomSubstitutesForSerializedItem( _
ByVal woId As String,

ByVal operId As String,

ByVal itemId As String _


) As DataView

[C#]

public static DataView


GetJobBomSubstitutesForSerializedItem(
string woId,
string operId,
string itemId
)

[C++]
public:
static DataView GetJobBomSubstitutesForSerializedItem(
String woId,
String operId,
String itemId
)

[J#]
public static DataView
GetJobBomSubstitutesForSerializedItem(
string woId,
string operId,
string itemId

Wonderware Factelligence Client API Reference Guide

270

Chapter 4 API Classes

[JScript]
public static function
GetJobBomSubstitutesForSerializedItem(
woId : String,
operId : String,
itemId : String
) : DataView

Parameters

woId
Holds the work order ID of the job that retrieves substitute
items.
operId
Holds the operation ID of the job that retrieves substitute
items.
itemId
Holds the item ID of the job that retrieves substitute items.
Return Value

Returns a dataview contain BOM records for all substitutes


items of the specified job that are serialized items.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobBOMWithSubData() Method (Jobs Class)


The GetJobBOMWithSubData method gets BOM data
including substitute info for the specified job. A job is
specified by a work order ID, an operation ID, and an
operation sequence number. If a BOM position is specified,
only the BOM data and BOM substitute data for that item
are returned. Caller must catch any exception if this call
fails.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobBOMWithSubData( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal BOMPos As Object _


) As DataSet

[C#]

public static DataSet GetJobBOMWithSubData(

Wonderware Factelligence Client API Reference Guide

Jobs Class

271

string woId,
string operId,
int seqNo,
object BOMPos
)

[C++]
public:
static DataSet GetJobBOMWithSubData(
String woId,
String operId,
int seqNo,
Object BOMPos
)

[J#]
public static DataSet GetJobBOMWithSubData(
string woId,
string operId,
int seqNo,
object BOMPos
)

[JScript]
public static

function GetJobBOMWithSubData(

woId : String,
operId : String,
seqNo : int,
BOMPos : Object
) : DataSet

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
BOMPos
Optionally holds the position in the BOM for an individual
item. Set to null if not used.
Return Value

Returns a DataSet containing the BOM records.

Wonderware Factelligence Client API Reference Guide

272

Chapter 4 API Classes

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobEvents() Method
The GetJobEvents() method returns a DataSet containing all
job event data for the specified job. Job events include things
such as, a certification signoff, adding production, adding
consumption, reclassifying production, reclassifying
consumption, completing a step, changing job specifications,
and changing a job state. The data can be optionally filter by
step number and/or lot number.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobEvents( _
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

ByVal stepNo As Object,

ByVal lotNo As String _


) As DataSet

[C#]

public static DataSet GetJobEvents(


string woID,
string operID,
int seqNo,
object stepNo,
string lotNo
)

[C++]
public:
static DataSet GetJobEvents(
String woID,
String operID,
int seqNo,
Object stepNo,
String lotNo
)

[J#]
public static DataSet GetJobEvents(
string woID,
string operID,

Wonderware Factelligence Client API Reference Guide

Jobs Class

273

int seqNo,
object stepNo,
string lotNo
)

[JScript]
public static

function GetJobEvents(

woID : String,
operID : String,
seqNo : int,
stepNo : Object,
lotNo : String
) : DataSet

Parameters

woID
Holds the work order ID of the job, for which you want to
retrieve the job event data.
operID
Holds the operation ID of the job, for which you want to
retrieve the job event data.
seqNo
Holds the operation sequence number, for which you want
to retrieve the job event data.
stepNo
Holds the step number to filter the job event data by. Set to
null to ignore.
lotNo
Holds the lot number to filter the job even data by. Set to an
empty string to ignore.
Return Value

Returns a DataSet containing a row for each job event that


matches the filter.

Exceptions

An exception is thrown if an error occurs while retrieving


the data.

GetJobQueue() Method
The GetJobQueue() method returns the queued jobs for the
specified work order. Further filter the queue list by an item
ID if one is supplied.
Syntax
[Visual Basic (Declaration)]
Public Shared Function GetJobQueue( _

Wonderware Factelligence Client API Reference Guide

274

Chapter 4 API Classes

ByVal woID As String,

ByVal itemID As String _


) As DataSet

[C#]

public static DataSet GetJobQueue(


string woID,
string itemID
)

[C++]
public:
static DataSet GetJobQueue(
String woID,
String itemID
)

[J#]
public static DataSet GetJobQueue(
string woID,
string itemID
)

[JScript]
public static

function GetJobQueue(

woID : String,
itemID : String
) : DataSet

Parameters

woID
Holds the work order for which all jobs of the routing are
presented.
itemID
Holds the item ID for further filter job records that are
presented.
Return Value

Returns a DataSet with all jobs of the work order routing.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobsByWo() Method
The GetJobsByWo() method returns a DataSet of all job
information for jobs related to the supplied work order.

Wonderware Factelligence Client API Reference Guide

Jobs Class

275

Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobsByWo( _
ByVal woId As String _
) As DataSet

[C#]

public static DataSet GetJobsByWo(


string woId
)

[C++]
public:
static DataSet GetJobsByWo(
String woId
)

[J#]
public static DataSet GetJobsByWo(
string woId
)

[JScript]
public static

function GetJobsByWo(

woId : String
) : DataSet

Parameter

woId
Holds the work order ID.
Return Value

Returns a DataSet containing the jobs related to the work


order.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetJobStateData() Method
The GetJobStateData() method returns a DataSet of all the
Job State data (descriptions and colors) from the database.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetJobStateData() As DataSet

[C#]

public static DataSet GetJobStateData()

[C++]

Wonderware Factelligence Client API Reference Guide

276

Chapter 4 API Classes

public:
static DataSet GetJobStateData()

[J#]

public static DataSet GetJobStateData()

[JScript]

public static

function GetJobStateData() : DataSet

Return Value

Returns a DataSet containing a row for each Job State.

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

GetNextWOId() Method
The GetNextWoId() method returns the next available work
order ID assuming they are automatically generated.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetNextWOId() As String

[C#]

public static string GetNextWOId()

[C++]

public:
static String GetNextWOId()

[J#]

public static string GetNextWOId()

[JScript]

public static

function GetNextWOId() : String

Return Value

Returns a string representing the next available work order


number. Returns an empty string if an error occurs or the
work order IDs are not automatically generated.

GetQueue() Method
The GetQueue() method returns a DataSet containing the job
queue for the specified entity. The filter fields are only
applied if they are NOT = null, so pass nulls to bypass any
filtering. Pass the data set to populate by reference so the
existing instance can continually be refreshed. An exception
is thrown if the call fails.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetQueue( _

Wonderware Factelligence Client API Reference Guide

Jobs Class

ByVal entId As Integer,

277

ByVal jobStateFilter As Integer,


ByVal reqdByFilter As Date,

ByVal jobPriorityFilter As Integer,

ByVal maxRows As Integer _


) As DataSet

[C#]

public static DataSet GetQueue(


int entId,
int jobStateFilter,
DateTime reqdByFilter,
int jobPriorityFilter,
int maxRows
)

[C++]
public:
static DataSet GetQueue(
int entId,
int jobStateFilter,
DateTime reqdByFilter,
int jobPriorityFilter,
int maxRows
)

[J#]
public static DataSet GetQueue(
int entId,
int jobStateFilter,
DateTime reqdByFilter,
int jobPriorityFilter,
int maxRows
)

[JScript]
public static

function GetQueue(

entId : int,
jobStateFilter : int,
reqdByFilter : DateTime,
jobPriorityFilter : int,
maxRows : int
) : DataSet

Wonderware Factelligence Client API Reference Guide

278

Chapter 4 API Classes

Parameters

entId
Holds the ID of the entity for which to retrieve the queue.
jobStateFilter
Holds the job state filter to only retrieve jobs queued that
are in the current job state.
reqdByFilter
Holds the required by filter to only retrieve jobs that are
required by a certain date/time.
jobPriorityFilter
Holds the job priority filter to only retrieve jobs that are of a
particular job priority.
maxRows
Holds the maximum number of rows to return.
Return Value

Returns a DataSet containing a row for every job in the


queue matching the filter specifications.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetScheduledJobForWo() Method
The GetScheduledJobForWo() method returns the first job
sequence for the work order, operation specified which is the
scheduled job.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetScheduledJobForWo( _
ByVal woId As String,

ByVal operId As String _


) As DataRow

[C#]

public static DataRow GetScheduledJobForWo(


string woId,
string operId
)

[C++]
public:
static DataRow GetScheduledJobForWo(
String woId,
String operId
)

Wonderware Factelligence Client API Reference Guide

Jobs Class

279

[J#]
public static DataRow GetScheduledJobForWo(
string woId,
string operId
)

[JScript]
public static

function GetScheduledJobForWo(

woId : String,
operId : String
) : DataRow

Parameters

woId
Holds the work order, for which first job sequence is
retrieved.
operId
Holds the operation, for which first job sequence is
retrieved.
Return Value

Returns a Datarow contain the job information of the first


job in the sequence for the work order.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetStartQtyOfItemInWO() Method
The GetStartQtyOfItemInWO method gets the start quantity of
the specified item in the specified work order.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetStartQtyOfItemInWO( _
ByVal _item_id As String,
ByVal _wo_id As String,

ByVal _oper_id As String _


) As Integer

[C#]

public static int GetStartQtyOfItemInWO(


string _item_id,
string _wo_id,
string _oper_id
)

[C++]

Wonderware Factelligence Client API Reference Guide

280

Chapter 4 API Classes

public:
static int GetStartQtyOfItemInWO(
String _item_id,
String _wo_id,
String _oper_id
)

[J#]
public static int GetStartQtyOfItemInWO(
string _item_id,
string _wo_id,
string _oper_id
)

[JScript]
public static

function GetStartQtyOfItemInWO(

_item_id : String,
_wo_id : String,
_oper_id : String
) : int

Parameters

_item_id
Holds the item whose start quantity is to retrieve. Set to
null if not used.
_wo_id
Holds the work order that produces this item. Set to null if
not used.
_oper_id
Holds the operation ID of the job that contains the start
quantity being retrieved. Set to null if not used.
Return Value

Returns an integer value equal to the start quantity of the


item for the work order.

Exceptions

An exception is thrown if an error occurs while updating the


database.

GetWO() Method
The GetWO() method returns a DataSet containing the work
order data for the specified work order from the database.
This data includes the description of the work order, the ID
of the process that this work order uses, and the item ID of
the item this work order produces.

Wonderware Factelligence Client API Reference Guide

Jobs Class

281

Syntax

[Visual Basic (Declaration)]


Public Shared Function GetWO( _
ByVal woId As String _
) As DataRow

[C#]

public static DataRow GetWO(


string woId
)

[C++]
public:
static DataRow GetWO(
String woId
)

[J#]
public static DataRow GetWO(
string woId
)

[JScript]
public static

function GetWO(

woId : String
) : DataRow

Parameter

woId
Holds the work order ID.
Return Value

Returns a DataSet containing the work order information.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetWoForSerializedItems() Method
The GetWoForSerializedItems() method gets all work orders
which produce serialized items. Optional work order and
item filters can be used to retrieve only the work order data
for that work order and/or item.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetWoForSerializedItems( _
ByVal woId As String,

ByVal itemId As String _

Wonderware Factelligence Client API Reference Guide

282

Chapter 4 API Classes

) As DataSet

[C#]

public static DataSet GetWoForSerializedItems(


string woId,
string itemId
)

[C++]
public:
static DataSet GetWoForSerializedItems(
String woId,
String itemId
)

[J#]
public static DataSet GetWoForSerializedItems(
string woId,
string itemId
)

[JScript]
public static

function GetWoForSerializedItems(

woId : String,
itemId : String
) : DataSet

Parameters

woId
Holds the work order to retrieve information, to see if it
produces a serialized item. Set to null if not used.
itemId
Holds the item ID to filter DataSet to retrieve only work
orders that produce this serialized item. Set to null if not
used.
Return Value

Returns a DataSet containing all work orders which


produce a serialized item. Filtered further by a work order
and/or item if one is provided.

GetWORouteData() Method
The GetWORouteData method gets all job routes related to the
supplied work order.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetWORouteData( _

Wonderware Factelligence Client API Reference Guide

Jobs Class

283

ByVal woId As String _


) As DataSet

[C#]

public static DataSet GetWORouteData(


string woId
)

[C++]
public:
static DataSet GetWORouteData(
String woId
)

[J#]
public static DataSet GetWORouteData(
string woId
)

[JScript]
public static

function GetWORouteData(

woId : String
) : DataSet

Parameter

woId
Holds the work order ID to which job routes is related.
Return Value

Returns a DataSet containing the job routes for the work


order.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

IsFirstJob() Method
The IsFirstJob() method returns true if the operation specified
is the first job of the work order. False if it is not. If no work
order, operation, or item ID is supplied, then a true is
returned if any of the operations of the job are for a first job.
Syntax

[Visual Basic (Declaration)]


Public Shared Function IsFirstJob( _
ByVal woId As String,

ByVal operId As String,

ByVal itemId As String _


) As Boolean

Wonderware Factelligence Client API Reference Guide

284

Chapter 4 API Classes

[C#]
public static bool IsFirstJob(
string woId,
string operId,
string itemId
)

[C++]
public:
static bool IsFirstJob(
String woId,
String operId,
String itemId
)

[J#]
public static bool IsFirstJob(
string woId,
string operId,
string itemId
)

[JScript]
public static

function IsFirstJob(

woId : String,
operId : String,
itemId : String
) : bool

Parameters

woId
Holds the work order ID of the job whose first job flag is
checked. Set to null if not used.
operId
Holds the operation ID of the job whose first job flag is
checked. Set to null if not used.
itemId
Holds the item ID of the job whose first job flag is checked.
Set to null if not used.
Return Value

Returns a boolean value indicating whether the specified


operation is the first job of the work order.

Wonderware Factelligence Client API Reference Guide

Jobs Class

285

ItemConsSplit() Method
The ItemConsSplit method splits the specified amount of
consumption off the specified row in the Item_Cons table and
reallocates it to the new job if one is specified. This may
result in a new row, or it may result in the increase of
consumption quantity in another row.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub ItemConsSplit( _
ByVal oldRowID As Long,

ByVal splitQtyCons As Double,


ByVal newWOID As String,

ByVal newOperID As String,


ByVal newSeqNo As Object,

_
_

ByVal newShiftStart As Object,


ByVal newItemID As String,
ByVal newLotNo As String,

_
_

ByVal newFGLotNo As String,

ByVal newReasCd As Object,

ByVal newUserID As String,

ByVal newEntID As Object,

ByVal newShiftID As Object,

ByVal newFromEntID As Object,

ByVal splitQtyConsERP As Object _


)

[C#]
public static void ItemConsSplit(
long oldRowID,
double splitQtyCons,
string newWOID,
string newOperID,
object newSeqNo,
object newShiftStart,
string newItemID,
string newLotNo,
string newFGLotNo,
object newReasCd,
string newUserID,
object newEntID,
object newShiftID,
object newFromEntID,

Wonderware Factelligence Client API Reference Guide

286

Chapter 4 API Classes

object splitQtyConsERP
)

[C++]
public:
static void ItemConsSplit(
__int64 oldRowID,
double splitQtyCons,
String newWOID,
String newOperID,
Object newSeqNo,
Object newShiftStart,
String newItemID,
String newLotNo,
String newFGLotNo,
Object newReasCd,
String newUserID,
Object newEntID,
Object newShiftID,
Object newFromEntID,
Object splitQtyConsERP
)

[J#]
public static void ItemConsSplit(
long oldRowID,
double splitQtyCons,
string newWOID,
string newOperID,
object newSeqNo,
object newShiftStart,
string newItemID,
string newLotNo,
string newFGLotNo,
object newReasCd,
string newUserID,
object newEntID,
object newShiftID,
object newFromEntID,
object splitQtyConsERP
)

[JScript]
public static

function ItemConsSplit(

Wonderware Factelligence Client API Reference Guide

Jobs Class

287

oldRowID : long,
splitQtyCons : double,
newWOID : String,
newOperID : String,
newSeqNo : Object,
newShiftStart : Object,
newItemID : String,
newLotNo : String,
newFGLotNo : String,
newReasCd : Object,
newUserID : String,
newEntID : Object,
newShiftID : Object,
newFromEntID : Object,
splitQtyConsERP : Object
)

Parameters

oldRowID
Specifies the row to split.
splitQtyCons
Specifies the amount of consumption to split off of the
quantity of the row.
newWOID
Holds an optional new work order ID to specify a job to split
consumption amount. Set to null if not used.
newOperID
Holds an optional new operation ID to specify a job to split
consumption amount. Set to null if not used.
newSeqNo
Holds an optional new operation sequence number to
specify a job to split consumption amount. Set to null if not
used.
newShiftStart
Holds an optional new shift start time for the item cons
record created from split. Set to null if not used.
newItemID
Holds an optional new item ID for the new item cons record
created from split. Set to null if not used.
newLotNo
Holds an optional new lot number for the new item cons
record created from split. Set to null if not used.

Wonderware Factelligence Client API Reference Guide

288

Chapter 4 API Classes

newFGLotNo
Holds an optional new finished goods lot number for the
new item cons record created from split. Set to null if not
used.
newReasCd
Holds an optional new reason code for the new item cons
record created from split. Set to null if not used.
newUserID
Holds an optional new user ID for the new item cons record
created from split. Set to nulL if not used.
newEntID
Holds an optional new entity ID on which the split
occurred. Set to null if not used.
newShiftID
Holds an optional new shift ID for the new item cons record
created from split. Set to null if not used.
newFromEntID
Holds an optional new storage entity ID for the new item
cons record created from split. Set to null if not used.
splitQtyConsERP
Holds the amount of split quantity reported to ERP.
Exceptions

An exception is thrown if the consumption split fails.

JobStateDesc() Method
The JobStateDesc() method returns the job state description
for the job state specified.
Syntax

[Visual Basic (Declaration)]


Public Shared Function JobStateDesc( _
ByVal jobState As JobStates _
) As String

[C#]

public static string JobStateDesc(


JobStates jobState
)

[C++]
public:
static String JobStateDesc(
JobStates jobState
)

[J#]

Wonderware Factelligence Client API Reference Guide

Jobs Class

289

public static string JobStateDesc(


JobStates jobState
)

[JScript]
public static

function JobStateDesc(

jobState : JobStates
) : String

Parameter

jobState
Holds the job state in which the job state description is
retrieved and returned.
Return Value

Returns the job description string for the job state specified.

PopupCreateJobDialog() Method
The PopupCreateJobDialog() method opens a dialog to select
an item shortage on the specified entity for creating a work
order. It opens the form used to create an item for creating
the work order.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupCreateJobDialog( _
ByVal entID As Integer _
) As Boolean

[C#]

public static bool PopupCreateJobDialog(


int entID
)

[C++]
public:
static bool PopupCreateJobDialog(
int entID
)

[J#]
public static bool PopupCreateJobDialog(
int entID
)

[JScript]
public static

function PopupCreateJobDialog(

entID : int
) : bool

Wonderware Factelligence Client API Reference Guide

290

Chapter 4 API Classes

Parameter

entID
Holds the entity on which to create the job.
Return Value

Returns true if a job is created or false if it is not.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

PopupJobBOMDlg() Method
The PopupJobBOMDlg() method opens a dialog to show the
BOM components for the specified job. The dialog is read only
and contains a grid showing the information for each BOM
component of the job. A job is specified by a work order ID, an
operation ID, and an operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupJobBOMDlg( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal jobDesc As String _


)

[C#]
public static void PopupJobBOMDlg(
string woId,
string operId,
int seqNo,
string jobDesc
)

[C++]
public:
static void PopupJobBOMDlg(
String woId,
String operId,
int seqNo,
String jobDesc
)

[J#]
public static void PopupJobBOMDlg(
string woId,

Wonderware Factelligence Client API Reference Guide

Jobs Class

291

string operId,
int seqNo,
string jobDesc
)

[JScript]
public static

function PopupJobBOMDlg(

woId : String,
operId : String,
seqNo : int,
jobDesc : String
)

Parameters

woId
Holds the jobs work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
jobDesc
Holds the jobs description.
Return Value

No return value.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

PopupJobEventDlg() Method (Jobs Class)


The PopupJobEventDlg() method opens the Job Event dialog
for the specified job. A job is specified by a work order ID, an
operation ID, and an operation sequence number. The Job
Event dialog lists all job events recorded for the specified job
and allows the user to edit the values recorded for the event.
Events include things such as, a certification signoff, adding
production, adding consumption, reclassifying production,
reclassifying consumption, completing a step, changing a job
specification, and changing a job state.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupJobEventDlg( _
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

Wonderware Factelligence Client API Reference Guide

292

Chapter 4 API Classes

ByVal lotNo As String,


ByVal user As User,

ByVal stepNo As Integer,


ByVal entID As Integer,

_
_

ByVal jobPos As Integer _


) As Boolean

[C#]

public static bool PopupJobEventDlg(


string woID,
string operID,
int seqNo,
string lotNo,
User user,
int stepNo,
int entID,
int jobPos
)

[C++]
public:
static bool PopupJobEventDlg(
String woID,
String operID,
int seqNo,
String lotNo,
User user,
int stepNo,
int entID,
int jobPos
)

[J#]
public static bool PopupJobEventDlg(
string woID,
string operID,
int seqNo,
string lotNo,
User user,
int stepNo,
int entID,
int jobPos
)

[JScript]

Wonderware Factelligence Client API Reference Guide

Jobs Class

public static

293

function PopupJobEventDlg(

woID : String,
operID : String,
seqNo : int,
lotNo : String,
user : User,
stepNo : int,
entID : int,
jobPos : int
) : bool

Parameters

woID
Holds the job's work order ID.
operID
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
lotNo
Holds the lot number for the item currently produced.
jobPos
The job position on the current entity at which the current
job is running. The job event being popped up is for the job
running at this job position.
user
Holds the name of the current user.
stepNo
Holds the number of the current step.
entID
Holds the ID of the entity.

PopupJobSplitDlg
The PopupJobSplit() method opens the job split dialog to split
the specified quantity of the job into a new job. The dialog
allows for the entity that the new job should be queued to be
selected. Also, the quantity of the current job that is to be
split off to the new job is specified. The new job is then
created, queued to the specified entity with a start quantity
equal to the quantity specified. The amount split to the new
job is subtracted from the start quantity of the job that is
being split from.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

294

Chapter 4 API Classes

Public Shared Function PopupJobSplitDlg( _


ByVal title As String,
ByVal woId As String,

_
_

ByVal operId As String,

ByVal seqNo As Integer,

ByVal reqdQty As Double,

ByVal prodQty As Double,

ByVal processId As String _


) As Boolean

[C#]

public static bool PopupJobSplitDlg(


string title,
string woId,
string operId,
int seqNo,
double reqdQty,
double prodQty,
string processId
)

[C++]
public:
static bool PopupJobSplitDlg(
String title,
String woId,
String operId,
int seqNo,
double reqdQty,
double prodQty,
String processId
)

[J#]
public static bool PopupJobSplitDlg(
string title,
string woId,
string operId,
int seqNo,
double reqdQty,
double prodQty,
string processId
)

[JScript]

Wonderware Factelligence Client API Reference Guide

Jobs Class

public static

295

function PopupJobSplitDlg(

title : String,
woId : String,
operId : String,
seqNo : int,
reqdQty : double,
prodQty : double,
processId : String
) : bool

Parameters

title
Holds the title for the Split Job dialog.
woId
Holds the work order ID identifying the job to be split.
operId
Holds the operation ID identifying the job to be split.
seqNo
Holds the operation sequence number identifying the job to
be split.
reqdQty
Holds the required quantity of the job to be split. Split jobs
cannot increase this total.
prodQty
Holds the good quantity already produced by the job to be
split. This quantity cannot be split.
processId
Holds the process ID of the job to be split. This is required
to determine possible target entities for the split job.
Return Value

Returns true if the job was split successfully.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.start quantity equal to the quantity
specified. The amount split to the new job is subtracted
from the start quantity of the job that is being split from.

PopupSelectPausedStateDlg() Method
The PopupSelectPausesStateDlg() method opens the dialog for
selecting which paused state to put the job in. The three
paused states are Suspended, OnHold and New.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

296

Chapter 4 API Classes

Public Shared Function PopupSelectPausedStateDlg( _


ByRef newJobState As JobStates,

ByRef newJobStateDesc As String _


) As Boolean

[C#]

public static bool PopupSelectPausedStateDlg(


ref JobStates newJobState,
ref string newJobStateDesc
)

[C++]
public:
static bool PopupSelectPausedStateDlg(
JobStates% newJobState,
String% newJobStateDesc
)

[J#]
public static bool PopupSelectPausedStateDlg(
JobStates newJobState,
string newJobStateDesc
)

[JScript]
public static

function PopupSelectPausedStateDlg(

newJobState : JobStates,
newJobStateDesc : String
) : bool

Parameters

newJobState
Holds the paused state that is selected to be the new job
state of the job.
newJobStateDesc
Holds the description of the job state that is selected to be
the new paused job state of the job.
Return Value

Returns true if a paused state is selected from the dialog.


Returns false if the dialog is cancelled without selecting a
paused state.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

Wonderware Factelligence Client API Reference Guide

Jobs Class

297

PopupStartSomeDlg() Method (String, Int32,


String, String, Int32, Double, Double, Double,
Double)
The PopupStartSomeDlg() method opens the start some dialog
to split the specified job and start the new job on the entity
specified. The Start some dialog allows the user to specify the
start quantity of the new job created by the split and the
required quantity. The start quantity cannot exceed the
quantity available to split from the specified job. A new job is
the created with the quantity that is split from the specified
job, and the new job is started on the specified entity. The
start quantity split to the new job is subtracted from the
quantity left to produce of the specified job.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupStartSomeDlg( _
ByVal title As String,

ByVal entId As Integer,


ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal batchSize As Double,


ByVal startQty As Double,
ByVal reqdQty As Double,

_
_

ByVal prodQty As Double _


) As Boolean

[C#]

public static bool PopupStartSomeDlg(


string title,
int entId,
string woId,
string operId,
int seqNo,
double batchSize,
double startQty,
double reqdQty,
double prodQty
)

[C++]
public:
static bool PopupStartSomeDlg(

Wonderware Factelligence Client API Reference Guide

298

Chapter 4 API Classes

String title,
int entId,
String woId,
String operId,
int seqNo,
double batchSize,
double startQty,
double reqdQty,
double prodQty
)

[J#]
public static bool PopupStartSomeDlg(
string title,
int entId,
string woId,
string operId,
int seqNo,
double batchSize,
double startQty,
double reqdQty,
double prodQty
)

[JScript]
public static

function PopupStartSomeDlg(

title : String,
entId : int,
woId : String,
operId : String,
seqNo : int,
batchSize : double,
startQty : double,
reqdQty : double,
prodQty : double
) : bool

Parameters

title
Holds the title of the Start Some dialog.
entId
Holds the ID of the entity that the split job is to be started
on.

Wonderware Factelligence Client API Reference Guide

Jobs Class

299

woId
Holds the work order ID identifying the job to split.
operId
Holds the operation ID identifying the job to split.
seqNo
Holds the operation sequence number identifying the job to
split.
batchSize
Holds the batch size of the job to split.
startQty
Holds the start quantity of the job to split. The new job
cannot have a start quantity larger then this.
reqdQty
Holds the required quantity of the job to split. Split jobs
cannot increase this total.
prodQty
Holds the good quantity already produced by the job to
split. This quantity cannot be split.
Return Value

Returns true if some of the job was started successfully.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

PopupStartSomeDlg() Method (String, String,


String, Int32, Double, Double, Double, Double)
The PopupStartSomeDlg() method opens the start some dialog
to split the specified job and start the new job on the current
entity. The Start some dialog allows the user to specify the
start quantity of the new job created by the split and the
required quantity. The start quantity cannot exceed the
quantity available to split from the specified job. A new job is
the created with the quantity that is split from the specified
job, and the new job is started on the current entity that the
user is working on. The start quantity split to the new job is
subtracted from the quantity left to produce of the specified
job.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupStartSomeDlg( _
ByVal title As String,
ByVal woId As String,

_
_

ByVal operId As String,

Wonderware Factelligence Client API Reference Guide

300

Chapter 4 API Classes

ByVal seqNo As Integer,

ByVal batchSize As Double,


ByVal startQty As Double,
ByVal reqdQty As Double,

_
_

ByVal prodQty As Double _


) As Boolean

[C#]

public static bool PopupStartSomeDlg(


string title,
string woId,
string operId,
int seqNo,
double batchSize,
double startQty,
double reqdQty,
double prodQty
)

[C++]
public:
static bool PopupStartSomeDlg(
String title,
String woId,
String operId,
int seqNo,
double batchSize,
double startQty,
double reqdQty,
double prodQty
)

[J#]
public static bool PopupStartSomeDlg(
string title,
string woId,
string operId,
int seqNo,
double batchSize,
double startQty,
double reqdQty,
double prodQty
)

[JScript]

Wonderware Factelligence Client API Reference Guide

Jobs Class

public static

301

function PopupStartSomeDlg(

title : String,
woId : String,
operId : String,
seqNo : int,
batchSize : double,
startQty : double,
reqdQty : double,
prodQty : double
) : bool

Parameters

title
Holds the title of the Start Some dialog
woId
Holds the work order ID to identify the job to split.
operId
Holds the operation ID to identify the job to split.
seqNo
Holds the operation sequence number to identify the job to
split.
batchSize
Holds the batch size of the job to split.
startQty
Holds the start quantity of the job to split. The new job
cannot have a start quantity larger then this.
reqdQty
Holds the required quantity of the job to split. Split jobs
cannot increase this total.
prodQty
Holds the good quantity already produced by the job to
split. This quantity cannot be split.
Return Value

Returns true if some of the job was started successfully.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

Wonderware Factelligence Client API Reference Guide

302

Chapter 4 API Classes

SetJobConcurrentLink() Method
The SetJobConcurrentLink method updates the current link
value for the specified job which is the value that links this
job to other jobs in a batch. Jobs in a batch are processed
together as a whole. If the concurrent link value is less than
or equal to zero, the job is not part of a batch.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetJobConcurrentLink( _
ByVal WoId As String,

ByVal OperId As String,

ByVal SeqNo As Integer,

ByVal ConcurrentLink As Integer,

ByVal editTime As String _


)

[C#]
public static void SetJobConcurrentLink(
string WoId,
string OperId,
int SeqNo,
int ConcurrentLink,
string editTime
)

[C++]
public:
static void SetJobConcurrentLink(
String WoId,
String OperId,
int SeqNo,
int ConcurrentLink,
String editTime
)

[J#]
public static void SetJobConcurrentLink(
string WoId,
string OperId,
int SeqNo,
int ConcurrentLink,
string editTime
)

[JScript]

Wonderware Factelligence Client API Reference Guide

Jobs Class

public static

303

function SetJobConcurrentLink(

WoId : String,
OperId : String,
SeqNo : int,
ConcurrentLink : int,
editTime : String
)

Parameters

WoId
Holds the work order ID of the job whose concurrent link
value is to be updated.
OperId
Holds the operation ID of the job whose concurrent link
value is to be updated.
SeqNo
Holds the operation sequence number of the job whose
concurrent link value is to be updated.
ConcurrentLink
Holds the new concurrent link value that is to be assigned
to the specified job. This may change the batch of jobs that
this job belongs to, or remove the job from a batch.
editTime
Holds the last edit time for the job. This must match the
value in the database, or the update fails.
Exceptions

An exception is thrown if an error occurs while updating the


database.

SetJobQueue() Method
The SetJobQueue method sets the new Job State of the job.
Used when changing from one paused state to another.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetJobQueue( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal newJobState As JobStates,


ByVal concurrentLink As Integer,
ByVal statusNotes As String,

_
_

ByVal editTime As String _


)

Wonderware Factelligence Client API Reference Guide

304

Chapter 4 API Classes

[C#]
public static void SetJobQueue(
string woId,
string operId,
int seqNo,
JobStates newJobState,
int concurrentLink,
string statusNotes,
string editTime
)

[C++]
public:
static void SetJobQueue(
String woId,
String operId,
int seqNo,
JobStates newJobState,
int concurrentLink,
String statusNotes,
String editTime
)

[J#]
public static void SetJobQueue(
string woId,
string operId,
int seqNo,
JobStates newJobState,
int concurrentLink,
string statusNotes,
string editTime
)

[JScript]
public static

function SetJobQueue(

woId : String,
operId : String,
seqNo : int,
newJobState : JobStates,
concurrentLink : int,
statusNotes : String,
editTime : String

Wonderware Factelligence Client API Reference Guide

Jobs Class

305

Parameters

woId
Holds the work order identifying the job whose job state is
being changed.
operId
Holds the operation ID identifying the job whose job state is
being changed.
seqNo
Holds the sequence number identifying the job whose job
state is being changed.
newJobState
Holds the new job state where the job is to put.
concurrentLink
Holds the concurrent link number of the job. If the job is
part of a batch, all jobs with this concurrent link value are
put into the new job state at the same time.
statusNotes
Holds the status notes of the job that are to be saved with
the job when the job state is changed. These notes can be
edited/added on the confirmation window that is presented
for the user to confirm what job state the job is to be put.
editTime
Holds the last time when the record was edited. Identifying
the correct job record when changing the job state to a new
paused state.
Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

SetProdProcessedFlag() Method
The SetProdProcessedFlag() method marks the specified row
of the item_prod table as processed.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetProdProcessedFlag( _
ByVal rowID As Integer,

ByVal lastEditAt As Date _


)

[C#]
public static void SetProdProcessedFlag(
int rowID,

Wonderware Factelligence Client API Reference Guide

306

Chapter 4 API Classes

DateTime lastEditAt
)

[C++]
public:
static void SetProdProcessedFlag(
int rowID,
DateTime lastEditAt
)

[J#]
public static void SetProdProcessedFlag(
int rowID,
DateTime lastEditAt
)

[JScript]
public static

function SetProdProcessedFlag(

rowID : int,
lastEditAt : DateTime
)

Parameters

rowID
Identifies the row to process.
lastEditAt
Holds the date/time of the last edit for the row. This
date/time must match up with that of the row in the
database in order for row to be set as processed. Otherwise,
call with fail.
Exceptions

An exception is thrown if an error occurs while updating the


database.

SplitJob() Method
The SplitJob() method calls the middleware to split the
specified job into two jobs based on the split quantity. The
new job is given a start quantity of the split quantity
specified. This quantity is removed from the start quantity of
the specified job.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SplitJob( _
ByVal woID As String,

ByVal operID As String,

ByVal origSeqNo As Integer,

Wonderware Factelligence Client API Reference Guide

Jobs Class

ByVal splitQty As Double,

ByVal newSeqNo As Object,

ByVal splitStartQty As Object,


ByVal newStateCd As Object,

307

ByVal reqFinishTime As Object,


ByVal targetEntID As Object,

ByVal statusNotes As String _


)

[C#]
public static void SplitJob(
string woID,
string operID,
int origSeqNo,
double splitQty,
object newSeqNo,
object splitStartQty,
object newStateCd,
object reqFinishTime,
object targetEntID,
string statusNotes
)

[C++]
public:
static void SplitJob(
String woID,
String operID,
int origSeqNo,
double splitQty,
Object newSeqNo,
Object splitStartQty,
Object newStateCd,
Object reqFinishTime,
Object targetEntID,
String statusNotes
)

[J#]
public static void SplitJob(
string woID,
string operID,
int origSeqNo,
double splitQty,

Wonderware Factelligence Client API Reference Guide

308

Chapter 4 API Classes

object newSeqNo,
object splitStartQty,
object newStateCd,
object reqFinishTime,
object targetEntID,
string statusNotes
)

[JScript]
public static

function SplitJob(

woID : String,
operID : String,
origSeqNo : int,
splitQty : double,
newSeqNo : Object,
splitStartQty : Object,
newStateCd : Object,
reqFinishTime : Object,
targetEntID : Object,
statusNotes : String
)

Parameters

woID
Holds the work order ID of the job to split.
operID
Holds the operation ID of the job to split.
origSeqNo
Holds the sequence number of the job to split.
splitQty
Holds the quantity to split off from the original job for the
new job.
newSeqNo
Holds the optional new sequence number for the new job. If
a null is passed, the next available sequence number is used
for the new job.
splitStartQty
Holds the optional start quantity for the new job. If a null is
passed, no start quantity is assigned to the new job.
newStateCd
Holds the optional state code for the new job. If a null is
passed, the job state is set to ready if the existing job is
running, complete, or cancelled; otherwise, the new job
state is set to the existing job state.

Wonderware Factelligence Client API Reference Guide

Jobs Class

309

reqFinishTime
Holds the optional required finish time for the new job. If a
null is passed, no required finish time is assigned to the
new job.
targetEntID
Holds the optional ID of the target entity for the new job. If
a null is passed, the ID of the target entity for the existing
job is assigned to the new job.
statusNotes
Holds the optional status notes for the new job. If a null is
passed, no status notes are assigned to the new job.
Exceptions

An exception is thrown if an error occurs while splitting the


job.

StartSome() Method
The StartSome() method calls the middleware to split the
specified job into two jobs based on the split quantity and
then start the new job created from the split on the entity
specified. The new job is given a start quantity of the split
quantity specified. This quantity is removed from the start
quantity of the specified job.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub StartSome( _
ByVal entID As Integer,
ByVal woID As String,

ByVal operID As String,

ByVal origSeqNo As Integer,


ByVal qtyReqd As Double,

ByVal startQty As Double,

ByVal newSeqNo As Object,

ByVal statusNotes As String _


)

[C#]
public static void StartSome(
int entID,
string woID,
string operID,
int origSeqNo,
double qtyReqd,
double startQty,

Wonderware Factelligence Client API Reference Guide

310

Chapter 4 API Classes

object newSeqNo,
string statusNotes
)

[C++]
public:
static void StartSome(
int entID,
String woID,
String operID,
int origSeqNo,
double qtyReqd,
double startQty,
Object newSeqNo,
String statusNotes
)

[J#]
public static void StartSome(
int entID,
string woID,
string operID,
int origSeqNo,
double qtyReqd,
double startQty,
object newSeqNo,
string statusNotes
)

[JScript]
public static

function StartSome(

entID : int,
woID : String,
operID : String,
origSeqNo : int,
qtyReqd : double,
startQty : double,
newSeqNo : Object,
statusNotes : String
)

Parameters

entID
Holds the entity that the new job create from the split is to
be started on.

Wonderware Factelligence Client API Reference Guide

JobExec Class

311

woID
Holds the work order ID of the job to split.
operID
Holds the operation ID of the job to split.
origSeqNo
Holds the sequence number of the job to split.
qtyReqd
Holds the quantity to split off from the original job for the
new job.
startQty
The start quantity for the new job. It cannot be greater then
the start quantity of the original job.
newSeqNo
Holds the optional new sequence number for the new job. If
a null is passed, the next available sequence number is used
for the new job.
statusNotes
Holds the optional status notes for the new job. If a null is
passed, no status notes are assigned to the new job.
Exceptions

An exception is thrown if an error occurs while splitting the


job.

JobExec Class
The JobExec class handles all the Factelligence MES
functionalities for a job. A job exec object is created for each
job position in the entity.

AddCons() Method
The AddCons() method adds consumption for the specified
BOM item for the job running on the current job position.
Syntax

[Visual Basic (Declaration)]


Public Sub AddCons( _
ByVal BOMPos As Integer,

ByVal qtyCons As Double,

ByVal reasCd As Object,


ByVal lotNo As String,

_
_

ByVal fgLotNo As String,

ByVal fromEntID As Object,


ByVal itemID As String,

Wonderware Factelligence Client API Reference Guide

312

Chapter 4 API Classes

ByVal extRef As String,

ByVal spare1 As String,

ByVal spare2 As String,

ByVal spare3 As String,

ByVal spare4 As String _


)

[C#]
public void AddCons(
int BOMPos,
double qtyCons,
object reasCd,
string lotNo,
string fgLotNo,
object fromEntID,
string itemID,
string extRef,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
void AddCons(
int BOMPos,
double qtyCons,
Object reasCd,
String lotNo,
String fgLotNo,
Object fromEntID,
String itemID,
String extRef,
String spare1,
String spare2,
String spare3,
String spare4
) sealed

[J#]

public void AddCons(


int BOMPos,
double qtyCons,

Wonderware Factelligence Client API Reference Guide

JobExec Class

313

object reasCd,
string lotNo,
string fgLotNo,
object fromEntID,
string itemID,
string extRef,
string spare1,
string spare2,
string spare3,
string spare4
)

[JScript]
public

function AddCons(

BOMPos : int,
qtyCons : double,
reasCd : Object,
lotNo : String,
fgLotNo : String,
fromEntID : Object,
itemID : String,
extRef : String,
spare1 : String,
spare2 : String,
spare3 : String,
spare4 : String
)

Parameters

BOMPos
Holds the BOM position of the item being consumed.
qtyCons
Holds the quantity being consumed.
reasCd
Holds the reason code of the item being consumed. This is
an optional parameter that is used to identify an item_cons
record to add consumption to the existing row if there is
one. If the reason code is null, it is not used when
identifying the item_cons record.

Wonderware Factelligence Client API Reference Guide

314

Chapter 4 API Classes

lotNo
Holds the lot number of the item being consumed. This is
an optional parameter that is used to identify an item_cons
record to add consumption to the existing row if there is
one. If the lot number is null, it is not used when identifying
the item_cons record.
fgLotNo
Holds the finished goods lot number of the item being
consumed. This is an optional parameter that is used to
identify an item_cons record to add consumption to the
existing row if there is one. If the fgLotNo is null, it is not
used when identifying the item_cons record.
fromEntID
Holds the storage entity ID. This is an optional parameter
that is used to identify an item_cons record to add
consumption to the existing row if there is one. If the
fromEntID is null, it is not used when identifying the
item_cons record.
itemID
Holds the item that is being consumed. This is an optional
parameter that is used to identify an item_cons record to
add consumption to the existing row if there is one. If the
item is null, it is not used when identifying the item_cons
record.
extRef
Holds the external reference of the item being consumed.
This is an optional parameter that is used to identify an
item_cons record to add consumption to the existing row if
there is one. If the extRef is null, it is not used when
identifying the item_cons record.
spare1
Holds the optional spare 1 value. Set to nul if not being
used.
spare2
Holds the optional spare 2 value. Set to nul if not being
used.
spare3
Holds the optional spare 3 value. Set to nul if not being
used.
spare4
Holds the optional spare 4 value. Set to nul if not being
used.
Exceptions

An exception is thrown if the consumption cannot be


recorded.

Wonderware Factelligence Client API Reference Guide

JobExec Class

315

AddConsByLot() Method (String)


The AddConsByLot() method adds consumption for the item of
a specific lot if the inventory of the lot has an item grade,
item status, item quantity, and item entity defined. The
consumption amount to be added is the quantity specified in
the qty parameter. The consumption is added for the current
job if there is one for the entity that the user is working on.
Consumption by lot cannot be added if there is no current job
for the entity.
Syntax

[Visual Basic (Declaration)]


Public Sub AddConsByLot( _
ByVal lotNo As String _
)

[C#]
public void AddConsByLot(
string lotNo
)

[C++]
public:
void AddConsByLot(
String lotNo
) sealed

[J#]

public void AddConsByLot(


string lotNo
)

[JScript]
public

function AddConsByLot(

lotNo : String
)

Parameter

lotNo
Holds the lot number where the quantity of the item that is
to add as consumption is stored.

AddConsByLot() Method (String, Double)


The AddConsByLot method adds consumption for the item
stored at the specified lot if the inventory of this lot has an
item grade and item status associated with it, and there is
quantity of the item contained in inventory for this lot and
there is an entity where inventory of this item is coming

Wonderware Factelligence Client API Reference Guide

316

Chapter 4 API Classes

from. The amount of consumption to be added is the amount


of the quantity that is currently stored at the specified lot.
The consumption is added for the current job if there is one
for the entity the user is currently working on. Consumption
by lot cannot be done if there is no current job for the entity.
Syntax

[Visual Basic (Declaration)]


Public Sub AddConsByLot( _
ByVal lotNo As String,

ByVal qty As Double _


)

[C#]
public void AddConsByLot(
string lotNo,
double qty
)

[C++]
public:
void AddConsByLot(
String lotNo,
double qty
) sealed

[J#]

public void AddConsByLot(


string lotNo,
double qty
)

[JScript]
public

function AddConsByLot(

lotNo : String,
qty : double
)

Parameters

lotNo
Holds the lot number where the quantity of the item that is
to add as consumption is stored.
qty
Holds the amount to consume.
ware is not in the correct format.

Wonderware Factelligence Client API Reference Guide

JobExec Class

317

AddProd() Method (Double)


The AddProd() method adds production to the job running on
the current job position.
Syntax

[[Visual Basic (Declaration)] ]


Public Sub AddProd( _
ByVal qty As Double _
)

[[C#] ]

public void AddProd(


double qty
)

[[C++] ]

public:
void AddProd(
double qty
) sealed

[[J#] ]

public void AddProd(


double qty
)

[[JScript] ]

public function AddProd(


qty : double
)

Parameter

qty
Hold the quantity being produced.
Exceptions

An exception is thrown if production cannot be recorded.

AddProd Method (Double, Object, String, String,


Object, Object, String, String, String, String,
String)
The AddProd() method adds production to the job running on
the current job position.
Syntax

[[Visual Basic (Declaration)] ]


Public Sub AddProd( _
ByVal qty As Double, _
ByVal reasCd As Object, _
ByVal itemID As String, _
ByVal lotNo As String, _
ByVal toEntID As Object, _
ByVal byProductBOMPos As Object,
ByVal extRef As String, _

Wonderware Factelligence Client API Reference Guide

318

Chapter 4 API Classes

ByVal
ByVal
ByVal
ByVal

spare1
spare2
spare3
spare4

As
As
As
As

String, _
String, _
String, _
String _

[C#]
public void AddProd(
double qty,
object reasCd,
string itemID,
string lotNo,
object toEntID,
object byProductBOMPos,
string extRef,
string spare1,
string spare2,
string spare3,
string spare4
)

[[C++] ]

public:
void AddProd(
double qty,
Object reasCd,
String itemID,
String lotNo,
Object toEntID,
Object byProductBOMPos,
String extRef,
String spare1,
String spare2,
String spare3,
String spare4
) sealed

[J#]

public void AddProd(


double qty,
object reasCd,
string itemID,
string lotNo,
object toEntID,
object byProductBOMPos,
string extRef,
string spare1,
string spare2,
string spare3,
string spare4

[[JScript] ]
public function AddProd(
qty : double,
reasCd : Object,
itemID : String,
lotNo : String,
toEntID : Object,

Wonderware Factelligence Client API Reference Guide

JobExec Class

319

byProductBOMPos : Object,
extRef : String,
spare1 : String,
spare2 : String,
spare3 : String,
spare4 : String
)

Parameters

qty
Holds the quantity being produced.
reasCd
Holds the optional reason code of the item being produced.
Set to null if not used.
itemID
Holds the optional item ID of the item that is being
produced. Set to null if not being used.
lotNo
Holds the optional lot number of the item being consumed.
Set to null if not used.
toEntID
Holds the optional to storage entity ID. Set to null if not
being used.
byProductBOMPos
Holds the BOM position if a by product is being produced.
Set to null if the main item is being produced.
extRef
Holds the option external reference. Set to null if not being
used.
spare1
Holds the optional spare 1 value. Set to null if not being
used.
spare2
Holds the optional spare 2 value. Set to null if not being
used.
spare3
Holds the optional spare 3 value. Set to null if not being
used.
spare4
Holds the optional spare 4 value. Set to null if not being
used.
Exceptions

An exception is thrown if the production cannot be


recorded.

Wonderware Factelligence Client API Reference Guide

320

Chapter 4 API Classes

CalculateProductionTarget() Method
This method returns a DataSet containing a single row and a
column for the target quantity, the target rate, and the target
rate units.
Syntax

[Visual Basic (Declaration)]


Public Function CalculateProductionTarget( _
ByValue targetQty As Double, _
ByValue targetRateAs Double, _
ByValue targetRateUnits As
ProductionUnitOfMeasure, _
ByValue batchSize As Double, _
) As DataSet

[C#]
public DataSet CalculateProductionTarget (
double targetQty,
double targetRate,
ProductionUnitOfMeasure targetRateUnits,
double batchSize
)

[C++]
public:
DataSet CalculateProductionTarget (
double targetQty,
double targetRate,
ProductionUnitOfMeasure targetRateUnits,
double batchSize
)

[J#]
public DataSet CalculateProductionTarget (
double targetQty,
double targetRate,
ProductionUnitOfMeasure targetRateUnits,
double batchSize
)

[Jscript]
public function CalculateProductionTarget (
targetQty : double,
targetRate : double,
targetRateUnits : ProductionUnitOfMeasure,
batchSize : double
) : DataSet

Parameters

targetQty
Holds a double that specifies the quantity to produce.

Wonderware Factelligence Client API Reference Guide

JobExec Class

321

targetRate
Holds a double that specifies the rate to produce.
targetRateUnits
Holds a value from the ProductionUnitOfMeasure
enumeration which specifies the units for the TargetRate.
batchSize
Holds a double that specifies the product amount per batch.
Return Value

Returns a DataSet containing the target quantity, target


rate, and target rate units for the job specified in the job
exec object.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

EndJob() Method
The EndJob method ends the job that is identified by the
input parameters. If the job is part of a batch, an attempt is
made to end all jobs in the batch. Ending a job sets the job
state to completed.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub EndJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String _


)

[C#]
public static void EndJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[C++]
public:
static void EndJob(
String woId,
String operId,
int seqNo,

Wonderware Factelligence Client API Reference Guide

322

Chapter 4 API Classes

String statusNotes
)

[J#]
public static void EndJob(
string woId,
string operId,
int seqNo,
string statusNotes
)

[JScript]
public static

function EndJob(

woId : String,
operId : String,
seqNo : int,
statusNotes : String
)

Parameters

woId
Holds the work order identifying the job that is to be
completed.
operId
Holds the operation ID identifying the job that is to be
completed.
seqNo
Holds the sequence number identifying the job that is to
completed.
statusNotes
Holds the status notes that are to be saved with the job
when the job is completed. These notes are edited on the
dialog used to confirm that the user wants to complete the
job.
Exceptions

An exception is thrown if an error occurs.

GetAvailLots() Method
The GetAvailLots() method gets the available lots for the
current job running on the current entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetAvailLots() As DataSet

[C#]

public DataSet GetAvailLots()

Wonderware Factelligence Client API Reference Guide

JobExec Class

323

[C++]
public:
DataSet GetAvailLots() sealed

[J#]

public DataSet GetAvailLots()

[JScript]
public

function GetAvailLots() : DataSet

Return Value

Returns a DataSet containing the available lots.

Exceptions

Exception Type Condition


An exception is thrown if an error occurs retrieving the data
from the database.

GetBatchOfJobs() Method
The GetBatchOfJobs() method gets a batch of jobs for an
entity based on the supplied concurrent link.
Syntax

[Visual Basic (Declaration)]


Public Function GetBatchOfJobs( _
ByVal ent_id As Integer,

ByVal concurrent_link As Integer _


) As DataSet

[C#]

public DataSet GetBatchOfJobs(


int ent_id,
int concurrent_link
)

[C++]
public:
DataSet GetBatchOfJobs(
int ent_id,
int concurrent_link
) sealed

[J#]

public DataSet GetBatchOfJobs(


int ent_id,
int concurrent_link
)

[JScript]
public

function GetBatchOfJobs(

Wonderware Factelligence Client API Reference Guide

324

Chapter 4 API Classes

ent_id : int,
concurrent_link : int
) : DataSet

Parameters

ent_id
Holds the ID of the entity for which the batch of jobs are
queued.
concurrent_link
Holds the concurrent link which batches the jobs together.
Return Value

DataSet of all jobs batched on the entity to the concurrent


link.

GetConsData() Method
The GetConsData() method returns the consumption data for
the current job. The consumption data can be filtered by user
and by shift.
Syntax

[Visual Basic (Declaration)]


Public Function GetConsData( _
ByVal filterByUser As Boolean,
ByVal shiftStart As String _
) As DataSet

[[C#] ]

public DataSet GetConsData(


bool filterByUser,
string shiftStart
)

[C++]
public:
DataSet GetConsData(
bool filterByUser,
String shiftStart
) sealed

[J#]

public DataSet GetConsData(


bool filterByUser,
string shiftStart
)

[JScript]
public

function GetConsData(

Wonderware Factelligence Client API Reference Guide

JobExec Class

325

filterByUser : bool,
shiftStart : String
) : DataSet

Parameters

filterByUser
Set true if only the data for the current user should be
retrieved.
shiftStart
Set true if only the data since the specified shift time should
be retrieved.
Return Value

Returns a DataSet containing rows for all the consumption


records matching the filter criteria.

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

GetJobBomAvailSubst() Method
The GetJobBomAvailSubst() method returns a DataView
containing all available substitute items for consumption.
Available substitutes items are defined as those items which
are the intersection of the substitutes for the current job, and
the union of the substitutes of all the upstream jobs that
produce the same item as the current one at the job's BOM
position 0
Syntax

[Visual Basic (Declaration)]


Public Function GetJobBomAvailSubst() As DataView

[C#]

public DataView GetJobBomAvailSubst()

[C++]

public:
DataView GetJobBomAvailSubst() sealed

[J#]

public DataView GetJobBomAvailSubst()

[JScript]
public

function GetJobBomAvailSubst() : DataView

Return Value

Returns a dataview of all available substitutes items for


consumption.

Wonderware Factelligence Client API Reference Guide

326

Chapter 4 API Classes

GetJobBOMData() Method
The GetJobBOMData() method gets the BOM data for the
current job. If a BOM position is specified, only the BOM
data for that item is returned.
Syntax

[Visual Basic (Declaration)]


Public Function GetJobBOMData( _
ByVal BOMPos As Object _
) As DataSet

[C#]

public DataSet GetJobBOMData(


object BOMPos
)

[C++]
public:
DataSet GetJobBOMData(
Object BOMPos
) sealed

[J#]

public DataSet GetJobBOMData(


object BOMPos
)

[JScript]
public

function GetJobBOMData(

BOMPos : Object
) : DataSet

Parameter

BOMPos
Optionally holds the position in the BOM for an individual
item. Set to null if not used in which case all BOM data for
the job are returned.
Return Value

Returns a DataSet containing the BOM records.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobBOMProducibles() Method
The GetJobBOMProducibles() method returns a DataView
containing all the items that can be produced by the current
job. The producible items are the item produced at BOM
position 0 and any of its substitutes along with all by
Wonderware Factelligence Client API Reference Guide

JobExec Class

327

products and their substitutes. If a substitute is produced,


the column current_subst in the returned dataview contains
an integer value identifying the alternative item being
produced. Otherwise, the current_subst column contains a
null.
Syntax

[Visual Basic (Declaration)]


Public Function GetJobBOMProducibles( _
ByVal BOMPos As Object _
) As DataView

[C#]

public DataView GetJobBOMProducibles(


object BOMPos
)

[C++]
public:
DataView GetJobBOMProducibles(
Object BOMPos
) sealed

[J#]

public DataView GetJobBOMProducibles(


object BOMPos
)

[JScript]
public

function GetJobBOMProducibles(

BOMPos : Object
) : DataView

Parameter

BOMPos
Holds an optional BOM position. If all BOM positions are to
be returned, set this parameter to null.
Return Value

Returns a dataview containing rows for all the producible


items. A dataview is used because the middleware returns
consumables as well as producibles, so the consumables are
filtered out in the dataview and the rows are sorted by job
position and preference.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

Wonderware Factelligence Client API Reference Guide

328

Chapter 4 API Classes

GetJobBomSubst() Method
The GetJobBOMSubst() method returns a DataView
containing all substitute items for a job at the BOM position
specified.
Syntax

[Visual Basic (Declaration)]


Public Function GetJobBomSubst( _
ByVal bom_pos As Integer _
) As DataView

[C#]

public DataView GetJobBomSubst(


int bom_pos
)

[C++]
public:
DataView GetJobBomSubst(
int bom_pos
) sealed

[[J#]}

public DataView GetJobBomSubst(


int bom_pos
)

[JScript]
public

function GetJobBomSubst(

bom_pos : int
) : DataView

Parameter

bom_pos
Holds the BOM position for retrieving substitutes.
Return Value

Returns a dataview containing all substitute items for the


BOM position of the specified job.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobBOMWithSubData() Method
The GetJobBOMWithSubData() method gets the BOM data and
BOM substitute data for the current job. If a BOM position is
specified, only the BOM data for that item is returned.

Wonderware Factelligence Client API Reference Guide

JobExec Class

329

Syntax

[Visual Basic (Declaration)]


Public Function GetJobBOMWithSubData( _
ByVal BOMPos As Object _
) As DataSet

[C#]

public DataSet GetJobBOMWithSubData(


object BOMPos
)

[C++]
public:
DataSet GetJobBOMWithSubData(
Object BOMPos
) sealed

[J#]

public DataSet GetJobBOMWithSubData(


object BOMPos
)

[JScript]
public

function GetJobBOMWithSubData(

BOMPos : Object
) : DataSet

Parameter

BOMPos
Optionally holds the position in the BOM for an individual
item. Set to null if not used.
Return Value

Returns a DataSet containing the BOM records.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetJobEvents() Method
The GetJobEvents() method returns a DataSet containing all
job event data for the current job. Job events include
certification signoff, adding production, adding consumption,
reclassifying production, reclassifying consumption,
completing a step, changing job specifications, and changing
a job state. Data is filtered by step number and/or lot number
by supplying values for the optional input parameters. If the
data is not filtered, these values are null.

Wonderware Factelligence Client API Reference Guide

330

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Function GetJobEvents( _
ByVal stepNo As Object,

ByVal lotNo As String _


) As DataSet

[C#]

public DataSet GetJobEvents(


object stepNo,
string lotNo
)

[C++]
public:
DataSet GetJobEvents(
Object stepNo,
String lotNo
) sealed

[J#]

public DataSet GetJobEvents(


object stepNo,
string lotNo
)

[JScript]
public

function GetJobEvents(

stepNo : Object,
lotNo : String
) : DataSet

Parameters

stepNo
Holds the step number that is used to filter the job event
information by. Set to null to ignore.
lotNo
Holds the lot number that is used to filter the job event
information by. Set to an empty string to ignore.
Return Value

Returns a DataSet containing a row for each job event that


matches the filter.

Exceptions

An exception is thrown if an error occurs while retrieving


the data.

Wonderware Factelligence Client API Reference Guide

JobExec Class

331

GetJobSchedData() Method
The GetJobSchedData() method returns a DataSet of the Job
Schedule properties for the current entity. The job schedule
properties contain the sort order of the job queue for an
entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetJobSchedData() As DataSet

[C#]

public DataSet GetJobSchedData()

[C++]

public:
DataSet GetJobSchedData() sealed

[J#]

public DataSet GetJobSchedData()

[JScript]
public

function GetJobSchedData() : DataSet

Return Value

Returns a DataSet containing a row for the Job Schedule


properties.

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetProdData() Method
The GetProdData() method gets the production data for a
current job. The production data can be filtered by user and
shift.
Syntax
[Visual Basic (Declaration)]
Public Function GetProdData( _
ByVal filterByUser As Boolean,

ByVal shiftStart As String _


) As DataSet

[C#]

public DataSet GetProdData(


bool filterByUser,
string shiftStart
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

332

Chapter 4 API Classes

DataSet GetProdData(
bool filterByUser,
String shiftStart
) sealed

[J#]

public DataSet GetProdData(


bool filterByUser,
string shiftStart
)

[JScript]
public

function GetProdData(

filterByUser : bool,
shiftStart : String
) : DataSet

Parameters

filterByUser
Holds the filter to determine if the production data should
be for the current user (true) or for all users (false).
shiftStart
Holds the filter to determine if the production data should
be for the current shift. Set to null if all shifts should be
shown.
Return Value

Returns a DataSet containing all the item production


records matching the filter information.

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

GetProduction () Method
The GetProduction() method returns a DataSet containing a
single row with a column for the current production for the
shift and a column for the projected production for the shift.
Syntax

[Visual Basic (Declaration)]


Public Function GetProduction ( _
)

As DataSet

[C#]

public DataSet GetProduction (


)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

JobExec Class

333

DataSet GetProduction (
)

[J#]
public DataSet GetProduction (
)

[Jscript]

public function GetProduction (


)

DataSet

Return Value

Returns a DataSet containing a single row with a column


for the current production and a column for the projected
production for the shift.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetQueue() Method
The GetQueue() method returns the job queue for the
specified entity. The job queue consists of all jobs queued to
the entity. The filter fields are only applied if they are NOT =
null, so pass nulls to bypass any filtering. Pass the data set to
populate by reference so the existing instance can continually
be refreshed. Throws an exception if the call fails.
Syntax

[Visual Basic (Declaration)]


Public Function GetQueue( _
ByVal entId As Integer,

ByVal jobStateFilter As Object,


ByVal reqdByFilter As Object,

ByVal jobPriorityFilter As Object,

ByVal maxRows As Object _


) As DataSet

[C#]

public DataSet GetQueue(


int entId,
object jobStateFilter,
object reqdByFilter,
object jobPriorityFilter,
object maxRows
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

334

Chapter 4 API Classes

DataSet GetQueue(
int entId,
Object jobStateFilter,
Object reqdByFilter,
Object jobPriorityFilter,
Object maxRows
) sealed

[J#]

public DataSet GetQueue(


int entId,
object jobStateFilter,
object reqdByFilter,
object jobPriorityFilter,
object maxRows
)

[JScript]
public

function GetQueue(

entId : int,
jobStateFilter : Object,
reqdByFilter : Object,
jobPriorityFilter : Object,
maxRows : Object
) : DataSet

Parameters

entId
Holds the ID of the entity whose queue is retrieved.
jobStateFilter
Holds the job state code filter if required, or null to bypass
this filter.
reqdByFilter
Holds the required by filter if required, or null to bypass
this filter.
jobPriorityFilter
Holds the job priority filter if required, or null to bypass
this filter.
maxRows
Holds the maximum number of rows to return if required,
or null to bypass this filter.
Return Value

Returns a DataSet containing a row for every job in the


queue matching the filter specifications.

Wonderware Factelligence Client API Reference Guide

JobExec Class

335

Exceptions

An exception is thrown if an error occurs retrieving the data


from the database.

GetShortages() Method
The GetShortages() method returns a DataSet containing any
item shortages at the current entity based on its configured
parameters.
Syntax

[Visual Basic (Declaration)]


Public Function GetShortages() As DataSet

[C#]

public DataSet GetShortages()

[C++]

public:
DataSet GetShortages() sealed

[J#]

public DataSet GetShortages()

[JScript]
public

function GetShortages() : DataSet

Return Value

Returns a DataSet containing shortage items if any.

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

GetSPCCharJobData() Method
The GetSPCCharJobData() method gets SPC Data for the
current job and the specified step.
Syntax

[Visual Basic (Declaration)]


Public Function GetSPCCharJobData( _
ByVal stepNo As Object _
) As DataSet

[C#]

public DataSet GetSPCCharJobData(


object stepNo
)

[C++]
public:
DataSet GetSPCCharJobData(

Wonderware Factelligence Client API Reference Guide

336

Chapter 4 API Classes

Object stepNo
) sealed

[J#]

public DataSet GetSPCCharJobData(


object stepNo
)

[JScript]
public

function GetSPCCharJobData(

stepNo : Object
) : DataSet

Parameter

stepNo
If not null, the results are filtered based on the specified
step number.
Return Value

Returns a DataSet containing the SPC_Char_Job data.

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

PauseJob() Method (JobStates, String, String,


Int32, String, Boolean, Int32)(JobExec Class)
The PauseJob() method pauses the specified job by putting it
in the New, On Hold, or Suspended state. A job is specified by
a work order ID, an operation ID, and an operation sequence
number.
Syntax

[Visual Basic (Declaration)]


Public Sub PauseJob( _
ByVal pausedState As JobStates,
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String,

ByVal checkPrivs As Boolean,

ByVal jobPos As Integer _


)

[C#]
public void PauseJob(
JobStates pausedState,
string woId,

Wonderware Factelligence Client API Reference Guide

JobExec Class

337

string operId,
int seqNo,
string statusNotes,
bool checkPrivs,
int jobPos
)

[C++]
public:
void PauseJob(
JobStates pausedState,
String woId,
String operId,
int seqNo,
String statusNotes,
bool checkPrivs,
int jobPos
) sealed

[J#]

public void PauseJob(


JobStates pausedState,
string woId,
string operId,
int seqNo,
string statusNotes,
bool checkPrivs,
int jobPos
)

[JScript]
public

function PauseJob(

pausedState : JobStates,
woId : String,
operId : String,
seqNo : int,
statusNotes : String,
checkPrivs : bool,
jobPos : int
)

Parameters

pausedState
Holds the state into which the job should be put.

Wonderware Factelligence Client API Reference Guide

338

Chapter 4 API Classes

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
statusNotes
Holds notes to explain why the job is being paused. Pass an
empty string if no notes are to be stored.
checkPrivs
Specifies whether or not the privileges of the user should be
checked to determine if the user may pause the job.
jobPos
Holds the position of the job in the job exec.
Exceptions

An exception is thrown if the job cannot be paused for any


reason.

PauseJob() Method (JobStates, String, String,


Int32, String, Boolean, Int32, Boolean)(JobExec
Class)
The PauseJob() method pauses the specified job by putting it
in the New, On Hold, or Suspended state. A job is specified by
a work order ID, an operation ID, and an operation sequence
number.
Syntax

[Visual Basic (Declaration)]


Public Sub PauseJob( _
ByVal pausedState As JobStates,
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String,

ByVal checkPrivs As Boolean,

ByVal jobPos As Integer,

ByVal noFresh As Boolean _


)

[C#]
public void PauseJob(
JobStates pausedState,
string woId,

Wonderware Factelligence Client API Reference Guide

JobExec Class

339

string operId,
int seqNo,
string statusNotes,
bool checkPrivs,
int jobPos,
bool noFresh
)

[C++]
public:
void PauseJob(
JobStates pausedState,
String woId,
String operId,
int seqNo,
String statusNotes,
bool checkPrivs,
int jobPos,
bool noFresh
) sealed

[J#]

public void PauseJob(


JobStates pausedState,
string woId,
string operId,
int seqNo,
string statusNotes,
bool checkPrivs,
int jobPos,
bool noFresh
)

[JScript]
public

function PauseJob(

pausedState : JobStates,
woId : String,
operId : String,
seqNo : int,
statusNotes : String,
checkPrivs : bool,
jobPos : int,
noFresh : bool
)

Wonderware Factelligence Client API Reference Guide

340

Chapter 4 API Classes

Parameters

pausedState
Holds the state into which the job should be put.
woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
statusNotes
Holds notes to explain why the job is being paused. Pass an
empty string if no notes are to be stored.
checkPrivs
Specifies whether or not the privileges of the user should be
checked to determine if the user may pause the job.
jobPos
Holds the position of the job in the job exec.
noFresh
Holds a flag whether to refresh the current session object
and current job exec object.
Exceptions

An exception is thrown if the job cannot be paused for any


reason.

PopUpAddConsDlg Method (String, Boolean,


String, String, Object, Boolean, Boolean,
Boolean, Boolean, Boolean, Double, Double,
Double, Int32)
The PopUpAddConsDlg() method invokes the Add
Consumption dialog. This dialog allows the user to enter
consumption for a specified BOM component of the current
job.
Syntax

[Visual Basic (Declaration)]


Public Function PopUpAddConsDlg( _
ByVal jobDesc As String,

ByVal dlgForSteps As Boolean,


ByVal itemID As String,

ByVal itemDesc As String,


ByVal bomPos As Object,

ByVal must_consume_from_inv As Boolean,

Wonderware Factelligence Client API Reference Guide

JobExec Class

ByVal may_choose_alt_inv_loc As Boolean,


ByVal may_create_lots As Boolean,

ByVal actualQty As Double,


ByVal maxQty As Double,

ByVal must_consume_from_wip As Boolean,


ByVal update_inv As Boolean,

341

ByVal consumedQty As Double,

ByVal stepNo As Integer _


) As Boolean

[C#]

public bool PopUpAddConsDlg(


string jobDesc,
bool dlgForSteps,
string itemID,
string itemDesc,
object bomPos,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_lots,
bool must_consume_from_wip,
bool update_inv,
double actualQty,
double maxQty,
double consumedQty,
int stepNo
)

[C++]
public:
bool PopUpAddConsDlg(
String jobDesc,
bool dlgForSteps,
String itemID,
String itemDesc,
Object bomPos,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_lots,
bool must_consume_from_wip,
bool update_inv,
double actualQty,

Wonderware Factelligence Client API Reference Guide

342

Chapter 4 API Classes

double maxQty,
double consumedQty,
int stepNo
) sealed

[J#]

public bool PopUpAddConsDlg(


string jobDesc,
bool dlgForSteps,
string itemID,
string itemDesc,
object bomPos,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_lots,
bool must_consume_from_wip,
bool update_inv,
double actualQty,
double maxQty,
double consumedQty,
int stepNo
)

[JScript]
public

function PopUpAddConsDlg(

jobDesc : String,
dlgForSteps : bool,
itemID : String,
itemDesc : String,
bomPos : Object,
must_consume_from_inv : bool,
may_choose_alt_inv_loc : bool,
may_create_lots : bool,
must_consume_from_wip : bool,
update_inv : bool,
actualQty : double,
maxQty : double,
consumedQty : double,
stepNo : int
) : bool

Wonderware Factelligence Client API Reference Guide

JobExec Class

343

Parameters

jobDesc
Holds the description of the job.
dlgForSteps
Holds a flag indicating whether consumption is being
recorded at a step.
itemID
Holds the ID of the item being consumed.
itemDesc
Holds the description of the item being consumed.
bomPos
Hold the BOM position of the item being consumed.
must_consume_from_inv
Holds a flag indicating whether or not consumption must
come from inventory.
may_choose_alt_inv_loc
Holds a flag indicating whether or not an alternative
inventory location may be chosen.
may_create_lots
Holds a flag indicating whether or not new lots may be
created.
must_consume_from_wip
Holds a flag indicating whether or not consumption must
come from WIP.
update_inv
Holds a flag indicating whether or not inventory is to be
updated.
actualQty
Holds the quantity of the item that is required.
maxQty
Holds the actual maximum quantity of the item which is
equal either to the maximum quantity per parent item or to
the maximum per parent item times the start quantity or
times the quantity produced (whichever is greater).
consumedQty
Holds the quantity of the item that has been consumed.
stepNo
Holds the number of the step in which the consumption is
being done.
Return Value

Returns true if the user enters consumption, otherwise it


returns false.

Wonderware Factelligence Client API Reference Guide

344

Chapter 4 API Classes

PopUpAddConsDlg() Method (String, Boolean,


String, String, Object, Boolean, Boolean,
Boolean, Boolean, Boolean, Double, Double,
Double, Int32, Double, Object, Object)
The PopUpAddConsDlg() method adds consumption data
either from the Consumption or Steps (dlgForSteps flag).
Syntax

[Visual Basic (Declaration)]


Public Function PopUpAddConsDlg( _
ByVal jobDesc As String,

ByVal dlgForSteps As Boolean,


ByVal itemID As String,

ByVal itemDesc As String,


ByVal bomPos As Object,

ByVal must_consume_from_inv As Boolean,


ByVal may_choose_alt_inv_loc As Boolean,
ByVal may_create_lots As Boolean,

ByVal actualQty As Double,


ByVal maxQty As Double,

ByVal consumedQty As Double,


ByVal stepNo As Integer,
ByVal qtyPerFG As Double,

_
_

ByVal reqGradeCd As Object,

ByVal job_bom_subst_exist As Object _


) As Boolean

[C#]

public bool PopUpAddConsDlg(


string jobDesc,
bool dlgForSteps,
string itemID,
string itemDesc,
object bomPos,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_lots,
bool must_consume_from_wip,
bool update_inv,
double actualQty,

Wonderware Factelligence Client API Reference Guide

ByVal must_consume_from_wip As Boolean,


ByVal update_inv As Boolean,

JobExec Class

345

double maxQty,
double consumedQty,
int stepNo,
double qtyPerFG,
object reqGradeCd,
object job_bom_subst_exist
)

[C++]
public:
bool PopUpAddConsDlg(
String jobDesc,
bool dlgForSteps,
String itemID,
String itemDesc,
Object bomPos,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_lots,
bool must_consume_from_wip,
bool update_inv,
double actualQty,
double maxQty,
double consumedQty,
int stepNo,
double qtyPerFG,
Object reqGradeCd,
Object job_bom_subst_exist
) sealed

[J#]

public bool PopUpAddConsDlg(


string jobDesc,
bool dlgForSteps,
string itemID,
string itemDesc,
object bomPos,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_lots,
bool must_consume_from_wip,
bool update_inv,

Wonderware Factelligence Client API Reference Guide

346

Chapter 4 API Classes

double actualQty,
double maxQty,
double consumedQty,
int stepNo,
double qtyPerFG,
object reqGradeCd,
object job_bom_subst_exist
)

[JScript]
public

function PopUpAddConsDlg(

jobDesc : String,
dlgForSteps : bool,
itemID : String,
itemDesc : String,
bomPos : Object,
must_consume_from_inv : bool,
may_choose_alt_inv_loc : bool,
may_create_lots : bool,
must_consume_from_wip : bool,
update_inv : bool,
actualQty : double,
maxQty : double,
consumedQty : double,
stepNo : int,
qtyPerFG : double,
reqGradeCd : Object,
job_bom_subst_exist : Object
) : bool

Parameters

jobDesc
Holds the description of the job.
dlgForSteps
Holds a flag indicating whether consumption is recorded at
a step.
itemID
Holds the ID of the item being consumed.
itemDesc
Holds the description of the item being consumed.
bomPos
Hold the BOM position of the item being consumed.

Wonderware Factelligence Client API Reference Guide

JobExec Class

347

must_consume_from_inv
Holds a flag indicating wherther or not consumption must
come from inventory.
may_choose_alt_inv_loc
Holds a flag indicating whether or not an alternative
inventory location may be chosen.
may_create_lots
Holds a flag indicating whether or not new lots may be
created.
must_consume_from_wip
Holds a flag indicating whether or not consumption must
come from WIP.
update_inv
Holds a flag indicating whether or not inventory is to be
updated.
actualQty
Holds the quantity of the item that is required.
maxQty
Holds the actual maximum quantity of the item which is
equal either to the maximum quantity per parent item or to
the maximum per parent item times the start quantity or
times the quantity produced (whichever is greater).
consumedQty
Holds the quantity of the item that has been consumed.
stepNo
Holds the number of the step in which the consumption is
being done.
qtyPerFG
Holds the quantity per parent item.
reqGradeCd
Holds the required grade of the item when consumed.
job_bom_subst_exist
Holds a flag that if true says that a substitute for the item
does exist.
Return Value

Returns true if the user enters consumption, otherwise it


returns false.

Wonderware Factelligence Client API Reference Guide

348

Chapter 4 API Classes

PopupAddProdDlg() Method (String, String,


Boolean, Double, Double, Double, String,
DateTime, Int32)
The PopUpAddProdDlg() method invokes one of the Add
Production dialogs either for a serialized or unserialized part.
The dialogs allow the user to enter production for the current
job.
Syntax

[Visual Basic (Declaration)]


Public Function PopupAddProdDlg( _
ByVal itemID As String,

ByVal itemDesc As String,

ByVal is_serialized As Boolean,


ByVal qtyGood As Double,
ByVal rejQty As Double,

_
_

ByVal startQty As Double,


ByVal jobDesc As String,

_
_

ByVal shiftStartTime As Date,


ByVal shiftId As Integer _
) As Boolean

[C#]

public bool PopupAddProdDlg(


string itemID,
string itemDesc,
bool is_serialized,
double qtyGood,
double rejQty,
double startQty,
string jobDesc,
DateTime shiftStartTime,
int shiftId
)

[C++]
public:
bool PopupAddProdDlg(
String itemID,
String itemDesc,
bool is_serialized,
double qtyGood,
double rejQty,

Wonderware Factelligence Client API Reference Guide

JobExec Class

349

double startQty,
String jobDesc,
DateTime shiftStartTime,
int shiftId
) sealed

[J#]

public bool PopupAddProdDlg(


string itemID,
string itemDesc,
bool is_serialized,
double qtyGood,
double rejQty,
double startQty,
string jobDesc,
DateTime shiftStartTime,
int shiftId
)

[JScript]
public

function PopupAddProdDlg(

itemID : String,
itemDesc : String,
is_serialized : bool,
qtyGood : double,
rejQty : double,
startQty : double,
jobDesc : String,
shiftStartTime : DateTime,
shiftId : int
) : bool

Parameters

itemID
Holds the ID of the item being produced.
itemDesc
Holds the description of the item being produced.
is_serialized
Holds a flag indicating whether the item being produced is
serialized or not. This flag determines which of the Add
Production dialogs to open. Serialized items use a different
dialog to add production then unserialized parts do.
qtyGood
Holds the quantity of good production entered.

Wonderware Factelligence Client API Reference Guide

350

Chapter 4 API Classes

rejQty
Holds the quantity of rejected production entered.
startQty
Holds the starting quantity for the job.
jobDesc
Holds the description of the job.
shiftStartTime
Holds the start time of the current shift.
shiftId
Holds the shift ID of the current shift.
Return Value

Returns true if the user enters production, otherwise it


returns false.

PopupAddProdDlg() Method (String, String,


Double, Double, Double, String)
The PopUpAddConsDlg() method invokes the Add Production
dialog. This dialog allows the user to enter production for the
current job.
Syntax

[Visual Basic (Declaration)]


Public Function PopupAddProdDlg( _
ByVal itemID As String,

ByVal itemDesc As String,


ByVal qtyGood As Double,
ByVal rejQty As Double,

_
_

ByVal startQty As Double,


ByVal jobDesc As String _
) As Boolean

[C#]

public bool PopupAddProdDlg(


string itemID,
string itemDesc,
double qtyGood,
double rejQty,
double startQty,
string jobDesc
)

[C++]
public:
bool PopupAddProdDlg(

Wonderware Factelligence Client API Reference Guide

JobExec Class

351

String itemID,
String itemDesc,
double qtyGood,
double rejQty,
double startQty,
String jobDesc
) sealed

[J#]

public bool PopupAddProdDlg(


string itemID,
string itemDesc,
double qtyGood,
double rejQty,
double startQty,
string jobDesc
)

[JScript]
public

function PopupAddProdDlg(

itemID : String,
itemDesc : String,
qtyGood : double,
rejQty : double,
startQty : double,
jobDesc : String
) : bool

Parameters

itemID
Holds the ID of the item being produced.
itemDesc
Holds the description of the item being produced.
qtyGood
Holds the quantity of good production entered.
rejQty
Holds the quantity of rejected production entered.
startQty
Holds the starting quantity for the job.
jobDesc
Holds the description of the job.
Return Value

Returns true if the user enters production, otherwise it


returns false.

Wonderware Factelligence Client API Reference Guide

352

Chapter 4 API Classes

PopupAddWasteDlg() Method
The PopupAddWasteDlg() method opens the Reject form to
allow the user to mark an amount of a consumed item as
wasted.
Syntax

[Visual Basic (Declaration)]


Public Function PopupAddWasteDlg( _
ByVal itemID As String,

ByVal itemDesc As String,

ByVal storageEntID As Integer,


ByVal qty As Double,

ByVal bomPos As Integer,


ByVal lotNo As String,

ByVal must_consume_from_inv As Boolean,


ByVal may_choose_alt_inv_loc As Boolean,
ByVal may_create_new_lots As Boolean _
) As Boolean

[C#]

public bool PopupAddWasteDlg(


string itemID,
string itemDesc,
int storageEntID,
double qty,
int bomPos,
string lotNo,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_new_lots
)

[C++]
public:
bool PopupAddWasteDlg(
String itemID,
String itemDesc,
int storageEntID,
double qty,
int bomPos,
String lotNo,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,

Wonderware Factelligence Client API Reference Guide

_
_

JobExec Class

353

bool may_create_new_lots
) sealed

[J#]

public bool PopupAddWasteDlg(


string itemID,
string itemDesc,
int storageEntID,
double qty,
int bomPos,
string lotNo,
bool must_consume_from_inv,
bool may_choose_alt_inv_loc,
bool may_create_new_lots
)

[JScript]
public

function PopupAddWasteDlg(

itemID : String,
itemDesc : String,
storageEntID : int,
qty : double,
bomPos : int,
lotNo : String,
must_consume_from_inv : bool,
may_choose_alt_inv_loc : bool,
may_create_new_lots : bool
) : bool

Parameters

itemID
Holds the ID of the item being wasted.
itemDesc
Holds the description of the item being wasted.
storageEntID
Holds the ID of the entity in which the item is stored.
qty
Holds the default amount to waste.
bomPos
Holds the BOM position of the item being wasted.
lotNo
Holds the lot number of the item being wasted.

Wonderware Factelligence Client API Reference Guide

354

Chapter 4 API Classes

must_consume_from_inv
Holds a flag indicating whether the item must be consumed
from inventory.
may_choose_alt_inv_loc
Holds a flag indicating whether a new storage entity may
be selected.
may_create_new_lots
Holds a flag indicating whether a new lot number may be
selected.
Return Value

Returns true if the user wastes some of the item.

PopupCreateJobDialog() Method
The PopupCreateJobDialog() method opens a dialog to select
which item shortage on the current entity a work order must
be created for, and then opens the form for creating the work
order from the process used to create the item.
Syntax

[Visual Basic (Declaration)]


Public Function PopupCreateJobDialog() As Boolean

[C#]

public bool PopupCreateJobDialog()

[C++]

public:
bool PopupCreateJobDialog() sealed

[J#]

public bool PopupCreateJobDialog()

[JScript]
public

function PopupCreateJobDialog() : bool

Return Value

Returns true if a job is created or false if it is not.

PopupEditConsDlg() Method
The PopupEditConsDlg() method opens the Reclassify
consumption dialog which allows the user to reclassify a
portion of the consumption quantity entered for the item to a
different item reason. The quantity entered is removed from
the current consumption amount with the original item
reason and reclassified as consumption under a new item
reason.
Syntax

[Visual Basic (Declaration)]


Public Function PopupEditConsDlg( _

Wonderware Factelligence Client API Reference Guide

JobExec Class

ByVal itemID As String,

ByVal itemDesc As String,


ByVal rowID As Integer,
ByVal qty As Double,

355

ByVal lotNo As String,

ByVal storageID As Integer _


) As Boolean

[C#]

public bool PopupEditConsDlg(


string itemID,
string itemDesc,
int rowID,
double qty,
string lotNo,
int storageID
)

[C++]
public:
bool PopupEditConsDlg(
String itemID,
String itemDesc,
int rowID,
double qty,
String lotNo,
int storageID
) sealed

[J#]

public bool PopupEditConsDlg(


string itemID,
string itemDesc,
int rowID,
double qty,
string lotNo,
int storageID
)

[JScript]
public

function PopupEditConsDlg(

itemID : String,
itemDesc : String,
rowID : int,
qty : double,

Wonderware Factelligence Client API Reference Guide

356

Chapter 4 API Classes

lotNo : String,
storageID : int
) : bool

Parameters

itemID
Holds the item ID of the item that is being consumed.
itemDesc
Holds the item description of the item that is consumed.
rowID
Holds the row ID of the row in the item_cons table that
contains the consumption that is reclassified.
qty
Holds the quantity of consumption that can be split and
reclassified.
lotNo
Holds the lot number that contains the item that is
consumed. Pass empty string ("") if not used.
storageID
The storage location where reclassified consumption is
stored. Pass -1 if not used.

PopupEditProdDlg() Method (String, String,


Int32, String, Int32, Int32, DateTime, Boolean,
Double)
The PopupEditProdDlg() method opens the Reject Production
dialog to allow the user to change the reported production
reason for some or all of the reported quantity for a row in
the item_prod table.
Syntax

[Visual Basic (Declaration)]


Public Function PopupEditProdDlg( _
ByVal itemID As String,

ByVal itemDesc As String,


ByVal rowID As Integer,
ByVal lotNo As String,

_
_

ByVal reasCd As Integer,

ByVal storageID As Integer,


ByVal shiftStart As Date,
ByVal goodProd As Boolean,
ByVal qty As Double _
) As Boolean

Wonderware Factelligence Client API Reference Guide

_
_

JobExec Class

357

[C#]
public bool PopupEditProdDlg(
string itemID,
string itemDesc,
int rowID,
string lotNo,
int reasCd,
int storageID,
DateTime shiftStart,
bool goodProd,
double qty
)

[C++]
public:
bool PopupEditProdDlg(
String itemID,
String itemDesc,
int rowID,
String lotNo,
int reasCd,
int storageID,
DateTime shiftStart,
bool goodProd,
double qty
) sealed

[J#]

public bool PopupEditProdDlg(


string itemID,
string itemDesc,
int rowID,
string lotNo,
int reasCd,
int storageID,
DateTime shiftStart,
bool goodProd,
double qty
)

[JScript]
public

function PopupEditProdDlg(

itemID : String,

Wonderware Factelligence Client API Reference Guide

358

Chapter 4 API Classes

itemDesc : String,
rowID : int,
lotNo : String,
reasCd : int,
storageID : int,
shiftStart : DateTime,
goodProd : bool,
qty : double
) : bool

Parameters

itemID
Holds the ID of the item being produced.
itemDesc
Holds the description of the item being produced.
rowID
Holds the ID of the row in the item_prod table.
lotNo
Lot number of item.
reasCd
Holds the reason code for the production.
storageID
Holds the ID of the entity in which the material is stored.
shiftStart
Holds the start of the shift during which the production
occurred.
goodProd
Holds a flag specifying whether the production represents
good production.
qty
Holds the amount reported.
Return Value

Returns true if the user adjusts the production quantity.

PopupEditProdDlg() Method (String, String,


Int32, String, Int32, Int32, DateTime, Boolean,
Double, String)
The PopupEditProdDlg() method opens the Reject Production
dialog to allow the user to change the reported production
reason for some or all of the reported quantity for a row in
the item_prod table.

Wonderware Factelligence Client API Reference Guide

JobExec Class

359

Syntax

[Visual Basic (Declaration)]


Public Function PopupEditProdDlg( _
ByVal itemID As String,

ByVal itemDesc As String,


ByVal rowID As Integer,
ByVal lotNo As String,

_
_

ByVal reasCd As Integer,

ByVal storageID As Integer,


ByVal shiftStart As Date,
ByVal goodProd As Boolean,
ByVal qty As Double,

_
_

ByVal units As String _


) As Boolean

[C#]

public bool PopupEditProdDlg(


string itemID,
string itemDesc,
int rowID,
string lotNo,
int reasCd,
int storageID,
DateTime shiftStart,
bool goodProd,
double qty,
string units
)

[C++]
public:
bool PopupEditProdDlg(
String itemID,
String itemDesc,
int rowID,
String lotNo,
int reasCd,
int storageID,
DateTime shiftStart,
bool goodProd,
double qty,
String units

Wonderware Factelligence Client API Reference Guide

360

Chapter 4 API Classes

) sealed

[J#]

public bool PopupEditProdDlg(


string itemID,
string itemDesc,
int rowID,
string lotNo,
int reasCd,
int storageID,
DateTime shiftStart,
bool goodProd,
double qty,
string units
)

[JScript]
public

function PopupEditProdDlg(

itemID : String,
itemDesc : String,
rowID : int,
lotNo : String,
reasCd : int,
storageID : int,
shiftStart : DateTime,
goodProd : bool,
qty : double,
units : String
) : bool

Parameters

itemID
Holds the ID of the item being produced.
itemDesc
Holds the description of the item being produced.
rowID
Holds the ID of the row in the item_prod table.
lotNo
Holds the lot number.
reasCd
Holds the reason code for the production.
storageID
Holds the ID of the entity in which the material is stored.

Wonderware Factelligence Client API Reference Guide

JobExec Class

361

shiftStart
Holds the start of the shift during which the production
occurred.
goodProd
Holds a flag specifying whether the production represents
good production.
qty
Holds the amount reported.
units
Holds the description of the item's units.
Return Value

Returns true if the user adjusts the production quantity.

PopupJobEventDlg() Method
The PopupJobEventDlg() method opens the Job Event dialog
for the current job.
Syntax

[Visual Basic (Declaration)]


Public Function PopupJobEventDlg( _
ByVal lotNo As String,
ByVal user As User,

ByVal stepNo As Integer,


ByVal entID As Integer,

_
_

ByVal jobPos As Integer _


) As Boolean

[C#]

public bool PopupJobEventDlg(


string lotNo,
User user,
int stepNo,
int entID,
int jobPos
)

[C++]
public:
bool PopupJobEventDlg(
String lotNo,
User user,
int stepNo,
int entID,
int jobPos

Wonderware Factelligence Client API Reference Guide

362

Chapter 4 API Classes

) sealed

[J#]

public bool PopupJobEventDlg(


string lotNo,
User user,
int stepNo,
int entID,
int jobPos
)

[JScript]
public

function PopupJobEventDlg(

lotNo : String,
user : User,
stepNo : int,
entID : int,
jobPos : int
) : bool

Parameters

lotNo
Holds the lot number for the item currently being produced.
user
Holds the name of the current user.
stepNo
Holds the number of the current step.
entID
Holds the ID of the entity.
jobPos
The job position on the current entity at which the current
job is running. The job event being popped up is for the job
running at this job position.

PopupReduceConsDlg() Method
The PopupReduceConsDlg() method invokes the Reduce
Consumption dialog. This allows a user to adjust down the
amount of consumption reported in a row in the item_cons
table.
Syntax

[Visual Basic (Declaration)]


Public Function PopupReduceConsDlg( _
ByVal shiftStart As Date,
ByVal lotNo As String,

Wonderware Factelligence Client API Reference Guide

JobExec Class

ByVal itemID As String,

ByVal itemDesc As String,

ByVal shiftID As Integer,

ByVal reasCd As Integer,


ByVal reasDesc As String,
ByVal qty As Double,

363

_
_

ByVal storageEntID As Object,

ByVal storageEntDesc As String,


ByVal byProduct As Integer,
ByVal fgLotNo As String,

ByVal rowID As Integer _


) As Boolean

[C#]

public bool PopupReduceConsDlg(


DateTime shiftStart,
string lotNo,
string itemID,
string itemDesc,
int shiftID,
int reasCd,
string reasDesc,
double qty,
object storageEntID,
string storageEntDesc,
int byProduct,
string fgLotNo,
int rowID
)

[C++]
public:
bool PopupReduceConsDlg(
DateTime shiftStart,
String lotNo,
String itemID,
String itemDesc,
int shiftID,
int reasCd,
String reasDesc,
double qty,
Object storageEntID,

Wonderware Factelligence Client API Reference Guide

364

Chapter 4 API Classes

String storageEntDesc,
int byProduct,
String fgLotNo,
int rowID
) sealed

[J#]

public bool PopupReduceConsDlg(


DateTime shiftStart,
string lotNo,
string itemID,
string itemDesc,
int shiftID,
int reasCd,
string reasDesc,
double qty,
object storageEntID,
string storageEntDesc,
int byProduct,
string fgLotNo,
int rowID
)

[JScript]
public

function PopupReduceConsDlg(

shiftStart : DateTime,
lotNo : String,
itemID : String,
itemDesc : String,
shiftID : int,
reasCd : int,
reasDesc : String,
qty : double,
storageEntID : Object,
storageEntDesc : String,
byProduct : int,
fgLotNo : String,
rowID : int
) : bool

Parameters

shiftStart
Holds the start time of the shift during which the
consumption took place.

Wonderware Factelligence Client API Reference Guide

JobExec Class

365

lotNo
Holds the lot number consumed.
itemID
Holds the ID of the item consumed.
itemDesc
Holds the description of the item consumed.
shiftID
Holds the ID of the shift during which the consumption took
place.
reasCd
Holds the code of the consumption reason.
reasDesc
Holds the description of the consumption reason.
qty
Holds the amount consumed.
storageEntID
Holds the ID of the entity from which the item was
consumed.
storageEntDesc
Holds the name of the entity from which the item was
consumed.
byProduct
Holds a integer value representing a true or false(1 for true,
0 for false) as to whether the item is a by product.
fgLotNo
Holds the lot number of the item produced.
rowID
Holds the row ID of the item_cons row.
Return Value

Returns true if the reduces consumption.

PopupReduceProdDlg() Method (DateTime,


String, String, String, Int32, Int32, String,
Double, Double, Double, Object, String, Int32,
Boolean)
The PopupReduceProdDlg() method opens the Reduce
Production dialog if the item is not serialized, and the
serialized add production dialog if the item is serialized, with
the Completed list of serial numbers displayed. Both dialogs
allows the user to adjust down the amount of production
reported in a row in the item_prod table.

Wonderware Factelligence Client API Reference Guide

366

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Function PopupReduceProdDlg( _
ByVal shiftStart As Date,
ByVal lotNo As String,

ByVal itemID As String,

ByVal itemDesc As String,

ByVal shiftID As Integer,

ByVal reasCd As Integer,

ByVal reasDesc As String,


ByVal qty As Double,

ByVal rejQty As Double,

ByVal startQty As Double,

ByVal storageEntID As Object,

ByVal storageEntDesc As String,


ByVal byProduct As Integer,

ByVal isSerialized As Boolean _


) As Boolean

[C#]

public bool PopupReduceProdDlg(


DateTime shiftStart,
string lotNo,
string itemID,
string itemDesc,
int shiftID,
int reasCd,
string reasDesc,
double qty,
double rejQty,
double startQty,
object storageEntID,
string storageEntDesc,
int byProduct,
bool isSerialized
)

[C++]
public:
bool PopupReduceProdDlg(
DateTime shiftStart,
String lotNo,

Wonderware Factelligence Client API Reference Guide

JobExec Class

367

String itemID,
String itemDesc,
int shiftID,
int reasCd,
String reasDesc,
double qty,
double rejQty,
double startQty,
Object storageEntID,
String storageEntDesc,
int byProduct,
bool isSerialized
) sealed

[J#]

public bool PopupReduceProdDlg(


DateTime shiftStart,
string lotNo,
string itemID,
string itemDesc,
int shiftID,
int reasCd,
string reasDesc,
double qty,
double rejQty,
double startQty,
object storageEntID,
string storageEntDesc,
int byProduct,
bool isSerialized
)

[JScript]
public

function PopupReduceProdDlg(

shiftStart : DateTime,
lotNo : String,
itemID : String,
itemDesc : String,
shiftID : int,
reasCd : int,
reasDesc : String,
qty : double,

Wonderware Factelligence Client API Reference Guide

368

Chapter 4 API Classes

rejQty : double,
startQty : double,
storageEntID : Object,
storageEntDesc : String,
byProduct : int,
isSerialized : bool
) : bool

Parameters

shiftStart
Holds the start of the shift during which the item was
produced.
lotNo
Holds the lot number of the produced row.
itemID
Holds the ID of the item produced.
itemDesc
Holds the description of the item produced.
shiftID
Holds the ID of the shift during which the item was
produced.
reasCd
Holds the production reason code given when the item was
produced.
reasDesc
Holds the production reason description given when the
item was produced.
qty
Holds the amount produced.
rejQty
Holds the amount rejected.
startQty
Holds the amount at the start.
storageEntID
Holds the ID of the entity in which the produced item were
stored.
storageEntDesc
Holds the name of the entity in which the produced item
were stored.
byProduct
Holds a flag indicating whether or not the item is a by
product.

Wonderware Factelligence Client API Reference Guide

JobExec Class

369

isSerialized
Holds a flag indicating whether the item is serialized.
Return Value

Returns true if the user reduces the quantity.

PopupReduceProdDlg() Method (DateTime,


String, String, String, Int32, Int32, String,
Double, Object, String, Int32)
The PopupReduceProdDlg() method opens the Reduce
Production dialog. This dialog allows the user to adjust down
the amount of production reported in a row in the item_prod
table.
Syntax

[Visual Basic (Declaration)]


Public Function PopupReduceProdDlg( _
ByVal shiftStart As Date,
ByVal lotNo As String,

ByVal itemID As String,

ByVal itemDesc As String,

ByVal shiftID As Integer,

ByVal reasCd As Integer,


ByVal reasDesc As String,
ByVal qty As Double,

_
_

ByVal storageEntID As Object,

ByVal storageEntDesc As String,

ByVal byProduct As Integer _


) As Boolean

[C#]

public bool PopupReduceProdDlg(


DateTime shiftStart,
string lotNo,
string itemID,
string itemDesc,
int shiftID,
int reasCd,
string reasDesc,
double qty,
object storageEntID,
string storageEntDesc,
int byProduct

Wonderware Factelligence Client API Reference Guide

370

Chapter 4 API Classes

[C++]
public:
bool PopupReduceProdDlg(
DateTime shiftStart,
String lotNo,
String itemID,
String itemDesc,
int shiftID,
int reasCd,
String reasDesc,
double qty,
Object storageEntID,
String storageEntDesc,
int byProduct
) sealed

[J#]

public bool PopupReduceProdDlg(


DateTime shiftStart,
string lotNo,
string itemID,
string itemDesc,
int shiftID,
int reasCd,
string reasDesc,
double qty,
object storageEntID,
string storageEntDesc,
int byProduct
)

[JScript]
public

function PopupReduceProdDlg(

shiftStart : DateTime,
lotNo : String,
itemID : String,
itemDesc : String,
shiftID : int,
reasCd : int,
reasDesc : String,
qty : double,
storageEntID : Object,

Wonderware Factelligence Client API Reference Guide

JobExec Class

371

storageEntDesc : String,
byProduct : int
) : bool

Parameters

shiftStart
Holds the start of the shift during which the item was
produced.
lotNo
Holds the lot number of the produced row of which the item
is a part.
itemID
Holds the ID of the item produced.
itemDesc
Holds the description of the item produced.
shiftID
Holds the ID of the shift during which the item was
produced.
reasCd
Holds the production reason code given when the item was
produced.
reasDesc
Holds the production reason description given when the
item was produced.
qty
Holds the amount produced.
storageEntID
Holds the ID of the entity in which the produced item were
stored.
storageEntDesc
Holds the name of the entity in which the produced item
were stored.
byProduct
Holds a flag indicating whether or not the item is a by
product.
Return Value

Returns true if the user reduces the quantity.

PopupSetConsLotDataDlg() Method
The PopupSetConsLotDataDlg() method opens the Set Lot
Data dialog for consumption. The dialog allows the user to
set the lot number for the consumed item and the entity in
which the item is to be stored.

Wonderware Factelligence Client API Reference Guide

372

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Function PopupSetConsLotDataDlg( _
ByVal woID As String,

ByVal operID As String,

ByVal seqNo As Integer,

ByVal lotNo As String,


ByVal itemID As String,

_
_

ByVal itemDesc As String,

ByVal bomPos As Integer _


) As Boolean

[C#]

public bool PopupSetConsLotDataDlg(


string woID,
string operID,
int seqNo,
string lotNo,
string itemID,
string itemDesc,
int bomPos
)

[C++]
public:
bool PopupSetConsLotDataDlg(
String woID,
String operID,
int seqNo,
String lotNo,
String itemID,
String itemDesc,
int bomPos
) sealed

[J#]

public bool PopupSetConsLotDataDlg(


string woID,
string operID,
int seqNo,
string lotNo,
string itemID,
string itemDesc,
int bomPos

Wonderware Factelligence Client API Reference Guide

JobExec Class

373

[JScript]
public

function PopupSetConsLotDataDlg(

woID : String,
operID : String,
seqNo : int,
lotNo : String,
itemID : String,
itemDesc : String,
bomPos : int
) : bool

Parameters

woID
Holds the work order ID of the job where the item was
consumed.
operID
Holds the operation ID of the job where the item was
consumed.
seqNo
Holds the operation sequence number of the job where the
item was consumed.
lotNo
Holds the current lot number.
itemID
Holds the ID of the item being consumed.
itemDesc
Holds the description of the item being consumed.
bomPos
Holds the BOM position of the item being consumed.
Return Value

Returns true if the user sets the lot data.

PopupSetProdLotDataDlg() Method
The PopupSetProdLotDataDlg() method opens the Set Lot
Data dialog for production. The dialog allows the user to set
the item being produced, the lot number for the produced
item, and the entity in which the item is to be stored.
Syntax

[Visual Basic (Declaration)]


Public Function PopupSetProdLotDataDlg( _
ByVal lotNo As String,

Wonderware Factelligence Client API Reference Guide

374

Chapter 4 API Classes

ByVal itemID As String,

ByVal itemDesc As String,

ByVal bomPos As Integer _


) As Boolean

[C#]

public bool PopupSetProdLotDataDlg(


string lotNo,
string itemID,
string itemDesc,
int bomPos
)

[C++]
public:
bool PopupSetProdLotDataDlg(
String lotNo,
String itemID,
String itemDesc,
int bomPos
) sealed

[J#]

public bool PopupSetProdLotDataDlg(


string lotNo,
string itemID,
string itemDesc,
int bomPos
)

[JScript]
public

function PopupSetProdLotDataDlg(

lotNo : String,
itemID : String,
itemDesc : String,
bomPos : int
) : bool

Parameters

lotNo
Holds the current lot number.
itemID
Holds the ID of the item currently being produced.
itemDesc
Holds the description of the item currently being produced.

Wonderware Factelligence Client API Reference Guide

JobExec Class

375

bomPos
Holds the BOM position of the item currently being
produced.
Return Value

Returns true if the user sets the lot data.

ReadyJob() Method
The ReadyJob() method changes the state of the specified job
to Ready. A job is specified by a work order ID, an operation
ID, and an operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Sub ReadyJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal editTime As String _


)

[C#]
public void ReadyJob(
string woId,
string operId,
int seqNo,
string editTime
)

[C++]
public:
void ReadyJob(
String woId,
String operId,
int seqNo,
String editTime
) sealed

[J#]

public void ReadyJob(


string woId,
string operId,
int seqNo,
string editTime
)

[JScript]

Wonderware Factelligence Client API Reference Guide

376

Chapter 4 API Classes

public

function ReadyJob(

woId : String,
operId : String,
seqNo : int,
editTime : String
)

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
editTime
Holds the timestamp for the last edit of this job. If this does
not match the timestamp currently in the database, the job
cannot be changed.
Exceptions

An exception is thrown if the job cannot be readied.

Refresh() Method
The Refresh() method reloads this JobExec's dynamic data
from the Factelligence database.
Syntax

[Visual Basic (Declaration)]


Public Sub Refresh()

[C#]

public void Refresh()

[C++]

public:
void Refresh() sealed

[J#]

public void Refresh()

[JScript]
public

function Refresh()

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

Wonderware Factelligence Client API Reference Guide

JobExec Class

377

RejectProd() Method
The RejectProd() method marks previously reported
production as rejected.
Syntax

[Visual Basic (Declaration)]


Public Sub RejectProd( _
ByVal rowID As String,

ByVal rejectQty As Double,


ByVal newReasCd As Long,

ByVal newItemID As String,


ByVal newLotNo As String,
ByVal newUserID As String,

_
_
_

ByVal newEntID As Object _


)

[C#]
public void RejectProd(
string rowID,
double rejectQty,
long newReasCd,
string newItemID,
string newLotNo,
string newUserID,
object newEntID
)

[C++]
public:
void RejectProd(
String rowID,
double rejectQty,
__int64 newReasCd,
String newItemID,
String newLotNo,
String newUserID,
Object newEntID
) sealed

[J#]

public void RejectProd(


string rowID,
double rejectQty,
long newReasCd,

Wonderware Factelligence Client API Reference Guide

378

Chapter 4 API Classes

string newItemID,
string newLotNo,
string newUserID,
object newEntID
)

[JScript]
public

function RejectProd(

rowID : String,
rejectQty : double,
newReasCd : long,
newItemID : String,
newLotNo : String,
newUserID : String,
newEntID : Object
)

Parameters

rowID
Identifies the row being marked as rejected.
rejectQty
Identifies the amount of rejected material in the row.
newReasCd
Identifies the reason code for the rejected material.
newItemID
Holds an optional new Item ID for the rejected material. Set
to null if not used.
newLotNo
Holds an optional new lot number for the rejected material.
Set to null if not used.
newUserID
Holds an optional new user ID for the rejected material. Set
to null if not used.
newEntID
Holds an optional new storage location for the rejected
material. Set to null if not used.
Exception

An exception is thrown if the production cannot be rejected.

SetCurLotdata() Method
The SetCurLotdata() method sets the current lot information
for the running job.

Wonderware Factelligence Client API Reference Guide

JobExec Class

379

Syntax

[Visual Basic (Declaration)]


Public Sub SetCurLotdata( _
ByVal bomPos As Object,

ByVal itemID As String,

ByVal lotNo As String,


ByVal reasCd As Object,

_
_

ByVal storageEntID As Object,


ByVal updateInv As Object,

ByVal backFlush As Object _


)

[C#]
public void SetCurLotdata(
object bomPos,
string itemID,
string lotNo,
object reasCd,
object storageEntID,
object updateInv,
object backFlush
)

[C++]
public:
void SetCurLotdata(
Object bomPos,
String itemID,
String lotNo,
Object reasCd,
Object storageEntID,
Object updateInv,
Object backFlush
) sealed

[J#]

public void SetCurLotdata(


object bomPos,
string itemID,
string lotNo,
object reasCd,
object storageEntID,
object updateInv,
object backFlush

Wonderware Factelligence Client API Reference Guide

380

Chapter 4 API Classes

[JScript]
public

function SetCurLotdata(

bomPos : Object,
itemID : String,
lotNo : String,
reasCd : Object,
storageEntID : Object,
updateInv : Object,
backFlush : Object
)

Parameters

bomPos
Holds the BOM position for the item that is stored at the
current lot. Set to null if not being used.
itemID
Holds the item ID for the item that is stored at the current
lot. Set to null if not being used.
lotNo
Holds the lot number for the current information is entered.
Set to null to use the lot where the item being produced is
stored.
reasCd
Holds the item reason code. Set to null or -1 if not being
used.
storageEntID
Holds the ID of the storage entity. Set to null or -1 if not
being used.
updateInv
Holds a flag to tell whether or not inventory is being
updated. Set to null if not being used.
backFlush
Holds a flag to tell whether or not consumption is being
backflushed. Set to null if not being used.
Exceptions

An exception is thrown if the an error occurs while updating


the database.

SetUIScreenTagValues() Method
The SetUIScreenTagValues method sets the factory connector
tags for the Production controls screen values.

Wonderware Factelligence Client API Reference Guide

JobExec Class

381

Syntax

[Visual Basic (Declaration)]


Public Sub SetUIScreenTagValues( _
ByVal row As DataRow _
)

[C#]
public void SetUIScreenTagValues(
DataRow row
)

[C++]
public:
void SetUIScreenTagValues(
DataRow row
) sealed

[J#]

public void SetUIScreenTagValues(


DataRow row
)

[JScript]
public

function SetUIScreenTagValues(

row : DataRow
)

Parameter

row
Holds the selected row in the production control from which
the values are retrieved to updated the factory connector
tags.
Exceptions

An exception is thrown if an error occurs while updating the


value in the databsase.

StartDataEntryJob() Method
The StartDataEntryJob() method starts the specified data
entry job on the current entity. A Data Entry job is a job
created on the fly on the shop floor. It is specified by
supplying a work order ID and an operation ID. Since no
BOM 0 record exist, an item must be specified along with a
default production rate, and optionally the ID for the unit of
measure used for the item.
Syntax

[Visual Basic (Declaration)]


Public Sub StartDataEntryJob( _

Wonderware Factelligence Client API Reference Guide

382

Chapter 4 API Classes

ByVal woId As String,

ByVal operId As String,

ByVal itemId As String,

ByVal estProdRate As Double,

ByVal estProdRateUOM As Integer,


ByVal flag As String,

ByVal optionalUomId As Object _


)

[C#]
public void StartDataEntryJob(
string woId,
string operId,
string itemId,
double estProdRate,
int estProdRateUOM,
string flag,
object optionalUomId
)

[C++]
public:
void StartDataEntryJob(
String woId,
String operId,
String itemId,
double estProdRate,
int estProdRateUOM,
String flag,
Object optionalUomId
) sealed

[J#]

public void StartDataEntryJob(


string woId,
string operId,
string itemId,
double estProdRate,
int estProdRateUOM,
string flag,
object optionalUomId
)

[JScript]
public

function StartDataEntryJob(

Wonderware Factelligence Client API Reference Guide

JobExec Class

383

woId : String,
operId : String,
itemId : String,
estProdRate : double,
estProdRateUOM : int,
flag : String,
optionalUomId : Object
)

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
itemId
Holds the ID of the item being produced by the job.
estProdRate
Holds the estimated production rate.
estProdRateUOM
Holds the unit of measure for the production rate.
optionalUomId
Optionally holds the ID for an unit of measure. Set to null if
not supplied.
Exceptions

An exception is thrown if the job cannot be created for any


reason.

StartJob() Method
The StartJob() method starts the specified job on the entity. A
job is specified by a work order ID, an operation ID, and an
operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Sub StartJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal statusNotes As String _


)

[C#]
public void StartJob(
string woId,

Wonderware Factelligence Client API Reference Guide

384

Chapter 4 API Classes

string operId,
int seqNo,
string statusNotes
)

[C++]
public:
void StartJob(
String woId,
String operId,
int seqNo,
String statusNotes
) sealed

[J#]

public void StartJob(


string woId,
string operId,
int seqNo,
string statusNotes
)

[JScript]
public

function StartJob(

woId : String,
operId : String,
seqNo : int,
statusNotes : String
)

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
statusNotes
Holds notes explaining why the job is being started. An
empty string may be passed.
Exceptions

An exception is thrown if the job cannot be started for any


reason.

Wonderware Factelligence Client API Reference Guide

JobExec Class

385

UnreadyJob() Method
The UnreadyJob method changes the state of the specified job
to New. A job is specified by a work order ID, an operation
ID, and an operation sequence number.
Syntax

[Visual Basic (Declaration)]


Public Sub UnreadyJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer,

ByVal editTime As String _


)

[C#]
public void UnreadyJob(
string woId,
string operId,
int seqNo,
string editTime
)

[C++]
public:
void UnreadyJob(
String woId,
String operId,
int seqNo,
String editTime
) sealed

[J#]

public void UnreadyJob(


string woId,
string operId,
int seqNo,
string editTime
)

[JScript]
public

function UnreadyJob(

woId : String,
operId : String,
seqNo : int,
editTime : String
)

Wonderware Factelligence Client API Reference Guide

386

Chapter 4 API Classes

Parameters

woId
Holds the job's work order ID.
operId
Holds the job's operation ID.
seqNo
Holds the job's operation sequence number.
editTime
Holds the timestamp for the last edit of this job. If this does
not match the timestamp currently in the database, the job
cannot be changed.
Exceptions

An exception is thrown if the job cannot be made unready.

AllowZeroQtySplit Property
The AllowZeroQtySplit property is a read-only property which
uses the Allow Zero Qty Split flag to determine if the start
quantity of a job created from splitting another job can be
zero.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property AllowZeroQtySplit As
Boolean

[C#]

public bool AllowZeroQtySplit { get; }

[C++]

public property bool AllowZeroQtySplit sealed


bool get();
}

[[J#] ]

/** property */
public bool get_AllowZeroQtySplit();

[[JScript] ]

public function get AllowZeroQtySplit() : bool

AutoAllocateQtyToRunningJob Property
The AutoAllocateQtyToRunningJob property is a read-only
property that uses the Auto Allocate Qty to Running Job flag
to determine if quantities from the original job's quantity
that is left to be produced can be allocated to a job split off.
Syntax

[[Visual Basic (Declaration)] ]

Wonderware Factelligence Client API Reference Guide

JobExec Class

387

Public ReadOnly Property


AutoAllocateQtyToRunningJob As Boolean

[C#]

public bool AutoAllocateQtyToRunningJob { get; }

[C++]

public property bool AutoAllocateQtyToRunningJob


sealed {
bool get();
}

[J#]

/** property */
public bool get_AutoAllocateQtyToRunningJob();

[JScript]

public function get AutoAllocateQtyToRunningJob() :


bool

CanRunWithoutOperator Property
The CanRunWithoutOperator property is a read-only property
that determines if the current job can continue to run if an
operator is not logged onto the job.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CanRunWithoutOperator As
Boolean

[C#]

public bool CanRunWithoutOperator { get; }

[C++]

public property bool CanRunWithoutOperator sealed


bool get();
}

[J#]

/** property */
public bool get_CanRunWithoutOperator();

[JScript]

public function get CanRunWithoutOperator() : bool

CertExecObject Property
The CertExecObject property is a read-only property which
exposes the Cert Exec object to give access to certification
information. The Cert Exec object determines if a job
requires certifications, and if so, what ones and what level of
certification the user needs to have in order to sign off on this
job.
Syntax

[[Visual Basic (Declaration)] ]

Wonderware Factelligence Client API Reference Guide

388

Chapter 4 API Classes

Public ReadOnly Property CertExecObject As CertExec

[C#]

public CertExec CertExecObject { get; }

[C++]

public property CertExec CertExecObject sealed


CertExec get();
}

[J#]

/** property */
public CertExec get_CertExecObject();

[JScript]

public function get CertExecObject() : CertExec

CurGoodQty Property
The CurGoodQty property is a read-only property which
exposes the current good quantity.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurGoodQty As Double

[C#]

public double CurGoodQty { get; }

[C++]

public property double CurGoodQty sealed


double get();
}

[J#]

/** property */
public double get_CurGoodQty();

[JScript]

public function get CurGoodQty() : double

CurJobState Property
The CurJobState property is a read-only property which
exposes the current job state.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CurJobState As JobStates

[C#]

public JobStates CurJobState { get; }

[C++]

public property JobStates CurJobState sealed


JobStates get();
}

[J#]

Wonderware Factelligence Client API Reference Guide

JobExec Class

389

/** property */
public JobStates get_CurJobState();

[JScript]

public function get CurJobState() : JobStates

CurOperId Property
The CurOperId property is a read-only property which
exposes the current Operation ID running on this JobExec
object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurOperId As String

[C#]

public string CurOperId { get; }

[C++]

public property string CurOperId sealed


String get();
}

[J#]

/** property */
public string get_CurOperId();

[JScript]

public function get CurOperId() : String

CurRejectQty Property
The CurRejectQty property is a read-only property which
exposes the current reject quantity.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurRejectQty As Double

[C#]

public double CurRejectQty { get; }

[C++]

public property double CurRejectQty sealed


double get();
}

[J#]

/** property */
public double get_CurRejectQty();

[JScript]

public function get CurRejectQty() : double

Wonderware Factelligence Client API Reference Guide

390

Chapter 4 API Classes

CurSeqNo Property
The CurSeqNo property is a read-only property which exposes
the current sequence number of the job running on this
JobExec object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurSeqNo As Integer

[C#]

public int CurSeqNo { get; }

[C++]

public property int CurSeqNo sealed


int get();
}

[J#]

/** property */
public int get_CurSeqNo();

[JScript]

public function get CurSeqNo() : int

CurWOId Property
The CurWOId property read-only property exposing the
current work order running on this JobExec object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property CurWOId As String

[C#]

public string CurWOId { get; }

[C++]

public property string CurWOId sealed


String get();
}

[J#]

/** property */
public string get_CurWOId();

[JScript]

public function get CurWOId() : String

DefConsReasCD Property
The DefConsReasCD property is a read-only property which
exposes the default consumption reason code for this JobExec
object instance.

Wonderware Factelligence Client API Reference Guide

JobExec Class

391

Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefConsReasCD As Integer

[C#]

public int DefConsReasCD { get; }

[C++]

public property int DefConsReasCD sealed


int get();
}

[J#]

/** property */
public int get_DefConsReasCD();

[JScript]

public function get DefConsReasCD() : int

DefConsReasDesc Property
The DefConsReasDesc property is a read-only property which
exposes the default consumption reason description for this
JobExec object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefConsReasDesc As String

[C#]

public string DefConsReasDesc { get; }

[C++]

public property string DefConsReasDesc sealed


String get();
}

[J#]

/** property */
public string get_DefConsReasDesc();

[JScript]

public function get DefConsReasDesc() : String

DefFromEntID Property
The DefFromEntID property is a read-only property which
exposes the ID of the default entity from which items is
consumed for this JobExec object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefFromEntID As Integer

[C#]

public int DefFromEntID { get; }

Wonderware Factelligence Client API Reference Guide

392

Chapter 4 API Classes

[C++]
public property int DefFromEntID sealed
int get();
}

[J#]

/** property */
public int get_DefFromEntID();

[JScript]

public function get DefFromEntID() : int

DefFromEntName Property
The DefFromEntName property is a read-only property which
exposes the Default From Ent Name for this JobExec object
instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefFromEntName As String

[C#]

public string DefFromEntName { get; }

[C++]

public property string DefFromEntName sealed


String get();
}

[J#]

/** property */
public string get_DefFromEntName();

[JScript]

public function get DefFromEntName() : String

DefLotNo Property
The DefLotNo property is a read-only property which exposes
the default lot number.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefLotNo As String

[C#]

public string DefLotNo { get; }

[C++]

public property string DefLotNo sealed


String get();
}

[J#]

/** property */
public string get_DefLotNo();

Wonderware Factelligence Client API Reference Guide

JobExec Class

393

[JScript]
public function get DefLotNo() : String

DefProdReasCD Property
The DefProdReasCD property is a read-only property which
exposes the default production reason code for this JobExec
object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefProdReasCD As Integer

[C#]

public int DefProdReasCD { get; }

[C++]

public property int DefProdReasCD sealed


int get();
}

[J#]

/** property */
public int get_DefProdReasCD();

[JScript]

public function get DefProdReasCD() : int

DefToEntID Property
The DefToEntID property read-only property which exposes
the Default To Ent ID for this JobExec object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefToEntID As Integer

[C#]

public int DefToEntID { get; }

[C++]

public property int DefToEntID sealed


int get();
}

[J#]

/** property */
public int get_DefToEntID();

[JScript]

public function get DefToEntID() : int

DefToEntName Property
The DefToEntName property is a read-only property exposing
the Default To Ent Name for this JobExec object instance.

Wonderware Factelligence Client API Reference Guide

394

Chapter 4 API Classes

Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property DefToEntName As String

[C#]

public string DefToEntName { get; }

[C++]

public property string DefToEntName sealed


String get();
}

[J#]

/** property */
public string get_DefToEntName();

[JScript]

public function get DefToEntName() : String

JobPos Property
The JobPos property is a read-only property which exposes
the job position on the entity for this JobExec object instance.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property JobPos As Integer

[C#]

public int JobPos { get; }

[C++]

public property int JobPos sealed


int get();
}

[J#]

/** property */
public int get_JobPos();

[JScript]

public function get JobPos() : int

JobStepExecObject Property
The JobStepExecObject property is a read-only property
which exposes the JobStepExec object. A JobStepExec object
is created for a job running at this job position if the job has
defined steps.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property JobStepExecObject As
JobStepExec

[C#]

Wonderware Factelligence Client API Reference Guide

JobExec Class

395

public JobStepExec JobStepExecObject { get; }

[C++]

public property JobStepExec JobStepExecObject


sealed {
JobStepExec get();
}

[J#]

/** property */
public JobStepExec get_JobStepExecObject();

[JScript]

public function get JobStepExecObject() :


JobStepExec

SpecExecObject Property
The SpecExecObject property is a read-only property that
exposes the SpecExec object. A SpecExec object is created for
the job running at this job position if the job can gather
specifications.
Syntax

[[Visual Basic (Declaration)]]


Public ReadOnly Property SpecExecObject As SpecExec

[C#]

public SpecExec SpecExecObject { get; }

[C++]

public property SpecExec SpecExecObject sealed


SpecExec get();
}

[J#]

/** property */
public SpecExec get_SpecExecObject();

[JScript]

public function get SpecExecObject() : SpecExec

SuppressStartSomeQtyPrompt Property
The SuppressStartSomeQtyPrompt property is a read-only
property that, when the request to start some of a job is
made, determines whether to present the Start Some dialog or
to use default quantity values.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property SuppressStartSomeQtyPrompt
As Boolean

[C#]

public bool SuppressStartSomeQtyPrompt { get; }

Wonderware Factelligence Client API Reference Guide

396

Chapter 4 API Classes

[C++]
public property bool SuppressStartSomeQtyPrompt
sealed {
bool get();
}

[J#]

/** property */
public bool get_SuppressStartSomeQtyPrompt();

[JScript]

public function get SuppressStartSomeQtyPrompt() :


bool

UserLoggedIn Property
The UserLoggedIn property is a read-only property that
exposes a flag that specifies whether the current user is
logged on to Factelligence.
Syntax

[[Visual Basic (Declaration)] ]


Public Property UserLoggedIn As Boolean

[C#]

public bool UserLoggedIn { get; set; }

[C++]

public property bool UserLoggedIn sealed


bool get();
void set(bool value);
}

[J#]

/** property */
public bool get_UserLoggedIn();
/** property */
public void set_UserLoggedIn(bool value);

[JScript]

public function get UserLoggedIn() : bool


public function set UserLoggedIn(value : bool);

LangStrings Class
The LangStrings class stores all static strings for a
Factelligence language in a client side cache. An instance is
created for each different language required by all logged in
users. Client applications use the Translate() function to
translate a specific string.

Wonderware Factelligence Client API Reference Guide

LangStrings Class

397

LangStrings Constructor
Constructor for creating a LanguageString object for a
particular language ID. The strings may optionally retain
their IDs for translation purposes.
Syntax

Visual Basic (Declaration)

C#

Public Sub New( _


ByVal langId As Integer, _
ByVal appendIds As Boolean _
)
public LangStrings(
int langId,
bool appendIds
)

C++

J#

public:
LangStrings(
int langId,
bool appendIds
) sealed
public LangStrings(
int langId,
bool appendIds
)

JScript

public function LangStrings(


langId : int,
appendIds : bool
)

Parameters

langId
Holds the ID of the language to use.
appendIds
Set if the string IDs should be appended to the end of the
string after translating.

LangStrings Constructor
Constructor for creating a LanguageString object for a
particular language ID for a particular set of strings. The
strings may optionally retain their IDs for translation
purposes. This class can be used to load a small set of know
strings to speed up the loading of the language.
Syntax

Visual Basic (Declaration)

Wonderware Factelligence Client API Reference Guide

398

Chapter 4 API Classes

C#

Public Sub New( _


ByVal langId As Integer, _
ByVal appendIds As Boolean, _
ByVal stringIDs As Integer() _
)
public LangStrings(
int langId,
bool appendIds,
int[] stringIDs
)

C++

J#

public:
LangStrings(
int langId,
bool appendIds,
array<int>^ stringIDs
) sealed
public LangStrings(
int langId,
bool appendIds,
int[] stringIDs
)

JScript

public function LangStrings(


langId : int,
appendIds : bool,
stringIDs : int[]
)

Parameters

langId
Holds the ID of the language to use.
appendIds
Set if the string IDs should be appended to the end of the
string after translating.
stringIDs
Hold an array of string IDs to be loaded. This allows loading
a portion of the language table.

GetLanguages() Method
The GetLanguages() method returns the name of all the
languages which are defined for the system.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetLanguages() As DataSet

[C#]

Wonderware Factelligence Client API Reference Guide

LangStrings Class

399

public static DataSet GetLanguages()

[C++]

public:
static DataSet GetLanguages()

[J#]

public static DataSet GetLanguages()

[JScript]

public static

function GetLanguages() : DataSet

Return Value

Returns a DataSet with a row for every entry in the


language table where string_id = 1.

Translate() Method
Client applications call the Translate() function to translate a
specific string using the id of the string which is provided
with the string as <id> at the end of the string, and the
language ID of the user.
The input string must have the string ID included. If the
string ID cannot be found in the language table to translate
the string, the string that was passed in returns with the
<id> removed from the end of it.
Syntax

[Visual Basic (Declaration)]


Public Function Translate( _
ByVal inputString As String _
) As String _

[C#]

Implements ILanguageStrings.Translate

public string Translate(


string inputString
)

[C++]
public:
String Translate(
String inputString
) sealed

[J#]

public string Translate(


string inputString
)

[JScript]
public

function Translate(

Wonderware Factelligence Client API Reference Guide

400

Chapter 4 API Classes

inputString : String
) : String

Parameter

inputString
Holds the string to translate. The string must end with
<id> where ID is the number representing the string ID.
Return Value

Returns the translated string if the string ID is found, or


the passed in string is returned if the string ID is not found.
If the LanguageStrings object was setup to append the
string IDs, the returned string has the string ID appended
to the end in the same format as it was passed in. If the
Language string object was not set up to append the string
ID, the string is returned with no string ID. appended.

Implements

ILanguageStrings.Translate

LangID Property
The LangID property exposes the current language ID.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property LangID As Integer

[C#]

public int LangID { get; }

[C++]

public property int LangID sealed


int get();
}

[J#]

/** property */
public int get_LangID();

[JScript]

public function get LangID() : int

LicenseInfo Class
This class reads the current License Information from the
Factelligence middleware on initialization. The maximum
sessions for each client type and the modules licensed can be
accessed through this class.

Wonderware Factelligence Client API Reference Guide

LicenseInfo Class

401

MaxSessions() Method
The MaxSessions() method returns the maximum number of
concurrent sessions of the specified client type that have
been licensed. The client type is one of the types from the
ClientTypes enumeration which signifies the client that is
currently using the session. Examples of client types include
Operator and DataEditor.
Syntax

[Visual Basic (Declaration)]


Public Function MaxSessions( _
ByVal clientType As ClientTypes _
) As Integer

[C#]

public int MaxSessions(


ClientTypes clientType
)

[C++]
public:
int MaxSessions(
ClientTypes clientType
) sealed

[J#]

public int MaxSessions(


ClientTypes clientType
)

[JScript]
public

function MaxSessions(

clientType : ClientTypes
) : int

Return Value

Returns an integer representing the maximum number of


concurrent sessions.

ModuleLicensed() Method
The ModuleLicensed() method returns whether or not the
specified module is licensed.
Syntax

[Visual Basic (Declaration)]


Public Function ModuleLicensed( _
ByVal functModule As FunctionalModules _
) As Boolean

Wonderware Factelligence Client API Reference Guide

402

Chapter 4 API Classes

[C#]
public bool ModuleLicensed(
FunctionalModules functModule
)

[C++]
public:
bool ModuleLicensed(
FunctionalModules functModule
) sealed

[J#]

public bool ModuleLicensed(


FunctionalModules functModule
)

[JScript]
public

function ModuleLicensed(

functModule : FunctionalModules
) : bool

Return Value

Returns true if the module is licensed or false if the module


is not licensed.

OEEExec Class
The OEEExec class provides a means for using OEE in the
Factelligence MES. An instance of this class is created every
time a user logs into an entity that can track OEE.

GetValue() Method
The GetValue() method returns the current value for the
specified KPI type.
Syntax

[Visual Basic (Declaration)]


Public Function GetValue ( _
ByValue kPIType As KPIType, _
ByValue filterType As FilterType, _
ByValue filterDuration As Integer, _
ByValue filterTimeUnit As FilterTimeUnit, _
ByValue filterTimeStart As Integer, _
ByValue filterTimeEnd As Integer
)

As Double

[C#]

Wonderware Factelligence Client API Reference Guide

OEEExec Class

403

public double GetValue (


KPIType kPIType,
FilterType filterType,
int filterDuration,
FilterTimeUnit filterTimeUnit,
int filterTimeStart,
int filterTimeEnd
)

[C++]
public:
double GetValue (
KPIType kPIType,
FilterType filterType,
int filterDuration,
FilterTimeUnit filterTimeUnit,
int filterTimeStart,
int filterTimeEnd
)

[J#]
public double GetValue (
KPIType kPIType,
FilterType filterType,
int filterDuration,
FilterTimeUnit filterTimeUnit,
int filterTimeStart,
int filterTimeEnd
)

[Jscript]

public function GetValue (


kPIType

filterType

KPIType,
;

FilterType,

filterDuration

int,

filterTimeUnit

FilterTimeUnit,

filterTimeStart
filterTimeEnd
)

int,

int

double

Parameters

kPIType
Holds a KPIType enumeration value specifying the KPI
type whose current value is retrieved.

Wonderware Factelligence Client API Reference Guide

404

Chapter 4 API Classes

filterType
Holds a FilterType enumeration value that gives the types
to filter data.
filterDuration
Holds an integer which gives a value N if the FilterType is
LastNHours.
filterTimeUnit
Holds a FilterTimeUnit enumeration value which specifies
the time unit for a custom filter if the FilterType is Custom.
filterTimeStart
Holds an integer which specifies the start of the filter
period relative to now if the FilterType is Custom.
filterTimeEnd
Holds an integer which specifies the end of the filter period
relative to now if the FilterType is Custom.
Return Value

Returns a floating point value that is the current value of


the specified KPI type.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Refresh() Method
The Refresh() method reloads this OEEExec's dynamic data
from the Factelligence database.
Syntax

[Visual Basic (Declaration)]


Public Sub Refresh()

[C#]

public void Refresh()

[C++]

public:
void Refresh() sealed

[J#]

public void Refresh()

[JScript]
public

function Refresh()

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

Wonderware Factelligence Client API Reference Guide

OEEExec Class

405

CurrentOEE Property
The CurrentOEE property exposes the current utilization for
the entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CurrentOEE As Double

[C#]

public double CurrentOEE { get; }

[C++]

public property double CurrentOEE sealed


double get();
}

[J#]

/** property */
public double get_CurrentOEE();

[JScript]

public function get CurrentOEE() : double

CurrentPerf Property
The CurrentPerf property exposes the current performance
for the entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CurrentPerf As Double

[C#]

public double CurrentPerf { get; }

[C++]

public property double CurrentPerf sealed


double get();
}

[J#]

/** property */
public double get_CurrentPerf();

[JScript]

public function get CurrentPerf() : double

CurrentQual Property
The CurrentQual property exposes the current quality for the
entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CurrentQual As Double

[C#]

Wonderware Factelligence Client API Reference Guide

406

Chapter 4 API Classes

public double CurrentQual { get; }

[C++]

public property double CurrentQual sealed


double get();
}

[J#]

/** property */
public double get_CurrentQual();

[JScript]

public function get CurrentQual() : double

TargetOEE Property
The TargetOEE property exposes the target utilization of the
entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property TargetOEE As Double

[C#]

public double TargetOEE { get; }

[C++]

public property double TargetOEE sealed


double get();
}

[J#]

/** property */
public double get_TargetOEE();

[JScript]

public function get TargetOEE() : double

TargetPerf Property
The TargetPerf property exposes the target performance of
the entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property TargetPerf As Double

[C#]

public double TargetPerf { get; }

[C++]

public property double TargetPerf sealed


double get();
}

[J#]

/** property */
public double get_TargetPerf();

Wonderware Factelligence Client API Reference Guide

Operations Class

407

[JScript]
public function get TargetPerf() : double

TargetQual Property
The TargetQual property exposes the target quality of the
entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property TargetQual As Double

[C#]

public double TargetQual { get; }

[C++]

public property double TargetQual sealed


double get();
}

[J#]

/** property */
public double get_TargetQual();

[JScript]

public function get TargetQual() : double

Operations Class
The Operations class contains static methods pertaining to
Operations in the Job table.

GetOperationDataFromComboBoxEntry() Method
The GetOperationDataFromComboBoxEntry method gives an
entry from a combo box, returns the operation ID and lists
the valid sequence numbers for that operation.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub GetOperationDataFromComboBoxEntry( _
ByVal comboBoxEntry As Object,

<OutAttribute> ByRef operID As String,

<OutAttribute> ByRef seqNos As ArrayList _


)

[C#]
public static void GetOperationDataFromComboBoxEntry(
object comboBoxEntry,
out string operID,
out ArrayList seqNos

Wonderware Factelligence Client API Reference Guide

408

Chapter 4 API Classes

[C++]
public:
static void GetOperationDataFromComboBoxEntry(
Object comboBoxEntry,
[OutAttribute] String% operID,
[OutAttribute] ArrayList% seqNos
)

[J#]
public static void GetOperationDataFromComboBoxEntry(
object comboBoxEntry,
/** @attribute OutAttribute() */ /** @ref */ string
operID,
/** @attribute OutAttribute() */ /** @ref */
ArrayList seqNos
)

[JScript]
public static function
GetOperationDataFromComboBoxEntry(
comboBoxEntry : Object,
OutAttribute operID : String,
OutAttribute seqNos : ArrayList
)

Parameters

comboBoxEntry
Holds an OperationData object from a combo box.
operID
Holds the returned Operation ID.
seqNos
Holds the returned list of valid sequence numbers for the
operation.

GetOperationsForWorkOrder() Method
The GetOperationsForWorkOrder() method returns a dataview
of all valid Operations and Sequence Numbers for a specified
work order. The result set is sorted by Oper ID / Seq No.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetOperationsForWorkOrder( _
ByVal woID As String _
) As DataView

[C#]

Wonderware Factelligence Client API Reference Guide

Operations Class

409

public static DataView GetOperationsForWorkOrder(


string woID
)

[C++]
public:
static DataView GetOperationsForWorkOrder(
String woID
)

[J#]
public static DataView GetOperationsForWorkOrder(
string woID
)

[JScript]
public static

function GetOperationsForWorkOrder(

woID : String
) : DataView

Parameter

woID
Holds the work order ID for which operations are to be
listed.
Return Value

Returns a DataSet containing the operations.

Exceptions

An exception is thrown if an error occurs while getting the


operations from the database.

PopulateComboBoxWithOperations() Method
The PopulateComboBoxWithOperations() method populates
the specified combo box with operations for the specified
work order from the Job table.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Sub PopulateComboBoxWithOperations( _
ByVal cboOperations As ComboBox, _
ByVal woID As String, _
ByVal includeEmptyEntry As Boolean _
)

[[C#] ]

public static void PopulateComboBoxWithOperations(


ComboBox cboOperations,
string woID,
bool includeEmptyEntry
)

[[C++] ]

Wonderware Factelligence Client API Reference Guide

410

Chapter 4 API Classes

public:
static void PopulateComboBoxWithOperations(
ComboBox cboOperations,
String woID,
bool includeEmptyEntry
)

[[J#] ]

public static void PopulateComboBoxWithOperations(


ComboBox cboOperations,
string woID,
bool includeEmptyEntry
)

[[JScript] ]

public static function


PopulateComboBoxWithOperations(
cboOperations : ComboBox,
woID : String,
includeEmptyEntry : bool
)

Parameters

cboOperations
Holds the combo box to fill.
woID
Holds the work order ID for which operation are to be
listed.
includeEmptyEntry
If true, an empty entry is placed at the beginning of the
combo box.
Exceptions

This method throws an exception if an error occurs while


getting the operations from the database.

PopulateComboBoxWithSeqNos() Method
The PopulateComboBoxWithSeqNos() method populates the
specified combo box with sequence numbers for the specified
operation.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopulateComboBoxWithSeqNos( _
ByVal cboSeqNos As ComboBox,

ByVal cboOperations As ComboBox,


ByVal operID As String,

ByVal includeEmptyEntry As Boolean _


)

[C#]
public static void PopulateComboBoxWithSeqNos(

Wonderware Factelligence Client API Reference Guide

Operations Class

411

ComboBox cboSeqNos,
ComboBox cboOperations,
string operID,
bool includeEmptyEntry
)

[C++]
public:
static void PopulateComboBoxWithSeqNos(
ComboBox cboSeqNos,
ComboBox cboOperations,
String operID,
bool includeEmptyEntry
)

[J#]
public static void PopulateComboBoxWithSeqNos(
ComboBox cboSeqNos,
ComboBox cboOperations,
string operID,
bool includeEmptyEntry
)

[JScript]
public static

function PopulateComboBoxWithSeqNos(

cboSeqNos : ComboBox,
cboOperations : ComboBox,
operID : String,
includeEmptyEntry : bool
)

Parameters

cboSeqNos
Holds the combo box to fill.
cboOperations
Holds the combo box containing the list of operations. The
associated data with each entry in the combo box must
contain an OperationData structure, which includes the list
of valid sequence numbers for the operation.
operID
Holds the Operation ID.
includeEmptyEntry
If true, an empty entry is placed at the beginning of the
combo box.

Wonderware Factelligence Client API Reference Guide

412

Chapter 4 API Classes

PersistImage Class
The PersistImage class implements the IPersistImage
interface to allow graphic images to be loaded and saved to
the graphics table.

ListImageNames() Method
The ListImageNames() method builds a list of names of the
images found in the graphics table.
Syntax

[Visual Basic (Declaration)]


Public Function ListImageNames() As ArrayList _

[C#]

Implements IPersistImage.ListImageNames

public ArrayList ListImageNames()

[C++]

public:
ArrayList ListImageNames() sealed

[J#]

public ArrayList ListImageNames()

[JScript]
public

function ListImageNames() : ArrayList

Return Value

Returns an ArrayList containing the names of the images.

Implements

IPersistImage.ListImageNames

LoadImage() Method
The LoadImage() method loads the named image from the
graphics table.
Syntax

[Visual Basic (Declaration)]


Public Function LoadImage( _
ByVal name As String _
) As Image _

[C#]

Implements IPersistImage.LoadImage

public Image LoadImage(


string name
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

PersistImage Class

413

Image LoadImage(
String name
) sealed

[J#]

public Image LoadImage(


string name
)

[JScript]
public

function LoadImage(

name : String
) : Image

Parameter

name
Holds the name of the image to load.
Return Value

Returns an image if the named image can be found,


otherwise it returns null.

Implements

IPersistImage.LoadImage

SaveImage() Method
The SaveImage() method saves the image to the graphics
table as the specified name.
Syntax

[Visual Basic (Declaration)]


Public Sub SaveImage( _
ByVal name As String,

ByVal image As Image _


) _

[C#]

Implements IPersistImage.SaveImage

public void SaveImage(


string name,
Image image
)

[C++]
public:
void SaveImage(
String name,
Image image
) sealed

Wonderware Factelligence Client API Reference Guide

414

Chapter 4 API Classes

[J#]
public void SaveImage(
string name,
Image image
)

[JScript]
public

function SaveImage(

name : String,
image : Image
)

Parameters

name
Holds the name of the image.
image
Holds the image to save.
Implements

IPersistImage.SaveImage

Priv Class
The Priv class stores all properties associated with a single
user group privilege. An instance of this class is created for
each privilege loaded for a user at startup. Each instance is
exposed to client applications via an indexer on the
UserPriv's class.

Priv Constructor
This constructor overload is given a DataTable Row from
which the instance can be initialized. An exception is thrown
if any of the required column descriptions cannot be found.
Syntax

Visual Basic (Declaration)

C#

Public Sub New( _


ByVal row As DataRow _
)
public Priv(
DataRow row
)

C++

public:
Priv(
DataRow row
) sealed

Wonderware Factelligence Client API Reference Guide

Priv Class

415

J#
public Priv(
DataRow row
)

JScript

public function Priv(


row : DataRow
)

Desc Property
The Desc property is a read-only property which returns the
description of this privilege.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property Desc As String

[C#]

public string Desc { get; }

[C++]

public property string Desc sealed


String get();
}

[J#]

/** property */
public string get_Desc();

[JScript]

public function get Desc() : String

Id Property
The Id property is a read-only property which returns the ID
of this privilege.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property ID As Integer

[C#]

public int ID { get; }

[C++]

public property int ID sealed


int get();
}

[J#]

/** property */
public int get_ID();

[JScript]

Wonderware Factelligence Client API Reference Guide

416

Chapter 4 API Classes

public function get ID() : int

Value Property
The Value property is a read-only property to return the
Value of this privilege as a 32 bit integer.
Syntax

Visual Basic (Declaration)


C#

Public ReadOnly Property Value As Integer


public int Value { get; }

C++

J#

public property int Value sealed


int get();
}

/** property */
public int get_Value();

JScript

public function get Value() : int

Shifts Class
The Shifts class provides supporting methods for the shift
table. The shift table stores time periods when entities are
available to perform work.

AddEntShift() Method
The AddEntShift() method adds a shift to the entity shift
schedule of the entity passed in if the entity can schedule
shifts.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddEntShift ( _
ByValue entId As Integer, _
ByValue startDay As Integer, _
ByValue shiftId As Integer, _
ByValue shiftStart As DateTime, _
ByValue shiftEnd As DateTime, _
ByValue break1Start As DateTime, _
ByValue break1End As DateTime, _
ByValue break2Start As DateTime, _
ByValue break2End As DateTime, _

Wonderware Factelligence Client API Reference Guide

Shifts Class

417

ByValue break3Start As DateTime, _


ByValue break3End As DateTime
)

[C#]
public static void AddEntShift (
int entId,
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break2End,
DateTime break3Start,
DateTime break3End
)

[C++]
public:
static void AddEntShift (
int entid,
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break3Start,
DateTime break3End
)

[J#]
public static void AddEntShift(
int entId,
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,

Wonderware Factelligence Client API Reference Guide

418

Chapter 4 API Classes

DateTime break3Start,
DateTime break3End
)

[Jscript]
public static function AddEntShift (
entId

int,

startDay :
shiftId :

int,
int,

shiftStart
shiftEnd

break1Start
break1End

break2Start
break2End

break3Start
break3End

DateTime,

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime

Parameters

entId
Holds an integer identifying the entity whose shift schedule
is added to a shift.
startDay
Holds the day of the week when the shift applies.
shiftId
Holds the system shift for the entity shift schedule.
shiftStart
Holds the date/time containing the time that the shift
starts for the entity shift schedule.
shiftEnd
Holds the date/time containing the time that the shift ends
for the entity shift schedule.
break1Start
Holds the date/time containing the time that the first break
starts for the shift.
break1End
Holds the date/time containing the time that the first break
ends for the shift.
break2Start
Holds the date/time containing the time that the second
break starts for the shift.

Wonderware Factelligence Client API Reference Guide

Shifts Class

419

break2End
Holds the date/time containing the time that the second
break ends for the shift.
break3Start
Holds the date/time containing the time that the third
break starts for the shift.
break3End
Holds the date/time containing the time that the third
break ends for the shift.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DefineShift () Method
The DefineShift() method creates a standard shift.
Syntax

[Visual Basic (Declaration)]


Public Sub DefineShift ( _
ByValue description As String
)

[C#]
public static void DefineShift (
int shiftID,
string description
)

[C++]
public:
static void DefineShift (
int shiftID,
string description
)

[J#]
public static void DefineShift (
int shiftID,
string description
)

[Jscript]
public static function DefineShift (
shiftID

description

int,
:

string

Wonderware Factelligence Client API Reference Guide

420

Chapter 4 API Classes

Parameter

shiftID
Holds an integer representing the shift ID for the standard
shift that is to be added.
description
Holds a string description of a standard shift that is to be
added. Is null if shift is deleted.
Return Value

Returns an integer value that is an ID for the shift that is


defined.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DeleteEntShift() Method
The DeleteEntShift() method removes the shift identified by
the input parameters from the shift schedule of the entity
identified by the input ent ID.
Syntax

[Visual Basic (Declaration)]


Public SharedSub DeleteEntShift ( _
ByValue entId As Integer, _
ByValue shiftId As Integer, _
ByValue startDay As Integer
)

[C#]
public static void DeleteEntShift (
int entId,
int shiftId,
int startDay
)

[C++]
public:
static void DeleteEntShift (
int entId,
int shiftId,
int startDay
)

[J#]
public static void DeleteEntShift (
int entId,

Wonderware Factelligence Client API Reference Guide

Shifts Class

421

int shiftId,
int startDay
)

[Jscript]
public static function DeleteEntShift (
entId

shiftId

int,
:

startDay

int,

int

Parameters

entId
Holds an integer defining the entity from which the shift is
deleted from the shift schedule.
shiftId
Holds an integer defining the shift that is to be removed.
startDay
Holds an integer identifying the day for which the shift is to
be removed.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DeleteShift() Method
The DeleteShift() method deletes the standard shift
identified.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub DeleteShift ( _
ByValue shiftId As Integer
)

[C#]
public void DeleteShift (
int shiftId
)

[C++]
public:
static void DeleteShift (
int shiftId
)

[J#]
public static void DeleteShift (

Wonderware Factelligence Client API Reference Guide

422

Chapter 4 API Classes

int shiftId
)

[Jscript]
public static function DeleteShift (
shiftId

int

Parameter

shiftId
Holds an integer defining the standard shift that is to be
deleted.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetAllShifts() Method
The GetAllShifts() method returns a data set containing all
shift IDs and descriptions for defined shifts. The shift ID is a
unique integer used to identify the shift.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAllShifts() As DataSet

[C#]

public static DataSet GetAllShifts()

[C++]

public:
static DataSet GetAllShifts()

[J#]

public static DataSet GetAllShifts()

[JScript]

public static

function GetAllShifts() : DataSet

Return Value

Returns a DataSet containing all records in the Shift table.

GetShiftDataFromComboBoxEntry() Method
The GetShiftDataFromComboBoxEntry() method gives an entry
from a combo box which was populated via the
PopulatecomboBoxWithShiftDescs method and returns the
shift ID and description.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub GetShiftDataFromComboBoxEntry( _

Wonderware Factelligence Client API Reference Guide

Shifts Class

ByVal comboBoxEntry As Object,

423

<OutAttribute> ByRef shiftDesc As String,

<OutAttribute> ByRef shiftID As Integer _


)

[C#]
public static void GetShiftDataFromComboBoxEntry(
object comboBoxEntry,
out string shiftDesc,
out int shiftID
)

[C++]
public:
static void GetShiftDataFromComboBoxEntry(
Object comboBoxEntry,
[OutAttribute] String% shiftDesc,
[OutAttribute] int% shiftID
)

[J#]
public static void GetShiftDataFromComboBoxEntry(
object comboBoxEntry,
/** @attribute OutAttribute() */ /** @ref */ string
shiftDesc,
/** @attribute OutAttribute() */ /** @ref */ int
shiftID
)

[JScript]
public static

function GetShiftDataFromComboBoxEntry(

comboBoxEntry : Object,
OutAttribute shiftDesc : String,
OutAttribute shiftID : int
)

Parameters

comboBoxEntry
Holds a ShiftData object from a combo box.
shiftDesc
Holds the returned shift description for the specified combo
box entry.
shiftID
Holds the returned shift ID for the specified combo box
entry.

Wonderware Factelligence Client API Reference Guide

424

Chapter 4 API Classes

GetShiftID() Method
The GetShiftID() method takes a shift description and returns
the shift ID.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetShiftID ( _
ByValue description As String
) As Integer

[C#]

public static int GetShiftID (


string description
)

[C++]
public:
static int GetShiftID (
string description
)

[J#]
public static int GetShiftID (
string description
)

[Jscript]
public static function GetShiftID (
description
)

string

int

Parameter

description
Holds a string description of a standard shift.
Return Value

Returns an integer value that is the shift ID of the standard


shift identified by the shift description given.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

PopulateComboBoxWithShiftDescs() Method
The PopulateComboBoxWithShifDescs() method populates the
specified combo box with all shift descriptions in the Shift
table. Only non-empty shift descriptions are included.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

Shifts Class

425

Public Shared Sub PopulateComboBoxWithShiftDescs( _


ByVal cboShifts As ComboBox,

ByVal includeEmptyDesc As Boolean _


)

[C#]
public static void PopulateComboBoxWithShiftDescs(
ComboBox cboShifts,
bool includeEmptyDesc
)

[C++]
public:
static void PopulateComboBoxWithShiftDescs(
ComboBox cboShifts,
bool includeEmptyDesc
)

[J#]
public static void PopulateComboBoxWithShiftDescs(
ComboBox cboShifts,
bool includeEmptyDesc
)

[JScript]
public static

function PopulateComboBoxWithShiftDescs(

cboShifts : ComboBox,
includeEmptyDesc : bool
)

Parameters

cboShifts
Holds the combo box to fill with shift descriptions.
includeEmptyDesc
If true, an empty entry is placed at the beginning of the
combo box.

UpdateEntShift() Method
The UpdateEntShift() method updates the shift defined by the
input parameters for the entity that is identified by the ent
ID input parameter.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub UpdateEntShift ( _
ByValue entId As Integer, _
ByValue startDay As Integer, _

Wonderware Factelligence Client API Reference Guide

426

Chapter 4 API Classes

ByValue shiftId As Integer, _


ByValue shiftStart As DateTime, _
ByValue shiftEnd As DateTime, _
ByValue break1Start As DateTime, _
ByValue break1End As DateTime, _
ByValue break2Start As DateTime, _
ByValue break2End As DateTime, _
ByValue break3Start As DateTime, _
ByValue break3End As DateTime
)

[C#]
public static void UpdateEntShift (
int entId,
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break2End,
DateTime break3Start,
DateTime break3End
)

[C++]
public:
static void UpdateEntShift (
int entId,
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break2End,
DateTime break3Start,
DateTime break3End
nd
)

[J#]

Wonderware Factelligence Client API Reference Guide

Shifts Class

427

public static void UpdateEntShift (


int entId,
int startDay,
int shiftId,
DateTime shiftStart,
DateTime shiftEnd,
DateTime break1Start,
DateTime break1End,
DateTime break2Start,
DateTime break2End,
DateTime break3Start,
DateTime break3End
)

[Jscript]
public static function UpdateEntShift (
entId

int,

startDay :
shiftId :

int,
int,

shiftStart
shiftEnd

break1Start
break1End

break2Start
break2End

break3Start
break3End

DateTime,

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime,
:

DateTime,

DateTime

Parameters

entId
Holds an integer identifying the entity whose shift schedule
is updated.
startDay
Holds the day of the week on which the shift is applied.
shiftId
Holds the system shift that the shift is for in the entities
schedule.
shiftStart
Holds the date/time containing the time that the shift
starts for the entity shift schedule.

Wonderware Factelligence Client API Reference Guide

428

Chapter 4 API Classes

shiftEnd
Holds the date/time containing the time that the shift ends
for the entity shift schedule.
break1Start
Holds the date/time containing the time that the first break
starts for the shift.
break1End
Holds the date/time containing the time that the first break
ends for the shift.
break2Start
Holds the date/time containing the time that the second
break starts for the shift.
break2End
Holds the date/time containing the time that the second
break ends for the shift.
break3Start
Holds the date/time containing the time that the third
break starts for the shift.
break3End
Holds the date/time containing the time that the third
break ends for the shift.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UpdateShift() Method
The UpdateShift() method updates the description of the
standard shift identified.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub UpdateShift ( _
ByValue shiftId As Integer, _
ByValue description As String
)

[C#]
public static void UpdateShift (
int shiftId,
string description
)

[C++]
public:
static void UpdateShift (

Wonderware Factelligence Client API Reference Guide

SystemAttr Class

429

int shiftId,
string description
)

[J#]
public static void UpdateShift (
int shiftId,
string description
)

[Jscript]
public static function UpdateShift (
shiftId

description

int,
:

string

Parameters

shiftId
Holds an integer identifying the standard shift that is to be
updated.
description
Holds a string description that is to be saved for the
standard shift.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

SystemAttr Class
This class exposes the configured properties for a specified
system attribute. An instance is created by the SystemAttrs
object for each defined system attribute at startup and
exposed to client applications via an indexer into the
collection of attribute objects in SystemAttrs.

System Attr Constructor


Constructor overload that passes a Row of a DataTable from
which the object can be initialized Throws an exception if the
required column descriptions cannot be found.
Syntax

Visual Basic (Declaration)

C#

Public Sub New( _


ByVal row As DataRow _
)
public SystemAttr(

Wonderware Factelligence Client API Reference Guide

430

Chapter 4 API Classes

DataRow row
)

C++

J#

public:
SystemAttr(
DataRow row
) sealed
public SystemAttr(
DataRow row
)

JScript

public function SystemAttr(


row : DataRow
)

Parameter

row
Holds the row of attribute properties.

System Attr Constructor


Constructor overload that passes the initial values for the
object to be initialized.
Syntax

Visual Basic (Declaration)

Public Sub New( _


ByVal attrId As Integer, _
ByVal attrDesc As String, _
ByVal attrValue As String, _
ByVal grpId As Integer, _
ByVal attrSeq As Integer, _
ByVal editType As Integer, _
ByVal constraints As String, _
ByVal reqdLicense As String _

C#
public SystemAttr(
int attrId,
string attrDesc,
string attrValue,
int grpId,
int attrSeq,
int editType,
string constraints,
string reqdLicense
)

C++

public:
SystemAttr(
int attrId,

Wonderware Factelligence Client API Reference Guide

SystemAttr Class

J#

431

String attrDesc,
String attrValue,
int grpId,
int attrSeq,
int editType,
String constraints,
String reqdLicense
) sealed
public SystemAttr(
int attrId,
string attrDesc,
string attrValue,
int grpId,
int attrSeq,
int editType,
string constraints,
string reqdLicense
)

JScript

public function SystemAttr(


attrId : int,
attrDesc : String,
attrValue : String,
grpId : int,
attrSeq : int,
editType : int,
constraints : String,
reqdLicense : String
)

Parameters

attrId
Hold the ID for the system attribute to which this object
refers.
attrDesc
Holds the description of this specified system attribute.
attrValue
Holds the value of this specified system attribute.
grpId
Holds the ID of the system attribute group to which this
system attr belongs.
attrSeq
Holds the sequence number of the system attr within it's
group.
editType
Holds the last edit time of the system attribute.
constraints
Holds the data-editing constraints of the system attribute.

Wonderware Factelligence Client API Reference Guide

432

Chapter 4 API Classes

reqdLicense
Holds a list of license requirements for the system
attribute.

AttrDesc Property
The AttrDesc property is a read-only property which exposes
the description of the system attribute.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property AttrDesc As String

[C#]

public string AttrDesc { get; }

[C++]

public property string AttrDesc sealed


String get();
}

[J#]

/** property */
public string get_AttrDesc();

[JScript]

public function get AttrDesc() : String

AttrId Property
The AttrId property is a read-only property which exposes the
ID of the attribute.
Syntax

[[Visual Basic (Declaration)] ]


Public Property ApplicationName As String

[C#]

public string ApplicationName { get; set; }

[C++]

public property string ApplicationName sealed


String get();
void set(String value);
}

[J#]

/** property */
public string get_ApplicationName();
/** property */
public void set_ApplicationName(string value);

[JScript]

public function get ApplicationName() : String


public function set ApplicationName(value : String);

Wonderware Factelligence Client API Reference Guide

SystemAttr Class

433

AttrSeq Property
The AttrSeq property is a read-only property which exposes
the system attribute's sequence number within its group.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property AttrSeq As Integer

[[C#] ]

public int AttrSeq { get; }

[C++]

public property int AttrSeq sealed


int get();
}

[[J#] ]

/** property */
public int get_AttrSeq();

[[JScript] ]

public function get AttrSeq() : int

AttrValue Property
The AttrValue property is a read-only property which exposes
the value of the system attribute.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property AttrValue As String

[C#]

public string AttrValue { get; }

[C++]

public property string AttrValue sealed


String get();
}

[J#]

/** property */
public string get_AttrValue();

[JScript]

public function get AttrValue() : String

Constraints Property
The Constraints property is a read-only property which
exposes the data-editing constraints of the system attribute.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property Constraints As String

Wonderware Factelligence Client API Reference Guide

434

Chapter 4 API Classes

[C#]
public string Constraints { get; }

[C++]

public property string Constraints sealed


String get();
}

[J#]

/** property */
public string get_Constraints();

[JScript]

EditType Property
The EditType property is a read-only property that returns a
code to indicate how the system attribute can be edited. Valid
values are:
1 = drop down list
2 = integer
3 = currency
4 = color
5 = date/time
6 = floating point
7 = percent
8 = checkbox
9 = non-editable
10 = time of day
11 = item reason
12 = long string
13 = value selected from a table
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property EditType As Integer

[C#]

public int EditType { get; }

[C++]

public property int EditType sealed


int get();
}

[J#]

/** property */
public int get_EditType();

Wonderware Factelligence Client API Reference Guide

SystemAttr Class

435

[JScript]
public function get EditType() : int

GrpId Property
The GrpID property is a read-only property which exposes the
group ID of the system attribute.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property GrpId As Integer

[C#]

public int GrpId { get; }

[C++]

public property int GrpId sealed


int get();
}

[J#]

/** property */
public int get_GrpId();

[JScript]

public function get GrpId() : int

ReqdLicenses Property
The ReqdLicenses property is a read-only property which
exposes a common separated list of license requirements for
the system attribute.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property ReqdLicenses As String

[C#]

public string ReqdLicenses { get; }

[C++]

public property string ReqdLicenses sealed


String get();
}

[J#]

/** property */
public string get_ReqdLicenses();

[JScript]

public function get ReqdLicenses() : String

Wonderware Factelligence Client API Reference Guide

436

Chapter 4 API Classes

SystemAttrs Class
The SystemAttrs class reads all the System Attributes from
the Factelligence middleware on initialization. It then stores
them locally and makes them available to calling
applications through the read-only Item property.

Item Property
The Item property is a read-only property which returns the
the requested system attribute object indexed by the attr_id
passed as an enum of defined system attributes.
Syntax
[[Visual Basic (Declaration)] ]
Public ReadOnly Property Item As Item

[C#]

public Item Item { get; }

[C++]

public property Item Item sealed


Item get();
}

[J#]

/** property */
public Item get_Item();

[JScript]

public function get Item() : Item

UIConfig Class
The UIConfig class provides methods for reading and saving
entries in the UI_Config and UI_Config_Default tables.
These tables store configuration data for the various controls,
such as, column widths, sort orders, and field visibility. All
the methods of this class are static; a class instance cannot be
created.

DeleteUIConfigDefaultValue() Method
The DeleteUIConfigDefaultValue() method deletes the specified
record from the UI_Config_Default table.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub DeleteUIConfigDefaultValue( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal parameter As String _

Wonderware Factelligence Client API Reference Guide

UIConfig Class

437

[C#]
public static void DeleteUIConfigDefaultValue(
string screen,
string sectn,
string parameter
)

[C++]
public:
static void DeleteUIConfigDefaultValue(
String screen,
String sectn,
String parameter
)

[J#]
public static void DeleteUIConfigDefaultValue(
string screen,
string sectn,
string parameter
)

[JScript]
public static

function DeleteUIConfigDefaultValue(

screen : String,
sectn : String,
parameter : String
)

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
parameter
Identifies the specific parameter. The parameter can be
null which causes all the parameters in the indicated sectn
to be deleted.

DeleteUIConfigValue() Method
The DeleteUIConfigValue() method deletes the specified record
from the UI_Config table.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

438

Chapter 4 API Classes

Public Shared Sub DeleteUIConfigValue( _


ByVal configID As String,
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal parameter As String _


)

[C#]
public static void DeleteUIConfigValue(
string configID,
string screen,
string sectn,
string parameter
)

[C++]
public:
static void DeleteUIConfigValue(
String configID,
String screen,
String sectn,
String parameter
)

[J#]
public static void DeleteUIConfigValue(
string configID,
string screen,
string sectn,
string parameter
)

[JScript]
public static

function DeleteUIConfigValue(

configID : String,
screen : String,
sectn : String,
parameter : String
)

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.

Wonderware Factelligence Client API Reference Guide

UIConfig Class

439

sectn
Identifies the group to which the value belongs.
parameter
Identifies the specific parameter. The parameter can be
null which causes all the parameters in the indicated sectn
to be deleted.

GetParameterValue() Method
The GetParameterValue() method returns a specified value
from a string which is in the form
"$$parameter1=value$$$$parameter2=value$$"
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetParameterValue( _
ByVal source As String,

ByVal parameter As String _


) As String

[C#]

public static string GetParameterValue(


string source,
string parameter
)

[C++]
public:
static String GetParameterValue(
String source,
String parameter
)

[J#]
public static string GetParameterValue(
string source,
string parameter
)

[JScript]
public static

function GetParameterValue(

source : String,
parameter : String
) : String

Wonderware Factelligence Client API Reference Guide

440

Chapter 4 API Classes

Parameters

source
Holds the string containing the parameter/value pairs in
the format mentioned above.
parameter
Holds the name of the parameter to find. This string must
include the equal sign.
Return Value

Returns a string representing the value of the parameter or


an empty string if the parameter is not found.

ReadUIConfigDefaultValue() Method
The ReadUIConfigDefaultValue() method returns the specified
configuration data from the UI_Config_Default table.
Syntax

[Visual Basic (Declaration)]


Public Shared Function ReadUIConfigDefaultValue( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal parameter As String _


) As String

[C#]

public static string ReadUIConfigDefaultValue(


string screen,
string sectn,
string parameter
)

[C++]
public:
static String ReadUIConfigDefaultValue(
String screen,
String sectn,
String parameter
)

[J#]
public static string ReadUIConfigDefaultValue(
string screen,
string sectn,
string parameter
)

[JScript]

Wonderware Factelligence Client API Reference Guide

UIConfig Class

public static

441

function ReadUIConfigDefaultValue(

screen : String,
sectn : String,
parameter : String
) : String

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
parameter
Identifies the specific parameter.
Return Value

Returns a string containing the configuration data. An


empty string is returned if an error occurs.

ReadUIConfigValue() Method
The ReadUIConfigValue() method returns the specified
configuration data from the UI_Config table.
Syntax

[Visual Basic (Declaration)]


Public Shared Function ReadUIConfigValue( _
ByVal configID As String,
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal parameter As String _


) As String

[C#]

public static string ReadUIConfigValue(


string configID,
string screen,
string sectn,
string parameter
)

[C++]
public:
static String ReadUIConfigValue(
String configID,
String screen,
String sectn,
String parameter

Wonderware Factelligence Client API Reference Guide

442

Chapter 4 API Classes

[J#]
public static string ReadUIConfigValue(
string configID,
string screen,
string sectn,
string parameter
)

[JScript]
public static

function ReadUIConfigValue(

configID : String,
screen : String,
sectn : String,
parameter : String
) : String

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
parameter
Identifies the specific parameter.
Return Value

Returns a string containing the configuration data. An


empty string is returned if an error occurs.

RestoreControlsVisibility() Method
The RestoreControlsVisibility method gets a DataSet
containing values for each label on the specified form. It then
finds the controls named in the DataSet and sets their
visibility based on the value in the DataSet. The control's Tag
property is also set. Because only the visibility of the label is
stored, the control associated with that label must have the
same name as the label excluding the first three characters.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub RestoreControlsVisibility( _
ByVal configID As String,
ByVal screen As String,

Wonderware Factelligence Client API Reference Guide

UIConfig Class

ByVal sectn As String,

443

ByVal containerControl As Control _


)

[C#]
public static void RestoreControlsVisibility(
string configID,
string screen,
string sectn,
Control containerControl
)

[C++]
public:
static void RestoreControlsVisibility(
String configID,
String screen,
String sectn,
Control containerControl
)

[J#]
public static void RestoreControlsVisibility(
string configID,
string screen,
string sectn,
Control containerControl
)

[JScript]
public static

function RestoreControlsVisibility(

configID : String,
screen : String,
sectn : String,
containerControl : Control
)

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.

Wonderware Factelligence Client API Reference Guide

444

Chapter 4 API Classes

containerControl
The container control being set up.

RestoreControlsVisibilityFromDefaults() Method
The RestoreControlsVisibilityFromDefaults method gets a
DataSet containing default values for each label on the
specified form. It then finds the controls named in the
DataSet and sets their visibility based on the value in the
DataSet. The control's Tag property is also set. Because only
the visibility of the label is stored, the control associated with
that label must have the same name as the label excluding
the first three characters.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub
RestoreControlsVisibilityFromDefaults( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal containerControl As Control _


)

[C#]
public static void
RestoreControlsVisibilityFromDefaults(
string screen,
string sectn,
Control containerControl
)

[C++]
public:
static void RestoreControlsVisibilityFromDefaults(
String screen,
String sectn,
Control containerControl
)

[J#]
public static void
RestoreControlsVisibilityFromDefaults(
string screen,
string sectn,
Control containerControl
)

[JScript]

Wonderware Factelligence Client API Reference Guide

UIConfig Class

445

public static function


RestoreControlsVisibilityFromDefaults(
screen : String,
sectn : String,
containerControl : Control
)

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
containerControl
Holds the container control being set up.

RestoreTabsVisibilityFromDefaults() Method
The RestoreTabsVisibilityFromDefaults() method gets a
DataSet containing default values for each tab in the
specified tab control. It then finds the tabs named in the
DataSet and sets their visibility based on the value in the
DataSet.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub RestoreTabsVisibilityFromDefaults( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal tabControl As Control _


)

[C#]
public static void RestoreTabsVisibilityFromDefaults(
string screen,
string sectn,
Control tabControl
)

[C++]
public:
static void RestoreTabsVisibilityFromDefaults(
String screen,
String sectn,
Control tabControl
)

[J#]

Wonderware Factelligence Client API Reference Guide

446

Chapter 4 API Classes

public static void RestoreTabsVisibilityFromDefaults(


string screen,
string sectn,
Control tabControl
)

[JScript]
public static function
RestoreTabsVisibilityFromDefaults(
screen : String,
sectn : String,
tabControl : Control
)

SaveControlsVisibility() Method
The SaveControlsVisibility() method saves the visibility
information for the controls on the specified form. Only the
visibly information for the labels are saved. The control
associated with the label must have the same name as the
label excluding the first three characters.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveControlsVisibility( _
ByVal configID As String,
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal containerControl As Control _


)

[C#]
public static void SaveControlsVisibility(
string configID,
string screen,
string sectn,
Control containerControl
)

[C++]
public:
static void SaveControlsVisibility(
String configID,
String screen,
String sectn,
Control containerControl

Wonderware Factelligence Client API Reference Guide

UIConfig Class

447

[J#]
public static void SaveControlsVisibility(
string configID,
string screen,
string sectn,
Control containerControl
)

[JScript]
public static

function SaveControlsVisibility(

configID : String,
screen : String,
sectn : String,
containerControl : Control
)

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
containerControl
Holds the container control being saved.

SaveControlsVisibilityAsDefaults() Method
The SaveControlsVisibilityAsDefaults() method saves the
visibility information for the controls on the specified form as
the default for that form. Only the visibly information for the
labels are saved. The control associated with the label must
have the same name as the label excluding the first three
characters.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveControlsVisibilityAsDefaults( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal containerControl As Control _


)

[C#]

Wonderware Factelligence Client API Reference Guide

448

Chapter 4 API Classes

public static void SaveControlsVisibilityAsDefaults(


string screen,
string sectn,
Control containerControl
)

[C++]
public:
static void SaveControlsVisibilityAsDefaults(
String screen,
String sectn,
Control containerControl
)

[J#]
public static void SaveControlsVisibilityAsDefaults(
string screen,
string sectn,
Control containerControl
)

[JScript]
public static function
SaveControlsVisibilityAsDefaults(
screen : String,
sectn : String,
containerControl : Control
)

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
containerControl
Holds the container control being saved.

SaveTabsVisibility() Method
The SaveTabsVisibility() method saves the visibility
information for the tabs in the specified tab control.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveTabsVisibility( _
ByVal configID As String,
ByVal screen As String,

Wonderware Factelligence Client API Reference Guide

UIConfig Class

ByVal sectn As String,

449

ByVal tabControl As Control _


)

[C#]
public static void SaveTabsVisibility(
string configID,
string screen,
string sectn,
Control tabControl
)

[C++]
public:
static void SaveTabsVisibility(
String configID,
String screen,
String sectn,
Control tabControl
)

[J#]
public static void SaveTabsVisibility(
string configID,
string screen,
string sectn,
Control tabControl
)

[JScript]
public static

function SaveTabsVisibility(

configID : String,
screen : String,
sectn : String,
tabControl : Control
)

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.

Wonderware Factelligence Client API Reference Guide

450

Chapter 4 API Classes

tabControl
Holds the tab control being saved.

SaveTabsVisibilityAsDefaults() Method
The SaveTabsVisibilityAsDefaults() method saves the visibility
information for the tabs in the specified tab control as
defaults.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveTabsVisibilityAsDefaults( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal tabControl As Control _


)

[C#]
public static void SaveTabsVisibilityAsDefaults(
string screen,
string sectn,
Control tabControl
)

[C++]
public:
static void SaveTabsVisibilityAsDefaults(
String screen,
String sectn,
Control tabControl
)

[J#]
public static void SaveTabsVisibilityAsDefaults(
string screen,
string sectn,
Control tabControl
)

[JScript]
public static

function SaveTabsVisibilityAsDefaults(

screen : String,
sectn : String,
tabControl : Control
)

Wonderware Factelligence Client API Reference Guide

UIConfig Class

451

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
tabControl
Holds the tab control being saved.

SaveUIConfigDefaultValue() Method
The SaveUIConfigDefaultValue() method stores the specified
configuration data in the UI_Config_Default table.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveUIConfigDefaultValue( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal parameter As String,

ByVal UIvalu As String _


)

[C#]
public static void SaveUIConfigDefaultValue(
string screen,
string sectn,
string parameter,
string UIvalu
)

[C++]
public:
static void SaveUIConfigDefaultValue(
String screen,
String sectn,
String parameter,
String UIvalu
)

[J#]
public static void SaveUIConfigDefaultValue(
string screen,
string sectn,
string parameter,
string UIvalu

Wonderware Factelligence Client API Reference Guide

452

Chapter 4 API Classes

[JScript]
public static

function SaveUIConfigDefaultValue(

screen : String,
sectn : String,
parameter : String,
UIvalu : String
)

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
parameter
Identifies the specific parameter.
UIvalu
Holds the value to be saved.

SaveUIConfigDefaultValues() Method
The SaveUIConfigDeafultValues() method saves a list of
parameter/value pairs to the UI_Config_Default table. It
uses the middleware UI_Config_Default.SaveSectionParams()
method to save the parameter/value pairs all at once.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveUIConfigDefaultValues( _
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal paramValues As ParameterValueArrayList _


)

[C#]
public static void SaveUIConfigDefaultValues(
string screen,
string sectn,
ParameterValueArrayList paramValues
)

[C++]
public:
static void SaveUIConfigDefaultValues(
String screen,
String sectn,

Wonderware Factelligence Client API Reference Guide

UIConfig Class

453

ParameterValueArrayList paramValues
)

[J#]
public static void SaveUIConfigDefaultValues(
string screen,
string sectn,
ParameterValueArrayList paramValues
)

[JScript]
public static

function SaveUIConfigDefaultValues(

screen : String,
sectn : String,
paramValues : ParameterValueArrayList
)

Parameters

screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
paramValues
Holds an array of parameter/value pairs.

SaveUIConfigValue() Method
The SaveUIConfigValue() method stores the specified
configuration data in the UI_Config table.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveUIConfigValue( _
ByVal configID As String,
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal parameter As String,

ByVal UIvalu As String _


)

[C#]
public static void SaveUIConfigValue(
string configID,
string screen,
string sectn,
string parameter,

Wonderware Factelligence Client API Reference Guide

454

Chapter 4 API Classes

string UIvalu
)

[C++]
public:
static void SaveUIConfigValue(
String configID,
String screen,
String sectn,
String parameter,
String UIvalu
)

[J#]
public static void SaveUIConfigValue(
string configID,
string screen,
string sectn,
string parameter,
string UIvalu
)

[JScript]
public static

function SaveUIConfigValue(

configID : String,
screen : String,
sectn : String,
parameter : String,
UIvalu : String
)

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
parameter
Identifies the specific parameter.
UIvalu
Holds the value to be saved.

Wonderware Factelligence Client API Reference Guide

UIConfig Class

455

SaveUIConfigValues() Method
The SaveUIConfigValues() method saves a list of
parameter/value pairs to the UI_Config table. It uses the
middleware UI_Config.SaveSectionParams() method to save
the parameter/value pairs all at once.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SaveUIConfigValues( _
ByVal configID As String,
ByVal screen As String,
ByVal sectn As String,

_
_

ByVal paramValues As ParameterValueArrayList _


)

[C#]
public static void SaveUIConfigValues(
string configID,
string screen,
string sectn,
ParameterValueArrayList paramValues
)

[C++]
public:
static void SaveUIConfigValues(
String configID,
String screen,
String sectn,
ParameterValueArrayList paramValues
)

[J#]
public static void SaveUIConfigValues(
string configID,
string screen,
string sectn,
ParameterValueArrayList paramValues
)

[JScript]
public static

function SaveUIConfigValues(

configID : String,
screen : String,
sectn : String,
paramValues : ParameterValueArrayList

Wonderware Factelligence Client API Reference Guide

456

Chapter 4 API Classes

Parameters

configID
Identifies the user or object for which the value is being
stored.
screen
Identifies the screen from which the value was taken.
sectn
Identifies the group to which the value belongs.
paramValues
Holds an array of parameter/value pairs.

User Class
The User class handles all Factelligence MES functionality
for a user logged into Factelligence.

User Constructor
The user constructor is only called after a successful login
and must include the User ID.
Syntax

Visual Basic (Declaration)

C#

Public Sub New( _


ByVal userId As String _
)
public User(
string userId
)

C++

J#

public:
User(
String userId
) sealed
public User(
string userId
)

JScript

public function User(


userId : String
)

Wonderware Factelligence Client API Reference Guide

User Class

457

Parameter

userId
Holds the ID of the user for which the object is being built.

AddUserToGroups () Method
The AddUserToGroups() method takes a list of group IDs and
adds the user defined by the user object to the groups in the
list.
Syntax

[Visual Basic (Declaration)]


Public Sub AddUserToGroups ( _
ByValue groupIDs As List(of Integer)
)

[C#]
public void AddUserToGroups(
List<int> groupIDs
)

[C++]
public:
void AddUserToGroups(
List<int> groupIDs
)

[J#]
public void AddUserToGroups(
List<int> groupdIDs
)

[Jscript]
public function AddUserToGroups(
groupIDs

List<int>

Parameter

groupIDs
Holds a list of integers identifying the user groups to add
the user.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

458

Chapter 4 API Classes

ChangePassword() Method
The ChangePassword() method changes the password of the
user by the user object to the new password, if the user has
the right to update user information.
Syntax

[Visual Basic (Declaration)]


Public Sub ChangePassword( _
ByValue userId As String, _
ByValue password As String, _
ByValue newPassword As String
)

[C#]
public void ChangePassword (
string userId,
string password,
string newPassword
)

[C++]
public:
void ChangePassword (
string userId,
string password,
string newPassword
)

[J#]
public void ChangePassword

string userId,
string password,
string newPassword
)

[Jscript]
public function ChangePassword
userId

password

string,
:

newPassword

string,
:

string

Parameters

userId
Holds a string that is the user ID for the user that is trying
to make the change to the user identified by the user object.

Wonderware Factelligence Client API Reference Guide

User Class

459

password
Holds a string that is the password of the user making the
change to the password of the user identified by the user
object.
newPassword
Holds a string that is the new password that is to be
assigned to the user identified by the user object.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

CloneUser() Method
The CloneUser() method creates a new user by copying the
user information from the user defined by the user object to a
new user with a user ID and password passed in. This
includes adding the user to all of the user groups that the
current user is in.
Syntax

[Visual Basic (Declaration)]


Public Sub CloneUser ( _
ByValue userId As String, _
ByValue Password As String
)

[C#]
public void CloneUser (
string userId,
string Password
)

[C++]
public:
void CloneUser (
string userId,
string Password
)

[J#]
public void CloneUser (
string userId,
string Password

)
[Jscript]
public function CloneUser (
userId

string,

Wonderware Factelligence Client API Reference Guide

460

Chapter 4 API Classes

Password

string

Parameters

userId
Holds a string that is the user ID for the new user.
Password
Holds a string that is the password for the new user.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetEntList() Method
The GetEntList() method gets a list of entities available for
control by this user. The list can be all the entities the user
has access to, all the entities in the user's default list, or all
the entities last used by the user.
Syntax

[Visual Basic (Declaration)]


Public Function GetEntList( _
ByVal listId As String _
) As DataSet

[C#]

public DataSet GetEntList(


string listId
)

[C++]
public:
DataSet GetEntList(
String listId
) sealed

[J#]

public DataSet GetEntList(


string listId
)

[JScript]
public

function GetEntList(

listId : String
) : DataSet

Wonderware Factelligence Client API Reference Guide

User Class

461

Parameter

listId
Holds a string used to filter the list of entities. If an empty
sting is passed, all the entities the user has access to is
returned; if the string is "Default", the default entities for
the user is returned; and if the string is "Last Used", the
entities last used by the user is returned.
Return Value

Returns a DataSet of entities filtered by the listID


parameter.

Exceptions

An exception is thrown if an error occurs getting the data


from the database.

IsUserLoggedIntoJob() Method (Int32, String,


String, Int32)
The IsUserLoggedIntoJob() method determines if user is
logged into the specified job running on the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Function IsUserLoggedIntoJob( _
ByVal entId As Integer,
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer _


) As Boolean

[C#]

public bool IsUserLoggedIntoJob(


int entId,
string woId,
string operId,
int seqNo
)

[C++]
public:
bool IsUserLoggedIntoJob(
int entId,
String woId,
String operId,
int seqNo
) sealed

[J#]

Wonderware Factelligence Client API Reference Guide

462

Chapter 4 API Classes

public bool IsUserLoggedIntoJob(


int entId,
string woId,
string operId,
int seqNo
)

[JScript]
public

function IsUserLoggedIntoJob(

entId : int,
woId : String,
operId : String,
seqNo : int
) : bool

Parameters

entId
Holds the entity on which the job is running.
woId
Holds the work order ID of the job.
operId
Holds the operation ID of the job.
seqNo
Holds the sequence number of the job.
Return Value

Returns true if the user is logged into the job or false if the
user is not logged into the job.

IsUserLoggedIntoJob() Method (String, String,


Int32)
The IsUserLoggedIntoJob() method determines if user is
logged into the specified job running on the current entity.
Syntax

[Visual Basic (Declaration)]


Public Function IsUserLoggedIntoJob( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer _


) As Boolean

[C#]

public bool IsUserLoggedIntoJob(


string woId,

Wonderware Factelligence Client API Reference Guide

User Class

463

string operId,
int seqNo
)

[C++]
public:
bool IsUserLoggedIntoJob(
String woId,
String operId,
int seqNo
) sealed

[J#]

public bool IsUserLoggedIntoJob(


string woId,
string operId,
int seqNo
)

[JScript]
public

function IsUserLoggedIntoJob(

woId : String,
operId : String,
seqNo : int
) : bool

Parameters

woId
Holds the work order ID of the job.
operId
Holds the operation ID of the job.
seqNo
Holds the sequence number of the job.
Return Value

Returns true if the user is logged into the job or false if the
user is not logged into the job.

IsUserLoggedOntoEnt() Method
This IsUserLoggedOntoEnt() method determines whether the
current user is logged on to the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Function IsUserLoggedOntoEnt( _
ByVal entId As Integer _
) As Boolean

Wonderware Factelligence Client API Reference Guide

464

Chapter 4 API Classes

[C#]
public bool IsUserLoggedOntoEnt(
int entId
)

[C++]
public:
bool IsUserLoggedOntoEnt(
int entId
) sealed

[J#]

public bool IsUserLoggedOntoEnt(


int entId
)

[JScript]
public

function IsUserLoggedOntoEnt(

entId : int
) : bool

Parameter

entId
Holds the ID of the entity to check if the user is logged on.
Return Value

Returns true if the user is logged on to the entity or false if


the user is not logged on to the entity.

JobBasedLogin() Method
The JobBasedLogin() method opens the form to allow user to
logon to a job by selecting the job rather then the entity it is
running on. User can only be logged into that job and not all
of the jobs running on the entity.
Syntax

[[Visual Basic (Declaration)]0


Public Function JobBasedLogin() As Boolean

[C#]

public bool JobBasedLogin()

[C++]

public:
bool JobBasedLogin() sealed

[J#]

public bool JobBasedLogin()

[JScript]
public

function JobBasedLogin() : bool

Wonderware Factelligence Client API Reference Guide

User Class

465

Return Value

Returns true if the user selects a job or false if the user


cancels the form.

LogoffEnt Method
The LogOffEnt() method logs the operator off all or one of the
entities that the operator is currently logged on.
Syntax

[Visual Basic (Declaration)]


Public Sub LogoffEnt( _
ByVal EntId As Integer _
)

[C#]

public void LogoffEnt(


int EntId
)

[C++]

public:
void LogoffEnt(
int EntId
) sealed

[J#]

public void LogoffEnt(


int EntId
)

[[JScript]#]

public function LogoffEnt(


EntId : int
)

Parameter

EntId
Holds the ID of the entity the operator is to be logged off. To
log the operator off of all entities, pass the value of -1.
Exception

Thrown if an error occurs while logging the user of the


entity.

LogoffEntList() Method
The LogoffEntList() method logs the user off a list of entities.
The user is logged off the entities one at a time. If an error
occurs, the user may be logged off some entities but not
others.
Syntax

[Visual Basic (Declaration)]


Public Sub LogoffEntList( _

Wonderware Factelligence Client API Reference Guide

466

Chapter 4 API Classes

ByVal arrayEntIds As Integer() _


)

[C#]
public void LogoffEntList(
int[] arrayEntIds
)

[C++]
public:
void LogoffEntList(
array<int>^ arrayEntIds
) sealed

[J#]

public void LogoffEntList(


int[] arrayEntIds
)

[JScript]
public

function LogoffEntList(

arrayEntIds : int[]
)

Parameter

arrayEntIds
Holds an array of entity IDs to log off.
Exceptions

An exception is thrown if an error occurs while logging the


user off of an entity.

Remarks

If you are using the Client API Wrapper you will want to
use the function LogoffEntList(int[] arrayEntIds, int
EntCount) where EntCount is the number of valid entity
ids in arrayEntIds.

LogOffJob() Method
The LogOffJob() method logs the user off the job running in
the specified job position on the specified entity. This method
optionally log the user off the entity as well.
Syntax

[Visual Basic (Declaration)]


Public Sub LogOffJob( _
ByVal entId As Integer,
ByVal jobPos As Integer,

_
_

ByVal jobState As JobStates,

Wonderware Factelligence Client API Reference Guide

User Class

ByVal logOffEnt As Boolean,

467

ByVal statusNotes As String _


)

[C#]
public void LogOffJob(
int entId,
int jobPos,
JobStates jobState,
bool logOffEnt,
string statusNotes
)

[C++]
public:
void LogOffJob(
int entId,
int jobPos,
JobStates jobState,
bool logOffEnt,
String statusNotes
) sealed

[J#]

public void LogOffJob(


int entId,
int jobPos,
JobStates jobState,
bool logOffEnt,
string statusNotes
)

[JScript]
public

function LogOffJob(

entId : int,
jobPos : int,
jobState : JobStates,
logOffEnt : bool,
statusNotes : String
)

Parameters

entId
Holds the ID of the entity on which the job is running.

Wonderware Factelligence Client API Reference Guide

468

Chapter 4 API Classes

jobPos
Holds the job position on the entity that the job is running
on.
jobState
Specifies the state the job is given after logging off.
logOffEnt
Holds a flag indicating if the user should be logged off the
entity (set to true) or should the user remain logged on to
the entity (set to false).
statusNotes
Holds a string containing a note telling why the job has
been put into the current state.

LogOffJobWithDialog() Method
The LogOffJobWithDialog() method logs the user off of the
specified job running on the current entity. The user is not
logged off the entity unless this is the last job running on the
entity and the system parameter for automatically logging
the user off the entity when logging off the last job is turned
on. If the user is the only user logged on to the job, a dialog is
presented asking the user what state the job should be left
in.
Syntax

[Visual Basic (Declaration)]


Public Function LogOffJobWithDialog( _
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer _


) As Boolean

[C#]

public bool LogOffJobWithDialog(


string woId,
string operId,
int seqNo
)

[C++]
public:
bool LogOffJobWithDialog(
String woId,
String operId,
int seqNo
) sealed

[J#]

Wonderware Factelligence Client API Reference Guide

User Class

469

public bool LogOffJobWithDialog(


string woId,
string operId,
int seqNo
)

[JScript]
public

function LogOffJobWithDialog(

woId : String,
operId : String,
seqNo : int
) : bool

Parameters

woId
Holds the work order ID of the job.
operId
Holds the operation ID of the job.
seqNo
Holds the sequence number of the job.
Return Value

Returns true if the user logs out of the job or false if the
user cancels the log out.

Exceptions

An exception is thrown if an error occurs while logging the


user on to the job.

LogonEnt() Method
The LogonEnt() method logs the operator on to a single entity.
This overload specifies the current labor code and percent
labor to apply to this labor code. The labor code is used to
specify to what labor category this job is currently assigned
or to what labor category the job is collecting labor against.
Syntax

[Visual Basic (Declaration)]


Public Sub LogonEnt( _
ByVal entId As Integer,

ByVal curLabCd As String,

ByVal pctToApply As Double _


)

[C#]
public void LogonEnt(
int entId,

Wonderware Factelligence Client API Reference Guide

470

Chapter 4 API Classes

string curLabCd,
double pctToApply
)

[C++]
public:
void LogonEnt(
int entId,
String curLabCd,
double pctToApply
) sealed

[J#]

public void LogonEnt(


int entId,
string curLabCd,
double pctToApply
)

[JScript]
public

function LogonEnt(

entId : int,
curLabCd : String,
pctToApply : double
)

Parameters

entId
Holds the ID of the entity to login the user.
curLabCd
Holds the current labor code for the user for the entity.
pctToApply
Holds the percentage of the user's time that should be
applied to this entity.
Exceptions

An exception is thrown if the LogonEnt method call fails.

LogonEntList() Method (Int32[])


The LogonEntList() method logs the user on to a list of
entities. The user is logged onto all the entities specified in
the list. A failure to log on to one entity prevents logging onto
any entities.
Syntax

[Visual Basic (Declaration)]


Public Sub LogonEntList( _

Wonderware Factelligence Client API Reference Guide

User Class

471

ByVal arrayEntIds As Integer() _


)

[C#]
public void LogonEntList(
int[] arrayEntIds
)

[C++]
public:
void LogonEntList(
array<int>^ arrayEntIds
) sealed

[J#]

public void LogonEntList(


int[] arrayEntIds
)

[JScript]
public

function LogonEntList(

arrayEntIds : int[]
)

Parameter

arrayEntIds
Holds an array of entity ID's to logon.
Exceptions

An exception is thrown if an error occurs while logging onto


any entity.

Remarks

If you are using the Client API Wrapper you will want to
use the function LogonEntList(int[] arrayEntIds, int
EntCount) where EntCount is the number of valid entity
ids in arrayEntIds.

LogonEntList() Method (String, DataTable)


The LogonEntList() method logs the user on to a list of
entities. The list can be a defined list such as, the default list
for the user, the list of the last entities used by the user, or
the list of all entities accessible by the user. Alternatively,
the list can be a DataTable with a row for each entity to log
the user on
Syntax

[Visual Basic (Declaration)]


Public Sub LogonEntList( _
ByVal sListID As String,

Wonderware Factelligence Client API Reference Guide

472

Chapter 4 API Classes

ByVal rsList As DataTable _


)

[C#]
public void LogonEntList(
string sListID,
DataTable rsList
)

[C++]
public:
void LogonEntList(
String sListID,
DataTable rsList
) sealed

[J#]

public void LogonEntList(


string sListID,
DataTable rsList
)

[JScript]
public

function LogonEntList(

sListID : String,
rsList : DataTable
)

Parameters

sListID
Holds the ID of a defined list of entities. Valid values are
"default" for the users default list, "last used" for the list of
entities last used by the user, or "all accessible" for all the
entities the user has permission to access.
rsList
Holds a DataTable containing a row for each entity with the
ID for the entity appearing in the entity ID column.

LogonEntWithDialog() Method (Boolean)


The LogonEntWithDialog() method opens the Entity Logon
Dialog. The user can use this dialog to log on to and off of any
entity the user has permission to access.
Syntax

[Visual Basic (Declaration)]


Public Function LogonEntWithDialog( _
ByRef bSelChanged As Boolean _

Wonderware Factelligence Client API Reference Guide

User Class

473

) As Boolean

[C#]

public bool LogonEntWithDialog(


ref bool bSelChanged
)

[C++]
public:
bool LogonEntWithDialog(
bool% bSelChanged
) sealed

[J#]

public bool LogonEntWithDialog(


bool bSelChanged
)

[JScript]
public

function LogonEntWithDialog(

bSelChanged : bool
) : bool

Parameter

bSelChanged
Set to true on return if the selected entities where changed.
Return Value

Returns True if the user presses the OK button on the


dialog or False if the user presses the Cancel button.

LogonEntWithDialog() Method (Boolean, Object)


The LogonEntWithDialog() method opens the Entity Logon
Dialog. The user can use this dialog to log on to and off of any
entity the user has permission to access that also appears in
the entity filter.
Syntax

[Visual Basic (Declaration)]


Public Function LogonEntWithDialog( _
ByRef bSelChanged As Boolean,

ByVal entFilter As Object _


) As Boolean

[C#]

public bool LogonEntWithDialog(


ref bool bSelChanged,
object entFilter
)

Wonderware Factelligence Client API Reference Guide

474

Chapter 4 API Classes

[C++]
public:
bool LogonEntWithDialog(
bool% bSelChanged,
Object entFilter
) sealed

[J#]

public bool LogonEntWithDialog(


bool bSelChanged,
object entFilter
)

[JScript]
public

function LogonEntWithDialog(

bSelChanged : bool,
entFilter : Object
) : bool

Parameters

bSelChanged
Set to true on return if the selected entities where changed.
entFilter
Holds an array of entities used to filter the list of entities
displayed in the ent logon dialog.
Return Value

Returns True if the user presses the OK button on the


dialog or False if the user presses the Cancel button.

LogonEntWithDialog() Method (Boolean, Object,


String)
The LogonEntWithDialog() method allows for entity login via
the Entity Selection form. If the logon form was invoked from
another control on the same form and it was cancelled, the
form is not displayed.
Syntax

[Visual Basic (Declaration)]


Public Function LogonEntWithDialog( _
ByRef bSelChanged As Boolean,
ByVal entFilter As Object,

ByVal formName As String _


) As Boolean

[C#]

public bool LogonEntWithDialog(

Wonderware Factelligence Client API Reference Guide

User Class

475

ref bool bSelChanged,


object entFilter,
string formName
)

[C++]
public:
bool LogonEntWithDialog(
bool% bSelChanged,
Object entFilter,
String formName
) sealed

[J#]

public bool LogonEntWithDialog(


bool bSelChanged,
object entFilter,
string formName
)

[JScript]
public

function LogonEntWithDialog(

bSelChanged : bool,
entFilter : Object,
formName : String
) : bool

Parameters

bSelChanged
Set to true on return if the selected entities where changed.
entFilter
Holds an array of entities used to filter the list of entities
displayed in the ent logon dialog.
formName
Holds the name of the form from which the logon dialog is
being invoked.
Return Value

Returns True if the user presses the OK button on the


dialog or False if the user presses the Cancel button.

LogOnJob() Method
The LogOnJob() method logs a user onto the job specified on
the specified entity. If the user is not already logged onto the
entity the specified job is to be run on, the user is logged onto
the entity.

Wonderware Factelligence Client API Reference Guide

476

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Function LogOnJob( _
ByVal entId As Integer,
ByVal woId As String,

ByVal operId As String,

ByVal seqNo As Integer _


) As Boolean

[C#]

public bool LogOnJob(


int entId,
string woId,
string operId,
int seqNo
)

[C++]
public:
bool LogOnJob(
int entId,
String woId,
String operId,
int seqNo
) sealed

[J#]

public bool LogOnJob(


int entId,
string woId,
string operId,
int seqNo
)

[JScript]
public

function LogOnJob(

entId : int,
woId : String,
operId : String,
seqNo : int
) : bool

Parameters

entId
Holds the ID of the entity on which the job is to run.

Wonderware Factelligence Client API Reference Guide

User Class

477

woId
Holds the work order ID of the job.
operId
Holds the operation ID of the job.
seqNo
Holds the sequence number of the job.
Return Value

Returns true if the user can be logged on to the job or false


if the user cannot be logged on to the job because the entity
cannot capture labor.

Exceptions

An exception is thrown if an error occurs while logging the


user on to the job.

MayAccessEntity() Method
The MayAccessEntity() method returns whether or not the
user has accessed to the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Function MayAccessEntity( _
ByVal entID As Integer _
) As Boolean

[C#]

public bool MayAccessEntity(


int entID
)

[C++]
public:
bool MayAccessEntity(
int entID
) sealed

[J#]

public bool MayAccessEntity(


int entID
)

[JScript]
public

function MayAccessEntity(

entID : int
) : bool

Wonderware Factelligence Client API Reference Guide

478

Chapter 4 API Classes

Parameter

entID
Holds the ID of the entity.
Return Value

Returns true if the user has access to the entity. Returns


false if the user does not have access to the entity or if the
ID is not known as an entity ID.

RefreshCurUserStatusRecordset() Method
Overloaded. This method refreshes the status of all the
entities the user is logged on to using the DataSet returned
by the ent.GetStatusInfoByUser middleware method.
Syntax

[Visual Basic (Declaration)]


Public Sub RefreshCurUserStatusRecordset()

[C#]

public void RefreshCurUserStatusRecordset()

[C++]

public:
void RefreshCurUserStatusRecordset() sealed

[J#]

public void RefreshCurUserStatusRecordset()

[JScript]
public

function RefreshCurUserStatusRecordset()

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

RefreshCurUserStatusRecordset Method
(DataSet)
The RefreshCurUserStatusRecordset() method refreshes the
status of all the entities the user is logged on to using the
DataSet returned by the ent.GetStatusInfoByUser
middleware method.
Syntax

[Visual Basic (Declaration)]


Public Sub RefreshCurUserStatusRecordset( _
ByVal ds As DataSet _
)

[C#]
public void RefreshCurUserStatusRecordset(
DataSet ds

Wonderware Factelligence Client API Reference Guide

User Class

479

[C++]
public:
void RefreshCurUserStatusRecordset(
DataSet ds
) sealed

[J#]

public void RefreshCurUserStatusRecordset(


DataSet ds
)

[JScript]
public

function RefreshCurUserStatusRecordset(

ds : DataSet
)

Parameter

ds
Holds an optional DataSet returned by the
ent.GetStatusInfoByUser middleware method. If this is
null, the method calls the middleware method to get the
DataSet.
Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

SaveEntList() Method
The SaveEntList() method saves the entities that the user is
currently logged into to either the user's Default list or to the
user's Last Used list.
Syntax

[Visual Basic (Declaration)]


Public Sub SaveEntList( _
ByVal sListID As String _
)

[C#]
public void SaveEntList(
string sListID
)

[C++]
public:
void SaveEntList(
String sListID

Wonderware Factelligence Client API Reference Guide

480

Chapter 4 API Classes

) sealed

[J#]

public void SaveEntList(


string sListID
)

[JScript]
public

function SaveEntList(

sListID : String
)

Parameter

sListID
Specifies which list the entities should save. Valid values
are "default" and "last used". If any other string or null is
passed, "default" is used.
Exceptions

An exception is thrown if an error occurs while saving the


list to the database.

UpdateUser() Method
The UpdateUser() method updates the user defined by the
user object.
Syntax

[Visual Basic (Declaration)]


Public Sub UpdateUser ( _
ByValue description As String, _
ByValue active As Boolean, _
ByValue langId as Integer
)

[C#]
public void UpdateUser (
string description,
bool active,
int langId
)

[C++]
public:
void UpdateUser (
string description,
bool active,
int langId
)

Wonderware Factelligence Client API Reference Guide

User Class

481

[J#]
public void UpdateUser (
string description,
bool active,
int langId
)

[Jscript]
public function UpdateUser (
description

string,

active

bool,

langId

int

Parameters

description
Holds a string that is the description to be updated for the
user.
active
Holds a boolean flag indicating whether the new user is an
active user.
langId
Holds an integer value indicating the default language to be
used for the new user.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

curEnt Property
The curEnt property is a read/write property to return/set a
reference to the current entity for this user. Setting this
property triggers an EntChanged event if the user is the
current user.
Syntax

[[Visual Basic (Declaration)] ]


Public Property curEnt As Ent

[C#]

public Ent curEnt { get; set; }

[C++]

public property Ent curEnt sealed


Ent get();
void set(Ent value);
}

[J#]

Wonderware Factelligence Client API Reference Guide

482

Chapter 4 API Classes

/** property */
public Ent get_curEnt();
/** property */
public void set_curEnt(Ent value);

[JScript]

public function get curEnt() : Ent


public function set curEnt(value : Ent);

EntList Property
The EntList property is a read-only property that specifies the
list of all entities logged on to by the operator.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property EntList As Dictionary(Of
Integer, Ent)

[C#]

public Dictionary<int, Ent> EntList { get; }

[C++]

public property Dictionary<int, Ent> EntList sealed


{
Dictionary<int, Ent> get();
}

[J#]

/** property */
public Dictionary<int, Ent> get_EntList();

[JScript]

public function get EntList() : Dictionary<int,


Ent>

EntsStatusInfo Property
The EntsStatusInfo property is a read-only property which
exposes the entity status information for all entities logged
onto by this user.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property EntsStatusInfo As DataSet

[C#]

public DataSet EntsStatusInfo { get; }

[C++]

public property DataSet EntsStatusInfo sealed


DataSet get();
}

[J#]

/** property */
public DataSet get_EntsStatusInfo();

Wonderware Factelligence Client API Reference Guide

User Class

483

[JScript]
public function get EntsStatusInfo() : DataSet

LangStrings Property
The LangStrings property is a read-only property that
specifies the language strings for the current user.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property LangStrings As LangStrings

[C#]

public LangStrings LangStrings { get; }

[C++]

public property LangStrings LangStrings sealed


LangStrings get();
}

[J#]

/** property */
public LangStrings get_LangStrings();

[JScript]

public function get LangStrings() : LangStrings

Privs Property
The Privs property is a read-only property that specifies the
current user's privileges.
Syntax
[[Visual Basic (Declaration)] ]
Public ReadOnly Property Privs As UserPrivs

[C#]

public UserPrivs Privs { get; }

[C++]

public property UserPrivs Privs sealed


UserPrivs get();
}

[J#]

/** property */
public UserPrivs get_Privs();

[JScript]

public function get Privs() : UserPrivs

Wonderware Factelligence Client API Reference Guide

484

Chapter 4 API Classes

UserDisplay Property
The UserDisplay property is a read-only property that
specifies this user's display name (taking into account the
relevant system attribute).
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property UserDisplay As String

[C#]

public string UserDisplay { get; }

[C++]

[J#]

public property string UserDisplay sealed


String get();
}

/** property */
public string get_UserDisplay();

[JScript]

public function get UserDisplay() : String

UserDisplayWithLabel Property
The UserDisplayWithLabel property is a read-only property
that specifies the current user's display name with label
(taking into account the relevant system attribute and
translating the label appropriately).
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UserDisplayWithLabel As
String

[C#]

public string UserDisplayWithLabel { get; }

[C++]

public property string UserDisplayWithLabel sealed


{
String get();
}

[J#]

/** property */
public string get_UserDisplayWithLabel();

[JScript]

public function get UserDisplayWithLabel() : String

Wonderware Factelligence Client API Reference Guide

UserPrivs Class

485

UserID Property
The UserID property is a read-only property that specifies the
current users ID.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property UserId As String

[C#]

public string UserId { get; }

[C++]

public property string UserId sealed


String get();
}

[J#]

/** property */
public string get_UserId();

[JScript]

public function get UserId() : String

UserName Property
The UserName property is a read-only property that exposes
the current users name.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property UserName As String

[C#]

public string UserName { get; }

[C++]

public property string UserName sealed


String get();
}

[J#]

/** property */
public string get_UserName();

[JScript]

public function get UserName() : String

UserPrivs Class
The UserPrivs class handles all user privilege functions in
Factelligence MES for a user logged into Factelligence.
Privileges are defined as rows in the Priv table in the
Factelligence database, so it is possible for the privileges in
the Privileges enum to not exist in the database if the
database is not up to date.

Wonderware Factelligence Client API Reference Guide

486

Chapter 4 API Classes

UserPrivs Constructor
Constructor for the userPrivs class which takes a user id and
loads the privileges for the user from the database into a
sorted list which can be accessed from the user object to get
the value of the privilege for the user.
Syntax

Visual Basic (Declaration)

C#

Public Sub New( _


ByVal userId As String _
)
public UserPrivs(
string userId
)

C++

J#

public:
UserPrivs(
String userId
) sealed
public UserPrivs(
string userId
)

JScript

public function UserPrivs(


userId : String
)

Parameter

userId
Identifies the user for which the privilege object is being
constructed.

GetPrivObject() Method
The GetPrivObject() method returns the Priv object for the
requested privilege by its enum.
Syntax

[Visual Basic (Declaration)]


Public Function GetPrivObject( _
ByVal privId As Privileges _
) As Priv

[C#]

public Priv GetPrivObject(


Privileges privId
)

Wonderware Factelligence Client API Reference Guide

UserPrivs Class

487

[C++]
public:
Priv GetPrivObject(
Privileges privId
) sealed

[J#]

public Priv GetPrivObject(


Privileges privId
)

[JScript]
public

function GetPrivObject(

privId : Privileges
) : Priv

Parameter

privId
Specifies the privilege to be returned.
Return Value

Returns a Priv object for the request privilege or null if the


privilege does not exists.

Item Property
The Item property is a read-only property which returns the
the requested system attribute object indexed by the attr_id
passed as an enum of defined system attributes.
Syntax
[[Visual Basic (Declaration)] ]
Public ReadOnly Property Item As Item

[C#]

public Item Item { get; }

[C++]

public property Item Item sealed


Item get();
}

[J#]

/** property */
public Item get_Item();

[JScript]

public function get Item() : Item

Wonderware Factelligence Client API Reference Guide

488

Chapter 4 API Classes

Users Class
The Users class contains methods for handling users in
Factelligence MES. All methods in this class are static.

AddUser() Method
The AddUser() method adds a new user, setting the default
language ID for the user.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub AddUser ( _
ByValue userId As String, _
ByValue description As String, _
ByValue Password As String, _
ByValue active As Boolean, _
ByValue langId as Integer
)

[C#]
public static void AddUser (
int userId,
string description,
string Password,
bool active,
int langId
)

[C++]
public:
static void AddUser (
int userId,
string description,
string Password,
bool active,
int langId
)

[J#]
public static void AddUser (
int userId,
string description,
string Password,
bool active,
int langId

Wonderware Factelligence Client API Reference Guide

Users Class

489

[Jscript]
public static function AddUser (
userId

int,

description

Password

string,

string,

active

bool,

langId

int

Parameters

userId
Holds a string that is the user ID for the new user being
added.
description
Holds a string that is the description saved for the new
user.
Password
Holds a string that is the password for the new user being
added.
active
Holds a Boolean flag indicating whether the new user is an
active user.
langId
Holds an integer value indicating the default language to be
used for the new user.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

FormatUser() Method
Given a User ID and User Desc, the FormatUser() method
returns a string that is formatted according to the user
display system parameter. This string is used to display the
user information.
Syntax

[Visual Basic (Declaration)]


Public Shared Function FormatUser( _
ByVal userID As String,

ByVal userDesc As String _


) As String

[C#]

public static string FormatUser(

Wonderware Factelligence Client API Reference Guide

490

Chapter 4 API Classes

string userID,
string userDesc
)

[C++]
public:
static String FormatUser(
String userID,
String userDesc
)

[J#]
public static string FormatUser(
string userID,
string userDesc
)

[JScript]
public static

function FormatUser(

userID : String,
userDesc : String
) : String

Parameters

userID
User ID.
userDesc
User description.

GetUserDataFromComboBoxEntry Method
Given an entry from a combo box populated with UserData
objects, the GetUserDataFromComboBoxEntry() method
returns the user ID and description.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub GetUserDataFromComboBoxEntry( _
ByVal comboBoxEntry As Object,

<OutAttribute> ByRef userID As String,

<OutAttribute> ByRef userDesc As String _


)

[C#]
public static void GetUserDataFromComboBoxEntry(
object comboBoxEntry,
out string userID,
out string userDesc

Wonderware Factelligence Client API Reference Guide

Users Class

491

[C++]
public:
static void GetUserDataFromComboBoxEntry(
Object comboBoxEntry,
[OutAttribute] String% userID,
[OutAttribute] String% userDesc
)

[J#]
public static void GetUserDataFromComboBoxEntry(
object comboBoxEntry,
/** @attribute OutAttribute() */ /** @ref */ string
userID,
/** @attribute OutAttribute() */ /** @ref */ string
userDesc
)

[JScript]
public static

function GetUserDataFromComboBoxEntry(

comboBoxEntry : Object,
OutAttribute userID : String,
OutAttribute userDesc : String
)

Parameters

comboBoxEntry
Holds a UserData object from a combo box.
userID
Holds the returned user ID.
userDesc
Holds the returned user description.

GetUsers() Method
The GetUsers() method returns all the active users
configured. Inactive users are not returned.
Syntax
[Visual Basic (Declaration)]
Public Shared Function GetUsers() As DataSet

[C#]

public static DataSet GetUsers()


[C++]
public:
static DataSet GetUsers()

Wonderware Factelligence Client API Reference Guide

492

Chapter 4 API Classes

[J#]
public static DataSet GetUsers()

[JScript]

public static

function GetUsers() : DataSet

Return Value

Returns a DataSet containing a record for every active user.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetUsers() Method (Boolean)


The GetUsers() method returns all the users configured. This
overload allows either all users or only active users to be
returned.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetUsers( _
ByVal activeOnly As Boolean _
) As DataSet

[C#]

public static DataSet GetUsers(


bool activeOnly
)

[C++]
public:
static DataSet GetUsers(
bool activeOnly
)

[J#]
public static DataSet GetUsers(
bool activeOnly
)

[JScript]
public static

function GetUsers(

activeOnly : bool
) : DataSet

Parameter

activeOnly
Set to true if only active users should be returned or false if
all users should be returned.

Wonderware Factelligence Client API Reference Guide

Users Class

493

Return Value

Returns a DataSet containing a record for each user.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

PopulateComboBoxWithUsers() Method
The PopulateComboBoxWithUsers() method populates the
specified combo box with users. The format of the users is
determined by the 'User Display' system parameter.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopulateComboBoxWithUsers( _
ByVal cboUsers As ComboBox,

ByVal includeEmptyDesc As Boolean,

ByVal activeOnly As Boolean _


)

[C#]
public static void PopulateComboBoxWithUsers(
ComboBox cboUsers,
bool includeEmptyDesc,
bool activeOnly
)

[C++]
public:
static void PopulateComboBoxWithUsers(
ComboBox cboUsers,
bool includeEmptyDesc,
bool activeOnly
)

[J#]
public static void PopulateComboBoxWithUsers(
ComboBox cboUsers,
bool includeEmptyDesc,
bool activeOnly
)

[JScript]
public static

function PopulateComboBoxWithUsers(

cboUsers : ComboBox,
includeEmptyDesc : bool,
activeOnly : bool

Wonderware Factelligence Client API Reference Guide

494

Chapter 4 API Classes

Parameters

cboUsers
The combo box to populate.
includeEmptyDesc
If true, an empty entry is placed at the beginning of the
combo box.
activeOnly
Determines if only active users should be loaded into the
combo box.
Exceptions

An exception is thrown if getting the users from the


database causes an error.

UserGrp Class
The UserGrps class contains methods for handling user
groups in Factelligence MES. All methods in this class are
static.

AddUserGroup() Method
The AddUserGroup() method takes a user group description
and creates a new user group, returning the group ID.
Syntax

[Visual Basic (Declaration)]


Public Function AddUserGroup ( _
ByValue description As String
) As Integer

[C#]

public int AddUserGroup(


string description
)

[C++]
public:
int AddUserGroup(
string description
)

[J#]
public int AddUserGroup(
String description
)

[Jscript]

Wonderware Factelligence Client API Reference Guide

UserGrp Class

495

public function AddUserGroup (


description
)

string

int

Parameter

description
Holds a string that is the description for the new user
group.
Return Value

Returns an integer value that is the group ID for the new


user group that has been added. It is -1 if the group was not
added.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

CloneUserGroup() Method
The CloneUserGroup() method creates a new user group
giving it the description passed in and copies all of the user
group link records from the first user group to the new user
group, therefore, making all users in the first group part of
the new group. It also gives access to all entities accessible by
the first group to the new group and copies all privileges of
the first user group to the new user group. The group ID of
the new group is returned.
Syntax

[Visual Basic (Declaration)]


Public Function CloneUserGroup ( _
ByValue userGrpId As Integer, _
ByValue description As String
) As Integer

[C#]

public int CloneUserGroup(


int userGrpId,
string description
)

[C++]
public:
int CloneUserGroup(
int userGrpId,
string description
)

[J#]

Wonderware Factelligence Client API Reference Guide

496

Chapter 4 API Classes

public int CloneUserGroup(


int userGrpId,
string description
)

[Jscript]
public function CloneUserGroup (
userGrpId

description
)

int,
:

string

int

Parameters

userGrpId
Holds an integer that is the group ID of the user group that
is to be cloned.
description
Holds a string that is the description for the new user group
created from cloning.
Return Value

Returns an integer value that is the group ID for the new


user group created from the cloning. If there is an error and
the new user group is not created, a -1 is returned.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

DeleteUserGroup() Method
The DeleteUserGroup () method deletes the user group. All
links to users are removed. Also all of the group links to
entities and group links to privileges are removed for this
user group.
Syntax

[Visual Basic (Declaration)]


Public Sub DeleteUserGroup ( _
ByValue grpId As Integer
)

[C#]
public void DeleteUserGroup(
int grpId
)

[C++]
public:
void DeleteUserGroup(
int grpId

Wonderware Factelligence Client API Reference Guide

UserGrp Class

497

[J#]
public void DeleteUserGroup(
int grpId
)

[Jscript]
public function DeleteUserGroup (
grpId

int

Parameter

grpId
Holds an integer identifying the user group that is to be
deleted.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetGroupId() Method
The GetGroupId() method takes a user group description and
returns the user group ID for the group.
Syntax

[Visual Basic (Declaration)]


Public Function GetGroupId ( _
ByValue description As String
) As Integer

[C#]

public int GetGroupId(


string description
)

[C++]
public:
int GetGroupId(
string description
)

[J#]
public int GetGroupId(
string description
)

[Jscript]
public function GetGroupId (
description

string

Wonderware Factelligence Client API Reference Guide

498

Chapter 4 API Classes

int

Parameter

description
Holds a string that is the description for the user group.
Return Value

Returns an integer value that is the group ID of the user


group identified by the description. If there is an error and
the user group cannot be identified, a -1 is returned.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUserGroups() Method
The GetUserGroups() method returns all user groups defined
in a DataSet.
Syntax

[Visual Basic (Declaration)]


Public Function GetUserGroups ( _
) As DataSet

[C#]

public DataSet GetUserGroups (


)

[C++]
public:
DataSet GetUserGroups (
)

[J#]
public DataSet GetUserGroups (
)

[Jscript]
public function GetUserGroups (
)

DataSet

Return Value

Returns a DataSet containing all defined user groups. An


empty DataSet is returned if the data cannot be retrieved.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

UserGrp Class

499

GetUserGroups() Method
The GetUserGroups() method returns all user groups defined
in a DataSet. It can be filtered by an optional user group
description.
Syntax

[Visual Basic (Declaration)]


Public Function GetUserGroups ( _
ByValue userGrpDesc As String
) As DataSet

[C#]

public DataSet GetUserGroups (


string userGrpDesc
)

[C++]
public:
DataSet GetUserGroups (
string userGrpDesc
)

[J#]
public DataSet GetUserGroups (
string userGrpDesc
)

[Jscript]
public function GetUserGroups (
userGrpDesc
)

string

DataSet

Parameter

userGrpDesc
Holds a string that is the description for the user group that
the DataSet is to be filtered by.
Return Value

Returns a DataSet containing all defined user groups. An


empty DataSet is returned if the data cannot be retrieved.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUserGroupEntities() Method
The GetUserGroupEntities method returns a DataSet
containing all grp_ent_link records. It can be filtered by an
entity ID to return a list of all groups that have access to that
entity.
Wonderware Factelligence Client API Reference Guide

500

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Function GetUserGroupEntities ( _
ByValue entId As Integer
) As DataSet

[C#]

public DataSet GetUserGroupEntities (


int entId
)

[C++]
public:
DataSet GetUserGroupEntities (
int entId
)

[J#]
public DataSet GetUserGroupEntities (
int entId
)

[Jscript]
public function GetUserGroupEntities (
entId
)

int

DataSet

Parameter

entId
Holds an integer value that is an entity ID that can be used
to filter the DataSet of records to only return the
grp_ent_link records for this particular entity.
Return Value

Returns a DataSet containing all grp_ent_link records


which identify the entities the user group can access. An
empty DataSet is returned if the data cannot be retrieved.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Set UserGroupEntityAccess() Method


The GetUserGroupEntityAccess() method updates access to the
entity specified for the user specified. The access flag
specified will be used to determine if the user should be given
access to the entity or if any access to the entity should be
removed for the specified user.

Wonderware Factelligence Client API Reference Guide

UserGrp Class

501

Syntax

[Visual Basic (Declaration)]


Public Sub SetUserGroupEntityAccess ( _
ByValue userGrpId As Integer, _
ByValue entID As Integers, _
ByValue access As Boolean
)

[C#]
public void SetUserGroupEntityAccess (
int userGrpId,
int entID,
bool access
)

[C++]
public:
void SetUserGroupEntityAccess (
int userGrpId,
int entID,
bool access
)

[J#]
public void SetUserGroupEntityAccess (
int userGrpId,
int entID,
bool access
)

[Jscript]
public function SetUserGroupEntityAccess (
userGrpId

int

int entID,
bool access
)

Parameters

userGrpId
Holds an integer value that identifies the user group to
which you want to give the entity access.
entId
Holds an integer value that identifies the entity that the
user's access is being updated for.

Wonderware Factelligence Client API Reference Guide

502

Chapter 4 API Classes

access
Holds an boolean value that specifies whether the user
should be given access to the entity or not.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUserGroupLinks() Method
The GetUserGroupLinks() method returns a DataSet
containing all user group link records.
Syntax

[Visual Basic (Declaration)]


Public Function GetUserGroupLinks ( _
)

As DataSet

[C#]

public DataSet GetUserGroupLinks (


)

[C++]
public:
DataSet GetUserGroupLinks (
)

[J#]
public DataSet GetUserGroupLinks (
)

[Jscript]
public function GetUserGroupLinks (
)

DataSet

Return Value

Returns a DataSet containing all grp_user_link records


identifying which users are in which groups. An empty
DataSet is returned if there is an error retrieving the data.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUserGroupLinks() Method
The GetUserGroupLinks() method returns a DataSet
containing all user group link records. The DataSet can be
filtered by an optional user ID to retrieve all groups
containing the user.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

UserGrp Class

503

Public Function GetUserGroupLinks ( _


ByValue userId As Integer
)

As DataSet

[C#]

public DataSet GetUserGroupLinks (


int userId
)

[C++]
public:
DataSet GetUserGroupLinks (
int userId
)

[J#]
public DataSet GetUserGroupLinks (
int userId
)

[Jscript]
public function GetUserGroupLinks (
userId
)

: int

DataSet

Parameter

userId
Holds a string specifying a user ID that is used to filter the
DataSet of only the user groups to which the user is a part.
Return Value

Returns a DataSet containing all grp_user_link records


identifying which users are in which groups. An empty
DataSet is returned if there is an error retrieving the data.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUserGroupLinks() Method
The GetUserGroupLinks() method returns a DataSet
containing all user group link records. The DataSet can be
filtered by an optional user group ID to get all users in that
group.
Syntax

[Visual Basic (Declaration)]


Public Function GetUserGroupLinks ( _
ByValue userGrpId As Integer
)

As DataSet

Wonderware Factelligence Client API Reference Guide

504

Chapter 4 API Classes

[C#]
public DataSet GetUserGroupLinks (
int userGrpId
)

[C++]
public:
DataSet GetUserGroupLinks (
int userGrpId
)

[J#]
public DataSet GetUserGroupLinks (
int userGrpId
)

[Jscript]
public function GetUserGroupLinks (
userGrpId
)

: int

DataSet

Parameter

userGrpId
Holds an integer that identifies a user group. This value
can be used to filter the DataSet to only include the records
for this group.
Return Value

Returns a DataSet containing all grp_user_link records


identifying which users are in which groups. An empty
DataSet is returned if there is an error retrieving the data.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUserGroupLinks() Method
The GetUserGroupLinks() method returns a DataSet
containing all user group link records. The DataSet can be
filtered by an optional user ID to retrieve all groups the user
is a part of or it can be filtered by an optional user group ID
to get all users in that group.
Syntax

[Visual Basic (Declaration)]


Public Function GetUserGroupLinks ( _
ByValue userId As Integer, _
ByValue userGrpId As Integer
)

As DataSet

Wonderware Factelligence Client API Reference Guide

UserGrp Class

505

[C#]
public DataSet GetUserGroupLinks (
int userId,
int userGrpId
)

[C++]
public:
DataSet GetUserGroupLinks (
int userId,
int userGrpId
)

[J#]
public DataSet GetUserGroupLinks (
int userId,
int userGrpId
)

[Jscript]
public function GetUserGroupLinks (
userId

userGrpId
)

int
: int

DataSet

Parameters

userId
Holds a string that is a user ID that can be used to filter the
DataSet to only be those user groups of which this user is a
part.
userGrpId
Holds an integer that identifies a user group. This value
can be used to filter the DataSet to only include the records
for this group.
Return Value

Returns a DataSet containing all grp_user_link records


identifying which users are in which groups. An empty
DataSet is returned if there is an error retrieving the data.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

SetUserGroupPrivileges() Method
The SetUserGroupPrivileges() method updates the value of the
privileges in the list for the user group that is specified. The
privileges list is a list of ordered pairs in the form of #:#. The

Wonderware Factelligence Client API Reference Guide

506

Chapter 4 API Classes

first value is the privilege ID and the second value is the


value. Each grp_priv_link record for the privileges in the list
and for the user specified are updated with the values in the
list.
Syntax

[Visual Basic (Declaration)]


Public Sub SetUserGroupPrivileges ( _
ByValue userGrpId As Integer, _
ByValue privileges As String
)

[C#]
public void SetUserGroupPrivileges (
int userGrpId,
string privileges
)

[C++]
public:
void SetUserGroupPrivileges (
int userGrpId,
string privileges
)

[J#]
public void SetUserGroupPrivileges (
int userGrpId,
string privileges
)

[Jscript]
public function SetUserGroupPrivileges (
userGrpId
privileges

:
:

int,
string

Parameters

userGrpId
Holds an integer value that identifies the user groups to
which you want to give privileges.
privileges
Holds a string which is a list of ordered pairs in the form of
#:# which identify the privilege to be updated and the value
that the privilege is to be given.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

UserGrp Class

507

SetUserGroupPrivValue() Method
The SetUserGroupPrivValue() method sets the value of the
privilege defined by the priv ID for the user group to the priv
value sent in.
Syntax

[Visual Basic (Declaration)]


Public Sub SetUserGroupPrivValue ( _
ByValue userGrpId As Integer, _
ByValue privId As Integer, _
ByValue value As Object
)

[C#]
public void SetUserGroupPrivValue (
int userGrpId,
int privId,
object value
)

[C++]
public:
void SetUserGroupPrivValue (
int userGrpId,
int privId,
object value
)

[J#]
public void SetUserGroupPrivValue (
int userGrpId,
int privId,
object value
)

[Jscript]
public function SetUserGroupPrivValue (
userGrpId

privId

int,

value

:
:

int,

object

Parameters

userGrpId
Holds an integer value identifying the user group to give
privilege.

Wonderware Factelligence Client API Reference Guide

508

Chapter 4 API Classes

privId
Holds an integer value identifying the privilege for which
the value needs to be set.
value
Holds a variant (bool) value of which the privilege value is
to be set.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UpdateUserGroup() Method
The UpdateUserGroup() method updates the user group data.
Syntax

[Visual Basic (Declaration)]


Public Sub UpdateUserGroup ( _
ByValue userGrpId As Integer, _
ByValue users As List(of Strings), _
ByValue entIDs As List(of Integers), _
ByValue privileges As String
)

[C#]
public void UpdateUserGroup (
int userGrpId,
List<strings> users,
List<int> entIDs,
string privileges
)

[C++]
public:
void UpdateUserGroup (
int userGrpId,
List<strings> users,
List<int> entIDs,
string privileges
)

[J#]
public void UpdateUserGroup (
int userGrpId,
List<strings> users,
List<int> entIDs,
string privileges

Wonderware Factelligence Client API Reference Guide

Util Class

509

[Jscript]
public function UpdateUserGroup (
userGrpId
users
entIDs

int,

List<strings>,

List<int>,

privileges

string

Parameters

userGrpId
Holds an integer value that identifies the user group want
to update.
users
Holds a list of strings that identifies the users that are part
of this group.
entIDs
Holds a list of integer values that identifies the entities that
access is to be added/removed for the user group.
privileges
Holds a string which is a list of ordered pairs in the form of
#:# which identify the privilege to be updated and the value
that the privilege is to be given.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Util Class
The Util class provides static methods for working with
utilization data, which is used to track entity state.
Examples of entity states include running, idle, and offline.

GetOEEExecData() Method
The GetOEEExecData() method retrieves OEE Exec data (that
is, the extra configuration data required for an entity which
is capable of tracking OEE data) for the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetOEEExecData( _
ByVal entID As Integer _
) As DataSet

[C#]

Wonderware Factelligence Client API Reference Guide

510

Chapter 4 API Classes

public static DataSet GetOEEExecData(


int entID
)

[C++]
public:
static DataSet GetOEEExecData(
int entID
)

[J#]
public static DataSet GetOEEExecData(
int entID
)

[JScript]
public static

function GetOEEExecData(

entID : int
) : DataSet

Parameter

entID
Holds the entity whose OEE Exec data is to be retrieved.
Return Value

Returns a DataSet containing data for the specified entity


from the OEE_Exec table.

GetOldAvailableReasons() Method
The GetOldAvailableReasons() method retrieves a set of final
reasons for the specified entity for the specified non-final
reason code.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetOldAvailableReasons( _
ByVal entID As Integer,

ByVal reasonCode As Integer _


) As DataSet

[C#]

public static DataSet GetOldAvailableReasons(


int entID,
int reasonCode
)

[C++]
public:
static DataSet GetOldAvailableReasons(

Wonderware Factelligence Client API Reference Guide

Util Class

511

int entID,
int reasonCode
)

[J#]
public static DataSet GetOldAvailableReasons(
int entID,
int reasonCode
)

[JScript]
public static

function GetOldAvailableReasons(

entID : int,
reasonCode : int
) : DataSet

Parameters

entID
Holds the ID of the entity for which to retrieve reasons.
ReasonCode
Holds the non-final reason code for which final reason codes
are required.
Return Value

Returns a DataSet containing a row for every final reason


for the entity and non-final reason.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetUtilExecData() Method
The GetUtilExecData() method retrieves Util Exec data (that
is, the extra configuration data required for an entity which
is capable of capturing utilization data) for the specified
entity.
Syntax
[Visual Basic (Declaration)]
Public Function GetUtilExecData( _
ByVal entID As Integer _
) As DataSet

[C#]

public DataSet GetUtilExecData(


int entID
)

[C++]

Wonderware Factelligence Client API Reference Guide

512

Chapter 4 API Classes

public:
DataSet GetUtilExecData(
int entID
) sealed

[J#]

public DataSet GetUtilExecData(


int entID
)

[JScript]
public

function GetUtilExecData(

entID : int
) : DataSet

Parameter

entID
Holds the entity whose Util Exec data is to be retrieved.
Return Value

Returns a DataSet containing data for the specified entity


from the Util_Exec table.

GetUtilLogData() Method
The GetUtilLogData() method retrieves data from the
Util_Log table for the specified entity and start time. All data
with a starting time equal to or after the specified start time
is returned. Either the Util_Log table's shift_start field or
event_time field may be used to filter the data. If the
shift_start field is used, then only Util_Log records whose
shift_start is greater than or equal to the provided startTime
parameter is returned. Similarly, if the data is filtered by
event_time, then only Util_Log records whose event_time is
greater than or equal to startTime is returned.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetUtilLogData( _
ByVal entID As Integer,
ByVal startTime As Date,

_
_

ByVal useShiftStartTime As Boolean _


) As DataSet

[C#]

public static DataSet GetUtilLogData(


int entID,
DateTime startTime,
bool useShiftStartTime

Wonderware Factelligence Client API Reference Guide

Util Class

513

[C++]
public:
static DataSet GetUtilLogData(
int entID,
DateTime startTime,
bool useShiftStartTime
)

[J#]
public static DataSet GetUtilLogData(
int entID,
DateTime startTime,
bool useShiftStartTime
)

[JScript]
public static

function GetUtilLogData(

entID : int,
startTime : DateTime,
useShiftStartTime : bool
) : DataSet

Parameters

entID
Holds the entity for which the util_log data is to be
retrieved.
startTime
Holds all records with a starting time (either shift_start or
event_time, depending on the useShiftStartTime
parameter) equal to or after this value are returned.
useShiftStartTime
If this parameter is set to True, the Util_Log table's
shift_start field is used to filter the data. If it is set to False,
the Util_Log table's event_time field is used.

GetUtilReasons() Method
The GetUtilReasons() method retrieves the available final
reasons for the specified entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilReasons() As DataSet

[C#]

public DataSet GetUtilReasons()

[C++]

Wonderware Factelligence Client API Reference Guide

514

Chapter 4 API Classes

public:
DataSet GetUtilReasons() sealed

[J#]

public DataSet GetUtilReasons()

[[JScript]#]
public

function GetUtilReasons() : DataSet

Return Value

Returns a DataSet containing a row for each of the entity's


final reasons.

Exceptions

An exception is thrown if an error occurs while retrieving


information from the database.

SetRawReason() Method
The SetRawReason() static method logs the change in
utilization and sets the raw reason for the current utilization
to the raw reason supplied.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetRawReason( _
ByValue entId As Integer, _
ByValue rawReasCode As String, _
ByValue reasStart As DateTime, _
ByValue comments As String, _
ByValue spare1 As String, _
ByValue spare2 As String, _
ByValue spare3 As String, _
ByValue spare4 As String
)

[C#]
public static void SetRawReason(
int entId,
string rawReasCode,
DateTime reasStart,
string comments,
string spare1,
string spare2,
string spare3,
string spare4
)

[C++]
public:
static void SetRawReason (
int entId,
string rawReasCode,
DateTime reasStart,
String comments,
string spare1,

Wonderware Factelligence Client API Reference Guide

Util Class

515

string spare2,
string spare3,
string spare4
)

[J#]
public static void SetRawReason(
int entId,
string rawReasCode,
DateTime reasStart,
string comments,
string spare1,
string spare2,
string spare3,
string spare4
)

[Jscript]
public static function SetRawReason(
entId : int,
rawReasCode : string,
reasStart : DateTime,
comments : string,
spare1 : string,
spare2 : string,
spare3 : string,
spare4 : string
)

Parameters

entId
Holds an integer value that identifies the entity for which
you want to set the util raw reason.
rawReasCode
Hold a string that is the code for the raw reason to set.
reasStart
Holds a DateTime of when the raw reason changed.
comments
Holds a string of comments to add to the util_log about the
raw reason change.
spare1
Holds a string which is used for additional information.
spare2
Hold a string which is used for additional information.
spare3
Holds a string which is used for additional information.
spare4
Holds a string which is used for additional information.

Wonderware Factelligence Client API Reference Guide

516

Chapter 4 API Classes

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UtilExec Class
The UtilExec class supports utilization tracking in
Factelligence MES. An instance of this class is created every
time a user logs into an entity that can track utilization.

UtilExec Constructor
Constructor for the class, this method creates a new util exec
object, linking it to the Ent object that is passed in and
saving the values from the row in the util exec table that this
object is being created for.
Syntax

Visual Basic (Declaration)

C#

Public Sub New( _


ByVal parentEnt As Ent, _
ByVal utilExecRow As DataRow _
)
public UtilExec(
Ent parentEnt,
DataRow utilExecRow
)

C++

J#

public:
UtilExec(
Ent parentEnt,
DataRow utilExecRow
) sealed
public UtilExec(
Ent parentEnt,
DataRow utilExecRow
)

JScript

public function UtilExec(


parentEnt : Ent,
utilExecRow : DataRow
)

Parameters

parentEnt
Holds the parent entity that created this object.

Wonderware Factelligence Client API Reference Guide

UtilExec Class

517

utilExecRow
Contains data needed for initialization of an instance of this
class.

GetCountsAndDuration() Method
The GetCountsAndDuration() method returns a DataSet
containing one row for each utilization state, reason group, or
reason. It has columns for the ID, the description, the count
or duration, the color (valid only for utilization states and
reasons), and an active flag which is set true for the current
utilization state, reason group, or reason OEEExec.
Syntax

[Visual Basic (Declaration)]


Public Function GetCountsAndDuration( _
ByValue type As CountsAndDurationGraphStyle, _
ByValue filterType As FilterType, _
ByValue filterDuration As Integer, _
ByValue filterTimeUnit As FilterTimeUnits,_
ByValue filterTimeStart As Integer, _
ByValue filterTimeEnd As Integer, _
ByValue drillDownFilter As Integer, _
ByValue oeeStatusFilter As OEEStatusFilter
) As DataSet

[C#]
public DataSet GetCountsAndDuration(
CountsAndDurationGraphStyle type,
FilterType filterType,
int filterDuration,
FilterTimeUnits filterTimeUnit,
int filterTimeStart,
int filterTimeEnd,
int drillDownFilter,
OEEStatusFilter oeeStatusFilter
)

[C++]
public:
DataSet GetCountsAndDuration(
CountsAndDurationGraphStyle type,
FilterType filterType,
int filterDuration,
FilterTimeUnits filterTimeUnit,
int filterTimeStart,
int filterTimeEnd,
int drillDownFilter,
OEEStatusFilter oeeStatusFilter
)

[J#]
public DataSet GetCountsAndDuration(
CountsAndDurationGraphStyle type,

Wonderware Factelligence Client API Reference Guide

518

Chapter 4 API Classes

FilterType filterType,
int filterDuration,
FilterTimeUnits filterTimeUnit,
int filterTimeStart,
int filterTimeEnd,
int drillDownFilter,
OEEStatusFilter oeeStatusFilter
)

[Jscript]
public function GetCountsAndDuration(
type : CountsAndDurationGraphStyle,
filterType : FilterType,
filterDuration : int,
filterTimeUnit : FilterTimeUnits,
filterTimeStart : int,
filterTimeEnd : int,
drillDownFilter : int,
oeeStatusFilter : OEEStatusFilter
)

Parameters

type
A CountsAndDurationGraphType enumeration value that
specifies the type of data that is shown in the Pareto graph
of the KPI control.
filterType
A FilterType enumeration value that gives the type to filter
data.
filterDuration
An integer value that specifies the value of N if filterType is
LastNHours.
filterTimeUnit
A FilterTimeUnit enumeration value which specifies the
time unit for a custom filter (when FilterType is Custom).
filterTimeStart
Holds an integer which specifies the start of the filter
period relative to now if the filterType is Custom.
filterTimeEnd
Holds an integer which specifies the end of the filter period
relative to now if the filterType is Custom.
this user group.
drillDownFilter
Holds an integer which specifies a reason group or
utilization state to drill down.
oeeStatusFilter
Holds an OEEStatusFilter enumeration value that specifies
if the data should be filtered by OEEStatus.

Wonderware Factelligence Client API Reference Guide

UtilExec Class

519

Return Value

Returns a DataSet containing one row for each utilization


state, reason group, or reason. It has columns for the ID,
the description, the count or duration, the color (valid only
for utilization states and reasons), and an active flag which
is set to true for the current utilization state, reason group,
or reason OEEExec.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetOldAvailableReasons() Method
The GetOldAvailableReasons() method retrieves a set of final
reasons for the specified non-final reason code and current
entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetOldAvailableReasons( _
ByVal reasonCode As Integer _
) As DataSet

[C#]

public DataSet GetOldAvailableReasons(


int reasonCode
)

[C++]
public:
DataSet GetOldAvailableReasons(
int reasonCode
) sealed

[J#]

public DataSet GetOldAvailableReasons(


int reasonCode
)

[JScript]
public

function GetOldAvailableReasons(

reasonCode : int
) : DataSet

Parameter

reasonCode
Holds the non-final reason code for which final reason codes
are required.

Wonderware Factelligence Client API Reference Guide

520

Chapter 4 API Classes

Return Value

Returns a DataSet containing a row for every final reason


for the entity and non-final reason.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetUtilExecData() Method
The GetUtilExecData() method retrieves Util Exec data for the
entity. Util Exec data is the extra configuration data
required for an entity which is capable of collecting
utilization data.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilExecData() As DataSet

[C#]

public DataSet GetUtilExecData()

[C++]

public:
DataSet GetUtilExecData() sealed

[J#]

public DataSet GetUtilExecData()

[JScript]
public

function GetUtilExecData() : DataSet

Return Value

Returns a DataSet containing data for the entity from the


Util_Exec table.

GetUtilLogData() Method
The GetUtilLogData() method retrieves data from the
Util_Log table for the specified entity and start time. All data
with a starting time equal to or after the specified start time
is returned. Either the Util_Log table's shift_start field or
event_time field may be used to filter the data. If the
shift_start field is used, then only Util_Log records whose
shift_start is greater than or equal to the provided startTime
parameter is returned. Similarly, if the data is filtered by
event_time, then only Util_Log records whose event_time is
greater than or equal to startTime is returned.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilLogData( _
ByVal startTime As Date,

Wonderware Factelligence Client API Reference Guide

UtilExec Class

521

ByVal useShiftStartTime As Boolean _


) As DataSet

[C#]

public DataSet GetUtilLogData(


DateTime startTime,
bool useShiftStartTime
)

[C++]
public:
DataSet GetUtilLogData(
DateTime startTime,
bool useShiftStartTime
) sealed

[J#]

public DataSet GetUtilLogData(


DateTime startTime,
bool useShiftStartTime
)

[JScript]
public

function GetUtilLogData(

startTime : DateTime,
useShiftStartTime : bool
) : DataSet

Parameters

startTime
Holds all records with a starting time (either shift_start or
event_time, depending on the useShiftStartTime
parameter) equal to or after this value are returned.
useShiftStartTime
If this parameter is set to True, the Util_Log table's
shift_start field is used to filter the data. If it is set to False,
the Util_Log table's event_time field is used.

GetUtilReasons() Method
The GetUtilReasons() method retrieves the available final
reasons for the current entity.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilReasons() As DataSet

[C#]

public DataSet GetUtilReasons()

Wonderware Factelligence Client API Reference Guide

522

Chapter 4 API Classes

[C++]
public:
DataSet GetUtilReasons() sealed

[J#]

public DataSet GetUtilReasons()

[JScript]
public

function GetUtilReasons() : DataSet

Return Value

Returns a DataSet containing a row for each of the entity's


final reasons.

Exceptions

An exception is thrown if an error occurs while getting the


information from the database.

GetUtilByFilter() Method
The GetUtilByFilter() method retrieves the utilization data
from the util_log using the filters supplied to filter the data.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilByFilter( _
ByValue shiftID As Long, _
ByValue shiftStartStart As String, _
ByValue shiftStartEnd As String, _
ByValue eventTimeStart As String, _
ByValue eventTimeEnd As String, _
ByValue minDuration As Long, _
ByValue maxDuration As Long, _
ByValue reasCd As Long,_
ByValue stateCd As Long,_
ByValue reasPending As Long, _
ByValue runTime As Long, _
ByValue downTime As Long, _
ByValue setupTime As Long, _
ByValue teardownTime As Long, _
ByValue timeCategoryNone As Long,_
ByValue fixedTime As Long, _
ByValue varTime As Long, _
ByValue timeTypeNeither As Long, _
ByValue comments As String, _
ByValue rawReasCd As String,_
ByValue timeFilterType As Long,_
ByValue lastNValue As Long
) As DataSet

[C#]
public DataSet GetUtilByFilter (
long shiftID,
string shiftStartStart,
string shiftStartEnd,
string eventTimeStart,

Wonderware Factelligence Client API Reference Guide

UtilExec Class

523

string eventTimeEnd,
long minDuration,
long maxDuration,
long reasCd,
long stateCd,
long reasPending,
long runTime,
long downTime,
long setupTime,
long teardownTime,
long timeCategoryNone,
long fixedTime,
long varTime,
long timeTypeNeither,
string comments,
string rawReasCd,
long timeFilterType,
long lastNValue
)

[C++]
public:
DataSet GetUtilByFilter (
long shiftID,
string shiftStartStart,
string shiftStartEnd,
string eventTimeStart,
string eventTimeEnd,
long minDuration,
long maxDuration,
long reasCd,
long stateCd,
long reasPending,
long runTime,
long downTime,
long setupTime,
long teardownTime,
long timeCategoryNone,
long fixedTime,
long varTime,
long timeTypeNeither,
string comments,
string rawReasCd,
long timeFilterType,
long lastNValue
)

[J#]
public DataSet GetUtilByFilter (
long shiftID,
string shiftStartStart,
string shiftStartEnd,
string eventTimeStart,
string eventTimeEnd,
long minDuration,
long maxDuration,
long reasCd,

Wonderware Factelligence Client API Reference Guide

524

Chapter 4 API Classes

long stateCd,
long reasPending,
long runTime,
long downTime,
long setupTime,
long teardownTime,
long timeCategoryNone,
long fixedTime,
long varTime,
long timeTypeNeither,
string comments,
string rawReasCd,
long timeFilterType,
long lastNValue
)

[Jscript]
public function GetUtilByFilter (
shiftID : long,
shiftStartStart : string,
shiftStartEnd : string,
eventTimeStart : string,
eventTimeEnd : string,
minDuration : long,
maxDuration : long,
reasCd : long,
stateCd
: long,
reasPending
: long,
runTime
: long,
downTime
: long,
setupTime
: long,
teardownTime
: long,
timeCategoryNone
: long,
fixedTime
: long,
varTime
: long,
timeTypeNeither : long,
comments : string,
rawReasCd
: string,
timeFilterType
: long,
lastNValue
: long
) : DataSet

Parameters

shiftID
Holds a long to identify the shift on which the utilization
data is being returned.
shiftStartStart
Holds a string to identify the shift start time for the entity
on which the utilization data is being returned.
shiftStartEnd
Holds a string to identify the shift end time for this entity
on which the utilization data is being returned.

Wonderware Factelligence Client API Reference Guide

UtilExec Class

525

eventTimeStart
Holds a string to identify the event start time for this entity
on which the utilization data is being returned.
eventTimeEnd
Holds a string to identify the event end time for this entity
on which the utilization data is being returned.
minDuration
Holds a long value that specifies the amount of time that
had to be spent in the event in order to consider the event.
maxDuration
Holds a long value that specifies the maximum amount of
time that could be spent in the event in order to consider
the event.
reasCd
Holds a long to identify the utilization reason code that
needs to be filtered.
stateCd
Holds a long to identify the utilization state code that needs
to be filtered.
reasPending
Holds a long indicating which types of events should be
returned. 0=Unacknowledged; 1=Acknowledged.
runTime
Holds a long to identify whether the dataset should be
filtered by runtime events.
downTime
Holds a long to identify whether the dataset should be
filtered by downtime events.
setupTime
Holds a long to identify whether the dataset should be
filtered by setup time events.
teardownTime
Holds a long to identify whether the dataset should be
filtered by teardown time events.
timeCategoryNone
Holds a long to identify whether the dataset should be
filtered by any time categories (that is, runtime, downtime,
setuptime, and teardowntime). If true, then the dataset is
filtered by runtime=0, downtime=0, setuptime=0 and
teardowntime=0 events.
fixedTime
Holds a long to identify whether the dataset should be
filtered by fixed time events.

Wonderware Factelligence Client API Reference Guide

526

Chapter 4 API Classes

varTime
Holds a long to identify whether the dataset should be
filtered by variable time events.
timeTypeNeither
Holds a long to identify whether the dataset should not be
filtered by variable and fixed time events.
comments
Holds a string to identify the comments for which the
utilization data is being returned.
rawReasCd
Holds a string to identify the raw reason code for which the
utilization data is being returned.
timeFilterType
Holds a long indicating the type of time-based filtering
being performed. 0 = LastNEvents, 1=Current Shift, 2=Last
Shift, 3=This Hour, 4=LastNHours, 5=CurrentDay,
6=Yesterday, 7=Current Week, 8=Last Week, 9=Current
Month, 10=Last Month, 11=Custom, 12=No time-based
filtering.
lastNvalue
Holds a long indicating how many of the most recent
utilization events to return. Required if timeFilterType = 0,
otherwise the value of this parameter is ignored.
Return Value

Returns a DataSet containing utilization data filtered by


the filters that were specified.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUtilByTimePeriod() Method
The GetUtilByTimePeriod() method retrieves the
utilization data from the util_log using the filters supplied to
filter the data.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilByTimePeriod( _
ByValue utilTimeFilterType As UtilTimeFilterType, _
ByValue utilStatusFilter As UtilStatusFilter, _
ByValue lastNEvents As Integer, _
ByValue lastNHours As Integer, _
ByValue utilFilterUnAck As UtilFilterUnAck, _
ByValue filterMinDuration As Integer, _
ByValue filterTimeUnit As FilterTimeUnits,_
ByValue filterStartOffset As Integer, _
ByValue filterEndOffest As Integer

Wonderware Factelligence Client API Reference Guide

UtilExec Class

527

) As DataSet

[C#]
public DataSet GetUtilByTimePeriod (
UtilTimeFilter Type utilTimeFilterType,
UtilStatusFilter utilStatusFilter,
int lastNEvents,
int lastNHours,
UtilFilterUnAck utilFilterUnAck,
Int filterMinDuration,
FilterTimeUnits filterTimeUnit,
int filterStartOffset,
int filterEndOffest
)

[C++]
public:
DataSet GetUtilByTimePeriod (
UtilTimeFilterType utilTimeFilterType,
UtilStatusFilter utilStatusFilter,
int lastNEvents,
int lastNHours,
UtilFilterUnAck utilFilterUnAck,
Int filterMinDuration,
FilterTimeUnits filterTimeUnit,
int filterStartOffset,
int filterEndOffest
)

[J#]
public DataSet GetUtilByTimePeriod (
UtilTimeFilterType utilTimeFilterType,
UtilStatusFilter utilStatusFilter,
int lastNEvents,
int lastNHours,
UtilFilterUnAck utilFilterUnAck,
Int filterMinDuration,
FilterTimeUnits filterTimeUnit,
int filterStartOffset,
int filterEndOffest
)

[Jscript]
public function GetUtilByTimePeriod (
utilTimeFilterType : UtilTimeFilterType,
UtilStatusFilter : utilStatusFilter,
lastNEvents : int,
lastNHours : int,
utilFilterUnAck : UtilFilterUnAck,
filterMinDuration : int,
filterTimeUnit : FilterTimeUnits,
filterStartOffset : int,
filterEndOffest : int
) : DataSet

Wonderware Factelligence Client API Reference Guide

528

Chapter 4 API Classes

Parameters

utilTimeFilterType
A UtilTimeFilterType enumeration value for specifying
what time based filtering, if any, will be performed on the
data.
utilStatusFilter
A UtilStatusFilter enumeration value for specifying what
filtering if any will be done based on utilization state.
lastNEvents
An integer valued used if the UtilTimeFilterType is
LastNEvents to determine how many events will be
included in the control when the data is displayed.
lastNHours
An integer valued used if the UtilTimeFilterType is
LastNHours to determine how many hours will be included
in the control when the data is displayed.
utilFilterUnAck
A UtilFilterUnAck enumeration value which specifies
whether unacknowledged events, acknowleged, events, or
both types of events should be shown.
filterMinDuration
An integer value that specifies the amount of time that had
to be spent in the event in order to consider the event.
filterTimeUnit
A FilterTimeUnit enumeration value which specifies the
time unit for a custom filter( when FilterType is Custom).
filterStartOffset
An integer which specifies the start of the filter period
relative to now if the filterType is Custom.
filterEndOffset
An integer which specifies the end of the filter period
relative to now if the filterType is Custom.
Return Value

A dataset containing utilization data filtered by whatever


filters were specified.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Refresh() Method
The Refresh() method reloads this UtilExec's dynamic data
from the Factelligence database.

Wonderware Factelligence Client API Reference Guide

UtilExec Class

529

Syntax

[Visual Basic (Declaration)]


Public Sub Refresh()

[C#]

public void Refresh()

[C++]

public:
void Refresh() sealed

[J#]

public void Refresh()

[JScript]
public

function Refresh()

Exceptions

An exception is thrown if an error occurs retrieving the


information from the database.

CurrentUtil Property
The CurrentUtil property is a read-only property that exposes
the current utilization for the entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property CurrentUtil As Double

[C#]

public double CurrentUtil { get; }

[C++]

public property double CurrentUtil sealed


double get();
}

[J#]

/** property */
public double get_CurrentUtil();

[JScript]

public function get CurrentUtil() : double

TargetUtil Property
The TargetUtil property is a read-only property that exposes
the target utilization of the entity.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property TargetUtil As Double

[C#]

public double TargetUtil { get; }

Wonderware Factelligence Client API Reference Guide

530

Chapter 4 API Classes

[C++]
public property double TargetUtil sealed
double get();
}

[J#]

/** property */
public double get_TargetUtil();

[JScript]

public function get TargetUtil() : double

UtilReasCd Property
The UtilReasCd property is a read-only property that specifies
the current utilization reason code.
Syntax

[Visual Basic (Declaration)]


Public ReadOnly Property UtilReasCd As Integer

[C#]

public int UtilReasCd { get; }

[C++]

public property int UtilReasCd sealed

int get();
}

[J#]
/** property */
public int get_UtilReasCd();

[JScript]

public function get UtilReasCd() : int

UtilReasReqd Property
The UtilReasReqd property is a read-only property that
exposes the utilization reason required flag.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UtilReasReqd As Boolean

[C#]

public bool UtilReasReqd { get; }

[C++]

public property bool UtilReasReqd sealed


bool get();
}

[J#]

/** property */

Wonderware Factelligence Client API Reference Guide

UtilExec Class

531

public bool get_UtilReasReqd();

[JScript]

public function get UtilReasReqd() : bool

UtilReasStart Property
The UtilReasStart property is a read-only property that
exposes the utilization reason start time.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UtilReasStart As String

[C#]

public string UtilReasStart { get; }

[C++]

public property string UtilReasStart sealed


String get();
}

[J#]

/** property */
public string get_UtilReasStart();

[JScript]

public function get UtilReasStart() : String

UtilStateCd Property
The UtilStateCd property is a read-only property that exposes
the current utilization state code.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UtilStateCd As Integer

[C#]

public int UtilStateCd { get; }

[C++]

public property int UtilStateCd sealed


int get();
}

[J#]

/** property */
public int get_UtilStateCd();

[JScript]

public function get UtilStateCd() : int

Wonderware Factelligence Client API Reference Guide

532

Chapter 4 API Classes

UtilStateColor Property
The UtilStateColor property is a read-only property that
specifies the current utilization state color.
Syntax

[[Visual Basic (Declaration)] ]


Public ReadOnly Property UtilStateColor As Integer

[C#]

public int UtilStateColor { get; }

[C++]

public property int UtilStateColor sealed


int get();
}

[J#]

/** property */
public int get_UtilStateColor();

[JScript]

public function get UtilStateColor() : int

Utility Class
The Utility class contains assorted utility methods, useful for
a variety of purposes. All methods are static, so the class is
never instantiated into an object.

CloseIPForm() Method
The CloseIPForm method closes the specified form.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Sub CloseIPForm( _
ByVal formName As String _
)

[[C#] ]

public static void CloseIPForm(


string formName
)

[C++]

public:
static void CloseIPForm(
String formName
)

[[J#] ]

public static void CloseIPForm(


string formName
)

Wonderware Factelligence Client API Reference Guide

Utility Class

533

[JScript]
public static function CloseIPForm(
formName : String
)

Parameter

formName
Holds the name of the form to close.

ConvertStringToEnum() Method
The ConvertStringToEnum() method converts the supplied
string to an enum value. Enum values are case sensitive. The
caller must catch any exception raised by this method. If the
supplied enum string does not match with any of the existing
enum values, a null value is returned.
Syntax

[Visual Basic (Declaration)]


Public Shared Function ConvertStringToEnum( _
ByVal type As Type, _
ByVal EnumValue As String _
) As Object

[[C#] ]

public static object ConvertStringToEnum(


Type type,
string EnumValue
)

[C++]

public:
static Object ConvertStringToEnum(
Type type,
String EnumValue
)

[[J#] ]

public static object ConvertStringToEnum(


Type type,
string EnumValue
)

[JScript]

public static function ConvertStringToEnum(


type : Type,
EnumValue : String
) : Object

Parameters

type
Holds the type of the enum object.
EnumValue
Holds a valid string that contains the enum value.

Wonderware Factelligence Client API Reference Guide

534

Chapter 4 API Classes

FindButtonBar() Method
The FindButtonBar() method searches for the named button
bar on the top level container or .NET form.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function FindButtonBar( _
ByVal factControl As Control, _
ByVal buttonBarName As String _
) As ButtonBar

[[C#] ]

public static ButtonBar FindButtonBar(


Control factControl,
string buttonBarName
)

[C++]

public:
static ButtonBar FindButtonBar(
Control factControl,
String buttonBarName
)

[[J#] ]

public static ButtonBar FindButtonBar(


Control factControl,
string buttonBarName
)

[JScript]

public static function FindButtonBar(


factControl : Control,
buttonBarName : String
) : ButtonBar

Parameters

factControl
Holds the name of the control looking to attach to a button
bar.
buttonBarName
Holds the name of the button bar for which to search.
Return Value

Returns a reference to the button bar if found, or a null


reference if the button bar is not found.

FormatDuration() Method
The FormatDuration() method gives a duration value in
seconds, converts the value into hhh:mm:ss format.
Syntax

[Visual Basic (Declaration)]


Public Shared Function FormatDuration( _

Wonderware Factelligence Client API Reference Guide

Utility Class

535

ByVal seconds As Integer _


) As String

[[C#] ]

public static string FormatDuration(


int seconds
)

[C++]

public:
static String FormatDuration(
int seconds
)

[[J#] ]

public static string FormatDuration(


int seconds
)

[JScript]

public static function FormatDuration(


seconds : int
) : String

Parameter

seconds
Holds the duration in seconds to be formatted.
Return Value

Returns the formatted duration.

GetAutoLoginUserId() Method
The GetAutoLoginUserID() method retrieves the Factelligence
User ID of the operator to be automatically logged in, if any,
from the configuration file.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function GetAutoLoginUserId() As
String

[[C#] ]

public static string GetAutoLoginUserId()

[C++]

public:
static String GetAutoLoginUserId()

[[J#] ]

public static string GetAutoLoginUserId()

[JScript]

public static
String

function GetAutoLoginUserId() :

Wonderware Factelligence Client API Reference Guide

536

Chapter 4 API Classes

Return Value

The User ID to be automatically logged in; returns an


empty string if no such User ID is defined.

GetAutoLoginUserPw() Method
The GetAutoLoginUserPw() method retrieves password of the
user to be automatically logged in, if any such user exists,
from the configuration file.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function GetAutoLoginUserPw() As
String

[[C#] ]

public static string GetAutoLoginUserPw()

[C++]

public:
static String GetAutoLoginUserPw()

[[J#] ]

public static string GetAutoLoginUserPw()

[JScript]

public static
String

function GetAutoLoginUserPw() :

Return Value

Returns the user's password if it exists; otherwise returns


an empty string.

GetAutoLogonEntId() Method
The GetAutoLoginEntId() method retrieves the single entity
which should be logged into automatically, if any, from the
configuration file. If multiple entities are to be logged into
automatically, this method retrieves the first in the list.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAutoLogonEntId() As
Integer

[[C#] ]

public static int GetAutoLogonEntId()

[C++]

public:
static int GetAutoLogonEntId()

[[J#] ]

public static int GetAutoLogonEntId()

[[JScript] ]

Wonderware Factelligence Client API Reference Guide

Utility Class

public static

537

function GetAutoLogonEntId() : int

Return Value

The ent ID of the first entity to be automatically logged


into; returns -1 if there are none.

GetAutoLogonEntIds() Method
The GetAutoLogonEntIds() method retrieves the list of entities
which should be logged into automatically, if any, from the
configuration file.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function GetAutoLogonEntIds() As
Integer()

[[C#] ]

public static int[] GetAutoLogonEntIds()

[C++]

public:
static array<int>^ GetAutoLogonEntIds()

[[J#] ]

public static int[] GetAutoLogonEntIds()

[JScript]

public static function GetAutoLogonEntIds() : int[]

Return Value

An int array containing a list of entity IDs. If there are no


entities defined which are to be automatically logged into,
an empty integer array is returned.

GetCodeColor() Method
The GetCodeColor() method gives a database table name, the
field name of an integer field in that table, and an integer
value for that field, return the color value from the "color"
field of that table from the record with a matching value in
the specified field.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function GetCodeColor( _
ByVal table As String, _
ByVal field As String, _
ByVal code As Integer _
) As Integer

[[C#] ]

public static int GetCodeColor(


string table,
string field,
int code

Wonderware Factelligence Client API Reference Guide

538

Chapter 4 API Classes

[C++]
public:
static int GetCodeColor(
String table,
String field,
int code
)

[[J#] ]

public static int GetCodeColor(


string table,
string field,
int code
)

[JScript]

public static function GetCodeColor(


table : String,
field : String,
code : int
) : int

Parameters

table
Holds the name of the database table.
field
Holds the name of the integer field in the database table.
code
Holds the integer value for the specified field. The color
from the row whose value in this field matches this
specified value is returned.
Return Value

Returns the color value from the record in the specified


table whose value in the specified field matches the
specified value.

GetItemGrade() Method
The GetItemGrade() method gives an item reason code,
returns the associated item grade and color.
Syntax

[[Visual Basic (Declaration)] ]


Public Shared Function GetItemGrade( _
ByVal reasCd As Integer _
) As Utility.itemGrade

[[C#] ]

public static Utility.itemGrade GetItemGrade(


int reasCd
)

[C++]

Wonderware Factelligence Client API Reference Guide

Utility Class

539

public:
static Utility.itemGrade GetItemGrade(
int reasCd
)

[[J#] ]

public static Utility.itemGrade GetItemGrade(


int reasCd
)

[JScript]

public static function GetItemGrade(


reasCd : int
) : Utility.itemGrade

Parameter

reasCd
Holds the item reason code whose grade and color are to be
returned.
Return Value

Returns an 'itemGrade' structure which contains the


specified item reason code, along with the associated item
grade and color.

GetListIndex() Method
The GetListIndex() method performs a search through all
items in a combo box for a specified item.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetListIndex( _
ByVal cBox As ComboBox, _
ByVal itemToFind As String _
) As Integer

[C#]

public static int GetListIndex(


ComboBox cBox,
string itemToFind
)

[C++]

public:
static int GetListIndex(
ComboBox cBox,
String itemToFind

[J#]
public static int GetListIndex(
ComboBox cBox,
string itemToFind
)

[JScript]

Wonderware Factelligence Client API Reference Guide

540

Chapter 4 API Classes

public static function GetListIndex(


cBox : ComboBox,
itemToFind : String
) : int

Parameters

cBox
Holds the combo box being searched.
itemToFind
Holds the string to search.
Return Value

Returns the index of the item in the combo box, or -1 if not


found.

GetOperEntLinkData() Method
The GetOperEntLinkData() method retrieves the requested
rows from the Oper_Ent_Link table that links operations to
entities. The returned rows may be filtered by the Process ID,
the Operation ID and the Entity ID.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetOperEntLinkData( _
ByVal processId As Object, _
ByVal operId As Object, _
ByVal entId As Object _
) As DataSet

[C#]

public static DataSet GetOperEntLinkData(


object processId,
object operId,
object entId
)

[C++]

public:
static DataSet GetOperEntLinkData(
Object processId,
Object operId,
Object entId
)

[J#]

public static DataSet GetOperEntLinkData(


object processId,
object operId,
object entId
)

[JScript]

public static function GetOperEntLinkData(


processId : Object,
operId : Object,

Wonderware Factelligence Client API Reference Guide

Utility Class

541

entId : Object
) : DataSet

Parameters

processId
Holds the Process ID to filter the DataSet to only those
operations which are part of this process. Pass null if not
used.
operId
Holds the Operation ID to use for filtering. Pass null if not
used.
entId
Holds the Entity ID to use for filtering. Pass null if not
used.
Return Value

Returns a DataSet containing the rows from the


Oper_Ent_Link table which match the specified filters.

Exceptions

An exception is thrown if an error occurs while retrieving


the information from the database.

GetStringFromConfigFile() Method
The GetStringFromConfigFile() method gets the entry from the
configuration file which is specified by the configKey
parameter.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetStringFromConfigFile( _
ByVal configKey As String _
) As String

[C#]

public static string GetStringFromConfigFile(


string configKey
)

[C++]

public:
static String GetStringFromConfigFile(
String configKey
)

[J#]

public static string GetStringFromConfigFile(


string configKey
)

[JScript]

public static function GetStringFromConfigFile(


configKey : String
) : String

Wonderware Factelligence Client API Reference Guide

542

Chapter 4 API Classes

Parameter

configKey
Holds the key of the required config parameter.
Return Value

Returns the configuration file entry as a string if it exists;


returns an empty string if it is not defined in the file.

GetTopLevelForm() Method
The GetTopLevelForm() method searches for the form which
contains the specified control. Once the form is found, the
method returns the form as a control.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetTopLevelForm( _
ByVal factControl As Control _
) As Control

[C#]

public static Control GetTopLevelForm(


Control factControl
)

[C++]

public:
static Control GetTopLevelForm(
Control factControl
)

[J#]

public static Control GetTopLevelForm(


Control factControl
)

[JScript]

public static function GetTopLevelForm(


factControl : Control
) : Control

Parameter

factControl
Holds a reference to the control for which the top level form
should be found.
Return Value

Returns the top level form as a Control.

GetTopLevelFormName() Method
The GetTopLevelFormName() method searches for the form
which contains the specified control. Once the form is found,
the method returns the name of that form.

Wonderware Factelligence Client API Reference Guide

Utility Class

543

Syntax

[Visual Basic (Declaration)]


Public Shared Function GetTopLevelFormName( _
ByVal factControl As Control _
) As String

[C#]

public static string GetTopLevelFormName(


Control factControl
)

[C++]

public:
static String GetTopLevelFormName(
Control factControl
)

[J#]

public static string GetTopLevelFormName(


Control factControl
)

[JScript]

public static function GetTopLevelFormName(


factControl : Control
) : String

Parameter

factControl
Holds a reference to the control for which the top level form
should be found.
Return Value

Returns the name of the form as a string.

InspectorLogin() Method (String, Boolean,


String, String, User)
The InspectorLogin() method pops up a dialog to allow an
inspector to login.
Syntax

[Visual Basic (Declaration)]


Public Shared Function InspectorLogin( _
ByVal initialUserID As String, _
ByVal commentsReqd As Boolean, _
ByVal signoffNotes As String, _
<OutAttribute> ByRef comments As String,
<OutAttribute> ByRef inspector As User _
) As Boolean

[C#]

public static bool InspectorLogin(


string initialUserID,
bool commentsReqd,

Wonderware Factelligence Client API Reference Guide

544

Chapter 4 API Classes

string signoffNotes,
out string comments,
out User inspector
)

[C++]
public:
static bool InspectorLogin(
String initialUserID,
bool commentsReqd,
String signoffNotes,
[OutAttribute] String% comments,
[OutAttribute] User% inspector
)

[J#]

public static bool InspectorLogin(


string initialUserID,
bool commentsReqd,
string signoffNotes,
/** @attribute OutAttribute() */ /** @ref */
string comments,
/** @attribute OutAttribute() */ /** @ref */ User
inspector
)

[JScript]

public static function InspectorLogin(


initialUserID : String,
commentsReqd : bool,
signoffNotes : String,
OutAttribute comments : String,
OutAttribute inspector : User
) : bool

Parameters

initialUserID
Holds the default user ID for logging in.
commentsReqd
Set true if comments are required or false if they are not.
signoffNotes
Holds the notes to be displayed to explain the signoff.
comments
Holds the comments the user entered.
inspector
Holds a user object for the user who did the signoff.
Return Value

Returns true if the user signs off or false if the user does not
signoff.

Wonderware Factelligence Client API Reference Guide

Utility Class

545

InspectorLogin() Method (String, Boolean,


String, String, User, Boolean, String)
The InspectorLogin() method pops up a dialog to allow an
inspector to login. This overload pops up an Inspector dialog
which does not contain a Notes textbox.
Syntax

[Visual Basic (Declaration)]


Public Shared Function InspectorLogin( _
ByVal initialUserID As String, _
ByVal commentsReqd As Boolean, _
ByVal signoffNotes As String, _
<OutAttribute> ByRef comments As String, _
<OutAttribute> ByRef inspector As User, _
ByVal hideCertTitle As Boolean, _
ByVal initialComments As String _
) As Boolean

[C#]

public static bool InspectorLogin(


string initialUserID,
bool commentsReqd,
string signoffNotes,
out string comments,
out User inspector,
bool hideCertTitle,
string initialComments
)

[C++]

public:
static bool InspectorLogin(
String initialUserID,
bool commentsReqd,
String signoffNotes,
[OutAttribute] String% comments,
[OutAttribute] User% inspector,
bool hideCertTitle,
String initialComments
)

[J#]

public static bool InspectorLogin(


string initialUserID,
bool commentsReqd,
string signoffNotes,
/** @attribute OutAttribute() */ /** @ref */
string comments,
/** @attribute OutAttribute() */ /** @ref */ User
inspector,
bool hideCertTitle,
string initialComments
)

[JScript]

public static

function InspectorLogin(

Wonderware Factelligence Client API Reference Guide

546

Chapter 4 API Classes

initialUserID : String,
commentsReqd : bool,
signoffNotes : String,
OutAttribute comments : String,
OutAttribute inspector : User,
hideCertTitle : bool,
initialComments : String
) : bool

Parameters

initialUserID
Holds the default user ID for logging in.
commentsReqd
Set true if comments are required or false if they are not.
signoffNotes
Holds the notes to be displayed to explain the signoff.
comments
Holds the comments the user entered.
inspector
Holds a user object for the user who did the signoff.
hideCertTitle
If true, the 'Certification' title in the Inspector dialog is not
displayed.
initialComments
Used to prepopulate the comments textbox in the Inspector
dialog.
Return Value

Returns true if the user signs off or false if the user does not
signoff.

ItemIDorDesc() Method
The ItemIDorDesc() method functions to return the Item ID
for a given Item Description, or the Item Description for a
given Item ID.
Syntax

[Visual Basic (Declaration)]


Public Shared Function ItemIDorDesc( _
ByVal IDorDesc As String, _
ByVal returnIdFlag As Boolean _
) As String

[C#]

public static string ItemIDorDesc(


string IDorDesc,
bool returnIdFlag
)

[C++]

Wonderware Factelligence Client API Reference Guide

Utility Class

547

public:
static String ItemIDorDesc(
String IDorDesc,
bool returnIdFlag
)

[J#]

public static string ItemIDorDesc(


string IDorDesc,
bool returnIdFlag
)

[JScript]

public static function ItemIDorDesc(


IDorDesc : String,
returnIdFlag : bool
) : String

Parameters

IDorDesc
Holds either the Item ID or the Item description.
returnIdFlag
Set to True to return the Item ID from the given Item
Desciption, or to False to return the Item Description from
the given Item ID.
Return Value

Returns either the Item ID or the Item Description for the


specified item

LaunchExternalApplication() Method (String,


Boolean)
The LaunchExternalApplication() method launches the
specified application. It takes a string which contains the
external program to execute along with any parameters to be
passed. If a parameter is preceded by an @ symbol, it
assumed to be global otherwise it is added to the command
line as a literal string. If parameters are passed, they must
be separated by commas and cannot have a space either
before or after them. Literals must also be separated from
parameters by commas.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub LaunchExternalApplication( _
ByVal paramValue As String, _
ByVal browser As Boolean _
)

[C#]

public static void LaunchExternalApplication(


string paramValue,

Wonderware Factelligence Client API Reference Guide

548

Chapter 4 API Classes

bool browser
)

[C++]
public:
static void LaunchExternalApplication(
String paramValue,
bool browser
)

[J#]

public static void LaunchExternalApplication(


string paramValue,
bool browser
)

[JScript]

public static function LaunchExternalApplication(


paramValue : String,
browser : bool
)

Parameters

paramValue
Holds the string containing the program to execute and the
parameters and literals that make up the arguments for the
program.
browser
Set to true if a browser is being called.

LaunchExternalApplication() Method (String,


DataRow, Boolean)
The LaunchExternalApplication() method launches the
specified application. It takes a string which contains the
external program to execute along with any parameters to be
passed. If a parameter is preceded by an @ symbol, it
assumed to be global otherwise it is assumed to be part of the
current grid row (that is, the field name for one of the grid's
columns). If a parameter is not found, it added to the
command line as a literal string. If parameters are passed,
they must be separated by commas and cannot have a space
either before or after them. Literals must also be separated
from parameters by commas.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub LaunchExternalApplication( _
ByVal paramValue As String, _
ByVal gridRow As DataRow, _
ByVal browser As Boolean _
)

[C#]

Wonderware Factelligence Client API Reference Guide

Utility Class

549

public static void LaunchExternalApplication(


string paramValue,
DataRow gridRow,
bool browser
)

[C++]

public:
static void LaunchExternalApplication(
String paramValue,
DataRow gridRow,
bool browser
)

[J#]

public static void LaunchExternalApplication(


string paramValue,
DataRow gridRow,
bool browser
)

[JScript]

public static function LaunchExternalApplication(


paramValue : String,
gridRow : DataRow,
browser : bool
)

Parameters

paramValue
Holds the string containing the program to execute and the
parameters and literal that make up the arguments for the
program.
gridRow
Optional current selected row in the control's grid. Set to
null if no row is selected.
browser
Set to true if a browser is being called.

LaunchStepDocument() Method (String, String)


The LaunchStepDocument() method finds the viewer of the
specified document based on its specified type, and then runs
the viewer, passing it the path to the document.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub LaunchStepDocument( _
ByVal document As String, _
ByVal fileType As String _
)

[C#]

public static void LaunchStepDocument(


string document,

Wonderware Factelligence Client API Reference Guide

550

Chapter 4 API Classes

string fileType
)

[C++]
public:
static void LaunchStepDocument(
String document,
String fileType
)

[J#]

public static void LaunchStepDocument(


string document,
string fileType
)

[JScript]

public static function LaunchStepDocument(


document : String,
fileType : String
)

Parameters

document
Holds the path to the document.
fileType
Holds the documents file type.

OpenIPForm() Method (String)


The OpenIPForm() method modally opens the specified form.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub OpenIPForm( _
ByVal formName As String _
)

[C#]

public static void OpenIPForm(


string formName
)

[C++]

public:
static void OpenIPForm(
String formName
)

[J#]

public static void OpenIPForm(


string formName
)

[JScript]

public static function OpenIPForm(


formName : String

Wonderware Factelligence Client API Reference Guide

Utility Class

551

Parameter

formName
Holds the name of the form to open.

OpenIPForm() Method (String, FormOpenType)


The OpenIPForm() method opens the specified form in the
specified manner.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub OpenIPForm( _
ByVal formName As String, _
ByVal dialogType As FormOpenType _
)

[C#]

public static void OpenIPForm(


string formName,
FormOpenType dialogType
)

[C++]

public:
static void OpenIPForm(
String formName,
FormOpenType dialogType
)

[J#]

public static void OpenIPForm(


string formName,
FormOpenType dialogType
)

[JScript]

public static function OpenIPForm(


formName : String,
dialogType : FormOpenType
)

Parameters

formName
Holds the name of the form to open.
dialogType
Holds the method of opening the form (modal, modeless, so
on).

Wonderware Factelligence Client API Reference Guide

552

Chapter 4 API Classes

OpenIPForm() Method (String, FormOpenType,


String)
The OpenIPForm() method opens the specified form, with the
specified arguments, in the specified manner.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub OpenIPForm( _
ByVal formName As String, _
ByVal dialogType As FormOpenType,
ByVal args As String _
)

[C#]

public static void OpenIPForm(


string formName,
FormOpenType dialogType,
string args
)

[C++]

public:
static void OpenIPForm(
String formName,
FormOpenType dialogType,
String args
)

[J#]

public static void OpenIPForm(


string formName,
FormOpenType dialogType,
string args
)

[JScript]

public static function OpenIPForm(


formName : String,
dialogType : FormOpenType,
args : String
)

Parameters

formName
Holds the name of the form to open.
dialogType
Holds the method of opening the form (modal, modeless, so
on).
args
Holds the arguments passed to the form.

Wonderware Factelligence Client API Reference Guide

Utility Class

553

PadDuration() Method
The PadDuration() method gives a string containing an
elapsed time value (hhh:mm:ss format), pad the time with
leading zeros where necessary.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PadDuration( _
ByVal duration As String _
) As String

[C#]

public static string PadDuration(


string duration
)

[C++]

public:
static String PadDuration(
String duration
)

[J#]

public static string PadDuration(


string duration
)

[JScript]

public static function PadDuration(


duration : String
) : String

Parameter

duration
Holds the formatted duration.

ParseDuration() Method
The ParseDuration method gives a duration in hhh:mm:ss
format (with or without leading zeros), parse out and return
the hours, minutes and seconds.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub
ByVal duration
<OutAttribute>
<OutAttribute>
<OutAttribute>
)

ParseDuration( _
As String, _
ByRef hours As Integer, _
ByRef minutes As Integer, _
ByRef seconds As Integer _

[C#]

public static void ParseDuration(


string duration,
out int hours,
out int minutes,

Wonderware Factelligence Client API Reference Guide

554

Chapter 4 API Classes

out int seconds


)

[C++]
public:
static void ParseDuration(
String duration,
[OutAttribute] int% hours,
[OutAttribute] int% minutes,
[OutAttribute] int% seconds
)

[J#]

public static void ParseDuration(


string duration,
/** @attribute OutAttribute() */ /** @ref */ int
hours,
/** @attribute OutAttribute() */ /** @ref */ int
minutes,
/** @attribute OutAttribute() */ /** @ref */ int
seconds
)

[JScript]

public static function


duration : String,
OutAttribute hours :
OutAttribute minutes
OutAttribute seconds
)

ParseDuration(
int,
: int,
: int

Parameters

duration
Holds the formatted duration to be parsed.
hours
Returned hours.
minutes
Returned minutes.
seconds
Returned seconds.

ParseNameAndArgs() Method
The ParseNameAndArgs method takes a string which contains
a name (that is, an external program or form name) and any
arguments to be passed and parses out and returns the name
and arguments. If a parameter is preceded by an @ symbol, it
assumed to be global otherwise it is assumed to be part of the
current grid row. If a parameter is not found, it added to the
command line as a literal string. If parameters are included,
they must be separated by commas and cannot have a space
either before or after them. Literals must also be separated
from parameters by commas.

Wonderware Factelligence Client API Reference Guide

Utility Class

555

Syntax

[Visual Basic (Declaration)]


Public Shared Sub ParseNameAndArgs( _
ByVal stringToParse As String, _
ByVal gridRow As DataRow, _
ByVal browser As Boolean, _
ByVal formBeingProcessed As Boolean, _
<OutAttribute> ByRef commandName As String,
<OutAttribute> ByRef args As String _
)

[C#]

public static void ParseNameAndArgs(


string stringToParse,
DataRow gridRow,
bool browser,
bool formBeingProcessed,
out string commandName,
out string args
)

[C++]

public:
static void ParseNameAndArgs(
String stringToParse,
DataRow gridRow,
bool browser,
bool formBeingProcessed,
[OutAttribute] String% commandName,
[OutAttribute] String% args
)

[J#]

public static void ParseNameAndArgs(


string stringToParse,
DataRow gridRow,
bool browser,
bool formBeingProcessed,
/** @attribute OutAttribute() */ /** @ref */
string commandName,
/** @attribute OutAttribute() */ /** @ref */
string args
)

[JScript]

public static function ParseNameAndArgs(


stringToParse : String,
gridRow : DataRow,
browser : bool,
formBeingProcessed : bool,
OutAttribute commandName : String,
OutAttribute args : String
)

Wonderware Factelligence Client API Reference Guide

556

Chapter 4 API Classes

Parameters

stringToParse
Holds the name (program to execute or form), parameters
and literals that make up the arguments for the program.
gridRow
Optional currently selected row in the control's grid. Set to
null if no row is selected.
browser
Set to true if a browser is being called.
formBeingProcessed
If true, the entire input string is processed as arguments,
rather than as a command name and arguments.
commandName
Holds the returned program or form name.
args
Holds the returned arguments.

PopupContextMenu() Method
The PopupContextMenu() method uses the PopupMenu class
to display a context menu based on the array of strings
passed to it.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupContextMenu( _
ByVal menuParent As Control, _
ByVal point As Point, _
ByVal ParamArray menuItems As String() _
) As Integer

[C#]

public static int PopupContextMenu(


Control menuParent,
Point point,
params string[] menuItems
)

[C++]

public:
static int PopupContextMenu(
Control menuParent,
Point point,
... array<String>^ menuItems
)

[J#]

public static int PopupContextMenu(


Control menuParent,
Point point,
string[] menuItems

Wonderware Factelligence Client API Reference Guide

Utility Class

557

[JScript]
public static function PopupContextMenu(
menuParent : Control,
point : Point,
ParamArrayAttribute menuItems : String[]
) : int

Parameters

menuParent
Holds the control to which the menu is attached.
point
Holds the location at which to display the menu.
menuItems
Holds an array of strings representing the menu choices. If
a menu item has an asterisk (*) appended to the end,
disable the menu choice. If a menu item has a tilde (~)
appended to the end, hide the menu choice.
Return Value

Returns the index of the selected menu item or -1 if no


choice was made.

PopupDateTimeEntry() Method
The PopupDateTimeEntry() method pops up a DateTime entry
dialog which supports an empty date and time (for example,
for a Filter dialog). This dialog supports touchscreen entry.
Note that the "parent" control should be a TextBox, not a
DateTimePicker control.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupDateTimeEntry( _
ByVal control As Control _
)

[C#]

public static void PopupDateTimeEntry(


Control control
)

[C++]

public:
static void PopupDateTimeEntry(
Control control
)

[J#]

public static void PopupDateTimeEntry(


Control control
)

[JScript]

Wonderware Factelligence Client API Reference Guide

558

Chapter 4 API Classes

public static function PopupDateTimeEntry(


control : Control
)

Parameter

control
Holds a reference to the control into which the date and
time (possibly blank) is placed.

PopupDurationEntry() Method (Control, Int32,


Int32, Int32, Int32, Boolean)
The PopupDurationEntry() method pops up a Duration entry
dialog, which allows a duration in hours, minutes and
seconds to be entered. Minutes and seconds are limited to the
range 0 - 59. The maximum allowable value for hours (for
example, 9999) must be specified. This dialog supports
touchscreen entry. Note that the "parent" control should be a
TextBox, not a DateTimePicker control. The control's Text
property is set to the entered duration in hhh:mm:ss format.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupDurationEntry( _
ByVal control As Control, _
ByVal hoursMax As Integer, _
ByVal origHours As Integer, _
ByVal origMinutes As Integer, _
ByVal origSeconds As Integer, _
ByVal showClearButton As Boolean _
)

[C#]

public static void PopupDurationEntry(


Control control,
int hoursMax,
int origHours,
int origMinutes,
int origSeconds,
bool showClearButton
)

[C++]

public:
static void PopupDurationEntry(
Control control,
int hoursMax,
int origHours,
int origMinutes,
int origSeconds,
bool showClearButton
)

[J#]

public static void PopupDurationEntry(

Wonderware Factelligence Client API Reference Guide

Utility Class

559

Control control,
int hoursMax,
int origHours,
int origMinutes,
int origSeconds,
bool showClearButton
)

[JScript]
public static function PopupDurationEntry(
control : Control,
hoursMax : int,
origHours : int,
origMinutes : int,
origSeconds : int,
showClearButton : bool
)

Parameters

control
Holds a reference to the read-only TextBox control into
which the date and time (possibly blank) is placed.
hoursMax
Holds the maximum allowable value for hours.
origHours
Holds the current value for the Hours field.
origMinutes
Holds the current value for the Minutes field.
origSeconds
Holds the current value for the Seconds field.
showClearButton
Determines if the Clear button (which completely blanks
the sourceControl) is shown.

PopupDurationEntry() Method (NumericUpDown,


MaskedTextBox, MaskedTextBox, Int32, Int32,
Int32, Int32)
The PopupDurationEntry() method pops up a Duration entry
dialog, which allows a duration in hours, minutes and
seconds to be entered. Minutes and seconds are limited to the
range 0 - 59. The maximum allowable value for hours (for
example, 9999) must be specified. This dialog supports
touchscreen entry. This overload requires three "parent"
controls: a numeric editor for hours, a textbox for minutes
and a textbox for seconds. The Value property of the hours
control and the Text property of the minutes and seconds
controls is set based on the entered duration.

Wonderware Factelligence Client API Reference Guide

560

Chapter 4 API Classes

Note With this overload, the Clear button of the Duration Entry
dialog is not shown.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupDurationEntry( _
ByVal hoursControl As NumericUpDown, _
ByVal minutesControl As MaskedTextBox, _
ByVal secondsControl As MaskedTextBox, _
ByVal hoursMax As Integer, _
ByVal origHours As Integer, _
ByVal origMinutes As Integer, _
ByVal origSeconds As Integer _
)

[C#]

public static void PopupDurationEntry(


NumericUpDown hoursControl,
MaskedTextBox minutesControl,
MaskedTextBox secondsControl,
int hoursMax,
int origHours,
int origMinutes,
int origSeconds
)

[C++]

public:
static void PopupDurationEntry(
NumericUpDown hoursControl,
MaskedTextBox minutesControl,
MaskedTextBox secondsControl,
int hoursMax,
int origHours,
int origMinutes,
int origSeconds
)

[J#]

public static void PopupDurationEntry(


NumericUpDown hoursControl,
MaskedTextBox minutesControl,
MaskedTextBox secondsControl,
int hoursMax,
int origHours,
int origMinutes,
int origSeconds
)

[JScript]

public static function PopupDurationEntry(


hoursControl : NumericUpDown,
minutesControl : MaskedTextBox,
secondsControl : MaskedTextBox,
hoursMax : int,
origHours : int,
origMinutes : int,

Wonderware Factelligence Client API Reference Guide

Utility Class

561

origSeconds : int
)

Parameters

hoursControl
Holds a reference to the numeric editor control into which
the hours portion of the duration is placed.
minutesControl
Holds a reference to the textbox control into which the
minutes portion of the duration is placed.
secondsControl
Holds a reference to the textbox control into which the
seconds portion of the duration is placed.
hoursMax
Holds the maximum allowable value for hours.
origHours
Holds the current value for the Hours field.
origMinutes
Holds the current value for the Minutes field.
origSeconds
Holds the current value for the Seconds field.

PopupEntitySelection() Method
(EntityCapabilities, Boolean, Int32, Boolean,
Int32, String, String)
The PopupEntitySelection() method pops up the Entity dialog
which allows entities to be selected based on a specified
capability. All entities in the entity tree can be seen, but only
entities with the specified capability may be selected. One
entity can be singled out to be unselectable even if the entity
has the specified capability. An empty node may optionally
be inserted at the beginning of the tree (allow for selection of
'No Entity').
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
ByVal capability As Utility.EntityCapabilities,
_
ByVal AllowMultipleEntitySelection As Boolean, _
ByVal excludedEntID As Integer, _
ByVal includeEmptyNode As Boolean, _
<OutAttribute> ByRef entID As Integer, _
<OutAttribute> ByRef entName As String, _
<OutAttribute> ByRef entList As String _
) As Boolean

[C#]

Wonderware Factelligence Client API Reference Guide

562

Chapter 4 API Classes

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
bool AllowMultipleEntitySelection,
int excludedEntID,
bool includeEmptyNode,
out int entID,
out string entName,
out string entList
)

[C++]

public:
static bool PopupEntitySelection(
Utility.EntityCapabilities capability,
bool AllowMultipleEntitySelection,
int excludedEntID,
bool includeEmptyNode,
[OutAttribute] int% entID,
[OutAttribute] String% entName,
[OutAttribute] String% entList
)

[J#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
bool AllowMultipleEntitySelection,
int excludedEntID,
bool includeEmptyNode,
/** @attribute OutAttribute() */ /** @ref */ int
entID,
/** @attribute OutAttribute() */ /** @ref */
string entName,
/** @attribute OutAttribute() */ /** @ref */
string entList
)

[JScript]

public static function PopupEntitySelection(


capability : Utility.EntityCapabilities,
AllowMultipleEntitySelection : bool,
excludedEntID : int,
includeEmptyNode : bool,
OutAttribute entID : int,
OutAttribute entName : String,
OutAttribute entList : String
) : bool

Parameters

capability
Holds the capability the entity must have in order to be
selected.
AllowMultipleEntitySelection
Holds a boolean value to specify whether multiple entities
can be selected or not. When true, a checkbox is displayed
to select multiple entities.

Wonderware Factelligence Client API Reference Guide

Utility Class

563

excludedEntID
Holds the ID of the entity to be excluded from selection even
if it holds the specified capability.
includeEmptyNode
If this parameter is set to True, an empty node is displayed
at the top of the entity tree in the dialog. This allows for 'No
Entity' to be selected by the user
entID
Returns the ID of the selected entity.
entName
Returns the name of the selected entity.
entList
If AllowMultipleEntitySelection is true, the method returns
a comma separated list of the entity IDs (ent_ID) that are
selected in the Entity tree. If AllowMultipleEntitySelection
is false, then the ID of the selected entity is returned.
Return Value

Returns true if the user selects at least one entity.

PopupEntitySelection() Method
(EntityCapabilities, Boolean, Int32, Int32,
String, String)
The PopupEntitySelection() method pops up the Entity dialog
which allows entities to be selected based on a specified
capability. All entities in the entity tree can be seen, but only
entities with the specified capability may be selected. One
entity can be singled out to be unselectable even if the entity
has the specified capability.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
ByVal capability As Utility.EntityCapabilities,
_
ByVal AllowMultipleEntitySelection As Boolean, _
ByVal excludedEntID As Integer, _
<OutAttribute> ByRef entID As Integer, _
<OutAttribute> ByRef entName As String, _
<OutAttribute> ByRef entList As String _
) As Boolean

[C#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
bool AllowMultipleEntitySelection,
int excludedEntID,
out int entID,
out string entName,

Wonderware Factelligence Client API Reference Guide

564

Chapter 4 API Classes

out string entList


)

[C++]
public:
static bool PopupEntitySelection(
Utility.EntityCapabilities capability,
bool AllowMultipleEntitySelection,
int excludedEntID,
[OutAttribute] int% entID,
[OutAttribute] String% entName,
[OutAttribute] String% entList
)

[J#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
bool AllowMultipleEntitySelection,
int excludedEntID,
/** @attribute OutAttribute() */ /** @ref */ int
entID,
/** @attribute OutAttribute() */ /** @ref */
string entName,
/** @attribute OutAttribute() */ /** @ref */
string entList
)

[JScript]

public static function PopupEntitySelection(


capability : Utility.EntityCapabilities,
AllowMultipleEntitySelection : bool,
excludedEntID : int,
OutAttribute entID : int,
OutAttribute entName : String,
OutAttribute entList : String
) : bool

Parameters

capability
Holds the capability the entity must have in order to be
selected.
AllowMultipleEntitySelection
Holds a boolean value to specify whether multiple entities
can be selected or not. When true, a checkbox is displayed
to select multiple entities.
excludedEntID
Holds the ID of the entity to be excluded from selection even
if it holds the specified capability.
entID
Returns the ID of the selected entity.
entName
Returns the name of the selected entity.

Wonderware Factelligence Client API Reference Guide

Utility Class

565

entList
If AllowMultipleEntitySelection is true, the method returns
a comma separated list of the entity IDs (ent_ID) that are
selected in the Entity tree. If AllowMultipleEntitySelection
is false, then the ID of the selected entity is returned.
Return Value

Returns true if the user selects at least one entity.

PopupEntitySelection() Method
(EntityCapabilities, Boolean, Int32, String)
The PopupEntitySelection() method pops up the Entity dialog
which allows for an entity to be selected based on a specified
capability. All entities in the entity tree can be seen, but only
entities with the specified capability may be selected.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
ByVal capability As Utility.EntityCapabilities,
_
ByVal includeEmptyNode As Boolean, _
<OutAttribute> ByRef entID As Integer, _
<OutAttribute> ByRef entName As String _
) As Boolean

[C#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
bool includeEmptyNode,
out int entID,
out string entName
)

[C++]

public:
static bool PopupEntitySelection(
Utility.EntityCapabilities capability,
bool includeEmptyNode,
[OutAttribute] int% entID,
[OutAttribute] String% entName
)

[J#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
bool includeEmptyNode,
/** @attribute OutAttribute() */ /** @ref */ int
entID,
/** @attribute OutAttribute() */ /** @ref */
string entName
)

[JScript]

public static

function PopupEntitySelection(

Wonderware Factelligence Client API Reference Guide

566

Chapter 4 API Classes

capability : Utility.EntityCapabilities,
includeEmptyNode : bool,
OutAttribute entID : int,
OutAttribute entName : String
) : bool

Parameters

capability
Holds the capability the entity must have in order to be
selected.
includeEmptyNode
If this parameter is set to True, an empty node is displayed
at the top of the entity tree in the dialog. This allows for 'No
Entity' to be selected by the user.
entID
Returns the ID of the selected entity.
entName
Returns the name of the selected entity.
Return Value

Returns true if the user selects an entity.

PopupEntitySelection() Method
(EntityCapabilities, Int32, Int32, String)
The PopupEntitySelection() method pops up the Entity dialog
which allows an entity to be selected based on a specified
capability. All entities in the entity tree can be seen, but only
entities with the specified capability may be selected. One
entity can be singled out to be unselectable even if the entity
has the specified capability.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
ByVal capability As Utility.EntityCapabilities,
_
ByVal excludedEntID As Integer, _
<OutAttribute> ByRef entID As Integer, _
<OutAttribute> ByRef entName As String _
) As Boolean

[C#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
int excludedEntID,
out int entID,
out string entName
)

[C++]

public:

Wonderware Factelligence Client API Reference Guide

Utility Class

567

static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
int excludedEntID,
[OutAttribute] int% entID,
[OutAttribute] String% entName
)

[J#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
int excludedEntID,
/** @attribute OutAttribute() */ /** @ref */ int
entID,
/** @attribute OutAttribute() */ /** @ref */
string entName
)

[JScript]

public static function PopupEntitySelection(


capability : Utility.EntityCapabilities,
excludedEntID : int,
OutAttribute entID : int,
OutAttribute entName : String
) : bool

Parameters

capability
Holds the capability the entity must have in order to be
selected.
excludedEntID
Holds the ID of the entity to be excluded from selection even
if it holds the specified capability.
entID
Returns the ID of the selected entity.
entName
Returns the name of the selected entity.
Return Value

Returns true if the user selects an entity.

PopupEntitySelection() Method
(EntityCapabilities, Int32, String)
The PopupEntitySelection() method pops up the Entity dialog
which allows entities to be selected based on a specified
capability. All entities in the entity tree can be seen, but only
entities with the specified capability may be selected. One
entity can be singled out to be unselectable even if the entity
has the specified capability. A checkbox is displayed in the
entity tree which allows the user to select multiple entities in
the entity tree.

Wonderware Factelligence Client API Reference Guide

568

Chapter 4 API Classes

Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
ByVal capability As Utility.EntityCapabilities,
_
ByVal excludedEntID As Integer, _
<OutAttribute> ByRef entList As String _
) As Boolean

[C#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
int excludedEntID,
out string entList
)

[C++]

public:
static bool PopupEntitySelection(
Utility.EntityCapabilities capability,
int excludedEntID,
[OutAttribute] String% entList
)

[J#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
int excludedEntID,
/** @attribute OutAttribute() */ /** @ref */
string entList
)

[JScript]

public static function PopupEntitySelection(


capability : Utility.EntityCapabilities,
excludedEntID : int,
OutAttribute entList : String
) : bool

Parameters

capability
Holds the capability the entity must have in order to be
selected.
excludedEntID
Holds the ID of the entity to be excluded from selection even
if it holds the specified capability.
entList
Returns a list of entity IDs (ent_ID) that are selected in the
Entity tree, separated by a comma.
Return Value

Returns true if the user selects at least one entity.

Wonderware Factelligence Client API Reference Guide

Utility Class

569

PopupEntitySelection() Method
(EntityCapabilities, Int32, String)
The PopupEntitySelection() method pops up the Entity dialog
which allows for an entity to be selected based on a specified
capability. All entities in the entity tree can be seen, but only
entities with the specified capability may be selected.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
ByVal capability As Utility.EntityCapabilities,
_
<OutAttribute> ByRef entID As Integer, _
<OutAttribute> ByRef entName As String _
) As Boolean

[C#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
out int entID,
out string entName
)

[C++]

public:
static bool PopupEntitySelection(
Utility.EntityCapabilities capability,
[OutAttribute] int% entID,
[OutAttribute] String% entName
)

[J#]

public static bool PopupEntitySelection(


Utility.EntityCapabilities capability,
/** @attribute OutAttribute() */ /** @ref */ int
entID,
/** @attribute OutAttribute() */ /** @ref */
string entName
)

[JScript]

public static function PopupEntitySelection(


capability : Utility.EntityCapabilities,
OutAttribute entID : int,
OutAttribute entName : String
) : bool

Parameters

capability
Holds the capability the entity must have in order to be
selected.
entID
Returns the ID of the selected entity.

Wonderware Factelligence Client API Reference Guide

570

Chapter 4 API Classes

entName
Returns the name of the selected entity.
Return Value

Returns true if the user selects an entity.

PopupEntitySelection() Method (String)


The PopupEntitySelection() method pops up the Entity dialog
which allows multiple entities to be selected. A checkbox is
displayed in the entity tree which allows the user to select
multiple entities in the entity tree.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupEntitySelection( _
<OutAttribute> ByRef entList As String _
) As Boolean

[C#]

public static bool PopupEntitySelection(


out string entList
)

[C++]

public:
static bool PopupEntitySelection(
[OutAttribute] String% entList
)

[J#]

public static bool PopupEntitySelection(


/** @attribute OutAttribute() */ /** @ref */
string entList
)

[JScript]

public static function PopupEntitySelection(


OutAttribute entList : String
) : bool

Parameter

entList
Returns a list of entity IDs (ent_ID) that are selected in the
Entity tree, separated by a comma.
Return Value

Returns true if the user selects entities) in the tree.

PopupHideControlsForm() Method (Control)


The PopupHideControlsForm() method displays the Hide
Controls dialog. This allows a user to configure, at run-time,
which controls are hidden or shown.
Syntax

Wonderware Factelligence Client API Reference Guide

Utility Class

571

[Visual Basic (Declaration)]


Public Shared Function PopupHideControlsForm( _
ByVal control As Control _
) As Boolean

[C#]

public static bool PopupHideControlsForm(


Control control
)

[C++]

public:
static bool PopupHideControlsForm(
Control control
)

[J#]

public static bool PopupHideControlsForm(


Control control
)

[JScript]

public static function PopupHideControlsForm(


control : Control
) : bool

Parameter

control
Holds a reference to a control containing the controls to be
hidden or shown.
Return Value

Returns true if the user presses the OK button on the form.

PopupHideControlsForm() Method (Control,


String, String, String, Boolean)
The PopupHideControlsForm() method displays the Hide
Controls dialog. This allows a user to configure, at run-time,
which controls are hidden or shown.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupHideControlsForm( _
ByVal controlContainer As Control, _
ByVal configID As String, _
ByVal screenName As String, _
ByVal sectionId As String, _
ByVal fromProduction As Boolean _
) As Boolean

[C#]

public static bool PopupHideControlsForm(


Control controlContainer,
string configID,

Wonderware Factelligence Client API Reference Guide

572

Chapter 4 API Classes

string screenName,
string sectionId,
bool fromProduction
)

[C++]
public:
static bool PopupHideControlsForm(
Control controlContainer,
String configID,
String screenName,
String sectionId,
bool fromProduction
)

[J#]

public static bool PopupHideControlsForm(


Control controlContainer,
string configID,
string screenName,
string sectionId,
bool fromProduction
)

[JScript]

public static function PopupHideControlsForm(


controlContainer : Control,
configID : String,
screenName : String,
sectionId : String,
fromProduction : bool
) : bool

Parameters

controlContainer
Holds a reference to a control containing the controls to be
hidden or shown.
configID
Holds the config ID of the screen parameter.
screenName
Holds the name of the control that is using this form.
sectionId
Holds the name of the control's section that is using this
form.
fromProduction
Holds a boolean value indicating whether the hide control
dialog is used for production or not.
Return Value

Returns true if the user presses the OK button on the form.

Wonderware Factelligence Client API Reference Guide

Utility Class

573

PopupHideTabsForm() Method
The PopupHideTabsForm() method displays the Hide Tabs
dialog. This allows a user to configure, at run-time, which
tabs are hidden or shown.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupHideTabsForm( _
ByVal tabControl As Control, _
ByVal configID As String, _
ByVal screenName As String, _
ByVal sectionId As String _
) As Boolean

[C#]

public static bool PopupHideTabsForm(


Control tabControl,
string configID,
string screenName,
string sectionId
)

[C++]

public:
static bool PopupHideTabsForm(
Control tabControl,
String configID,
String screenName,
String sectionId
)

[J#]

public static bool PopupHideTabsForm(


Control tabControl,
string configID,
string screenName,
string sectionId
)

[JScript]

public static function PopupHideTabsForm(


tabControl : Control,
configID : String,
screenName : String,
sectionId : String
) : bool

Parameters

tabControl
Holds a reference to a tab control containing the tabs to be
hidden or shown.
configID
Holds the config ID of the screen parameter.
screenName
Holds the name of the control that is using this form.

Wonderware Factelligence Client API Reference Guide

574

Chapter 4 API Classes

sectionId
Holds the name of the control's section that is using this
form.
Return Value

Returns true if the user presses the OK button on the form.

PopupItemReasonSelection() Method (Boolean,


Int32, String)
The PopupItemReasonSelection() method displays an Item
Reason selection dialog. This dialog displays a list of Reason
Groups on the left and the specific Reasons associated with
the selected group on the right. This overload does not filter
the item reasons by item ID or entity.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupItemReasonSelection( _
ByVal includeEmptyReason As Boolean, _
<OutAttribute> ByRef reasCd As Integer, _
<OutAttribute> ByRef reasDesc As String _
) As Boolean

[C#]

public static bool PopupItemReasonSelection(


bool includeEmptyReason,
out int reasCd,
out string reasDesc
)

[C++]

public:
static bool PopupItemReasonSelection(
bool includeEmptyReason,
[OutAttribute] int% reasCd,
[OutAttribute] String% reasDesc
)

[J#]

public static bool PopupItemReasonSelection(


bool includeEmptyReason,
/** @attribute OutAttribute() */ /** @ref */ int
reasCd,
/** @attribute OutAttribute() */ /** @ref */
string reasDesc
)

[JScript]

public static function PopupItemReasonSelection(


includeEmptyReason : bool,
OutAttribute reasCd : int,
OutAttribute reasDesc : String
) : bool

Wonderware Factelligence Client API Reference Guide

Utility Class

575

Parameters

includeEmptyReason
If true, an empty entry is included at the beginning of the
list of reasons to allow for selection of 'None'.
reasCd
Holds the selected reason code.
reasDesc
Holds the selected reason description.
Return Value

Returns True if a reason was selected.

PopupItemReasonSelection() Method (String,


Int32, Boolean, Boolean, Int32, String)
The PopupItemReasonSelection() method pops up an Item
Reason selection dialog. This dialog displays a list of Reason
Groups on the left and the specific Reasons associated with
the selected group on the right.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupItemReasonSelection( _
ByVal itemID As String, _
ByVal entID As Integer, _
ByVal rejReasonsOnly As Boolean, _
ByVal includeEmptyReason As Boolean, _
<OutAttribute> ByRef reasCd As Integer, _
<OutAttribute> ByRef reasDesc As String _
) As Boolean

[C#]

public static bool PopupItemReasonSelection(


string itemID,
int entID,
bool rejReasonsOnly,
bool includeEmptyReason,
out int reasCd,
out string reasDesc
)

[C++]

public:
static bool PopupItemReasonSelection(
String itemID,
int entID,
bool rejReasonsOnly,
bool includeEmptyReason,
[OutAttribute] int% reasCd,
[OutAttribute] String% reasDesc

[J#]

Wonderware Factelligence Client API Reference Guide

576

Chapter 4 API Classes

public static bool PopupItemReasonSelection(


string itemID,
int entID,
bool rejReasonsOnly,
bool includeEmptyReason,
/** @attribute OutAttribute() */ /** @ref */ int
reasCd,
/** @attribute OutAttribute() */ /** @ref */
string reasDesc
)

[JScript]

public static function PopupItemReasonSelection(


itemID : String,
entID : int,
rejReasonsOnly : bool,
includeEmptyReason : bool,
OutAttribute reasCd : int,
OutAttribute reasDesc : String
) : bool

Parameters

itemID
Holds the ID of the item being consumed or produced.
entID
Holds only those item reasons for the specified entity are
shown.
rejReasonsOnly
Set to True to include only reject reasons.
includeEmptyReason
If true, an entry is included at the beginning of the list of
reasons to allow for selection of 'None'.
reasCd
Holds the selected reason code.
reasDesc
Holds the selected reason description.
Return Value

Returns True if a reason was selected.

PopupKeyboard() Method
The PopupKeyboard() method displays the Virtual Keyboard
dialog, which allows a user to enter an arbitrary sequence of
characters without using an actual keyboard.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupKeyboard( _
ByVal control As Control, _
ByVal allowMultipleLines As Boolean,

Wonderware Factelligence Client API Reference Guide

Utility Class

577

ByVal hideChars As Boolean _


)

[C#]

public static void PopupKeyboard(


Control control,
bool allowMultipleLines,
bool hideChars
)

[C++]

public:
static void PopupKeyboard(
Control control,
bool allowMultipleLines,
bool hideChars
)

[J#]

public static void PopupKeyboard(


Control control,
bool allowMultipleLines,
bool hideChars
)

[JScript]

public static function PopupKeyboard(


control : Control,
allowMultipleLines : bool,
hideChars : bool
)

Parameters

control
Holds a reference to the control into which the characters
entered in the virtual keyboard is placed.
allowMultipleLines
Set to true to enable multiple lines of text (for example, for
notes or comments) to be entered.
hideChars
Set to true to prevent displaying the characters being typed
(for example, for password entry)

PopupKeypad() Method (String, Int32, Decimal,


Decimal, Double)
The PopupKeyboard() method displays the Virtual Keypad
form. This form provides for numerical entry via a
touchscreen.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupKeypad( _
ByVal OrigValue As String, _

Wonderware Factelligence Client API Reference Guide

578

Chapter 4 API Classes

ByVal NumDecimals As Integer,


ByVal Minimum As Decimal, _
ByVal Maximum As Decimal, _
ByRef Keypadvalue As Double _
) As DialogResult

[C#]

public static DialogResult PopupKeypad(


string OrigValue,
int NumDecimals,
decimal Minimum,
decimal Maximum,
ref double Keypadvalue
)

[C++]

public:
static DialogResult PopupKeypad(
String OrigValue,
int NumDecimals,
decimal Minimum,
decimal Maximum,
double% Keypadvalue
)

[J#]

public static DialogResult PopupKeypad(


string OrigValue,
int NumDecimals,
decimal Minimum,
decimal Maximum,
double Keypadvalue
)

[JScript]

public static function PopupKeypad(


OrigValue : String,
NumDecimals : int,
Minimum : Decimal,
Maximum : Decimal,
Keypadvalue : double
) : DialogResult

Parameters

OrigValue
Holds the original value from the source control.
NumDecimals
Holds the number of decimals that should be used in this
keypad.
Minimum
Minimum value.
Maximum
Maximum value.

Wonderware Factelligence Client API Reference Guide

Utility Class

579

Keypadvalue
Return value from keypad if the dialog is success.
Return Value

Returns the DialogResult value of the Virtual Keypad form

PopupKeypad() Method (Control)


The PopupKeyboard() method displays the Virtual Keypad
dialog, which allows a user to enter a number without using
an actual keyboard.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupKeypad( _
ByVal control As Control _
)

[C#]

public static void PopupKeypad(


Control control
)

[C++]

public:
static void PopupKeypad(
Control control
)

[J#]

public static void PopupKeypad(


Control control
)

[JScript]

public static function PopupKeypad(


control : Control
)

Parameter

control
Holds a reference to the control into which the number
entered in the virtual keypad is placed.

PopupLotAttributes() Method (String, String)


The PopupLotAttributes() method displays a dialog to allow
the user to maintain the lot attributes of the specified
item/lot number combination.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupLotAttributes( _
ByVal itemID As String, _
ByVal lotNo As String _

Wonderware Factelligence Client API Reference Guide

580

Chapter 4 API Classes

[C#]

public static void PopupLotAttributes(


string itemID,
string lotNo
)

[C++]

public:
static void PopupLotAttributes(
String itemID,
String lotNo
)

[J#]

public static void PopupLotAttributes(


string itemID,
string lotNo
)

[JScript]

public static function PopupLotAttributes(


itemID : String,
lotNo : String
)

Parameters

itemID
Holds the ID of the item for which lot attributes are to be
shown.
lotNo
Holds the lot number for which lot attributes are to be
shown.

PopupLotAttributes() Method (String, String,


Boolean)
The PopupLotAttributes() method displays a dialog to allow
the user to view or edit the lot attributes of the specified
item/lot number combination.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupLotAttributes( _
ByVal itemID As String, _
ByVal lotNo As String, _
ByVal viewOnly As Boolean _
)

[C#]

public static void PopupLotAttributes(


string itemID,
string lotNo,
bool viewOnly

Wonderware Factelligence Client API Reference Guide

Utility Class

581

[C++]

[J#]

public:
static void PopupLotAttributes(
String itemID,
String lotNo,
bool viewOnly
)

public static void PopupLotAttributes(


string itemID,
string lotNo,
bool viewOnly
)

[JScript]

public static function PopupLotAttributes(


itemID : String,
lotNo : String,
viewOnly : bool
)

Parameters

itemID
Holds the ID of the item for which lot attributes are to be
shown.
lotNo
Holds the lot number for which lot attributes are to be
shown.
viewOnly
Set true if the user should only be allowed to view the lot
attributes. Set false if the user may view and edit the lot
attributes.

PopupNotesDlg() Method
The PopupNotesDlg() method displays the Notes dialog to
allow viewing and editing of Work Order, Job, Item and
Folders notes.
Syntax

[Visual Basic (Declaration)]


Public Shared Function PopupNotesDlg( _
ByVal notes As String, _
ByVal woID As String, _
ByVal operID As String, _
ByVal seqNo As Object, _
ByVal itemId As String, _
ByVal entId As Integer, _
ByVal verId As String, _
ByVal folderModId As String, _
ByVal fromFolders As Boolean, _

Wonderware Factelligence Client API Reference Guide

582

Chapter 4 API Classes

ByVal displayOnly As Boolean _


) As Boolean

[C#]

public static bool PopupNotesDlg(


string notes,
string woID,
string operID,
object seqNo,
string itemId,
int entId,
string verId,
string folderModId,
bool fromFolders,
bool displayOnly
)

[C++]

public:
static bool PopupNotesDlg(
String notes,
String woID,
String operID,
Object seqNo,
String itemId,
int entId,
String verId,
String folderModId,
bool fromFolders,
bool displayOnly
)

[J#]

public static bool PopupNotesDlg(


string notes,
string woID,
string operID,
object seqNo,
string itemId,
int entId,
string verId,
string folderModId,
bool fromFolders,
bool displayOnly
)

[JScript]

public static function PopupNotesDlg(


notes : String,
woID : String,
operID : String,
seqNo : Object,
itemId : String,
entId : int,
verId : String,
folderModId : String,
fromFolders : bool,
displayOnly : bool
) : bool

Wonderware Factelligence Client API Reference Guide

Utility Class

583

Parameters

notes
Holds the existing notes.
woID
Holds the Work Order ID of the job whose notes are being
displayed. This is required for WO or Job Notes, otherwise
this should be set to null.
operID
Holds the Operation ID of the job or folder whose notes are
being displayed. This is required for Job or Folder notes,
otherwise, this should be set to null.
seqNo
Holds the Operation Sequence Number of the job whose
notes are being displayed. This is required for Job notes,
otherwise, this should be set to null.
itemId
Holds the Item ID. This is required for Item or Folder notes,
otherwise this should be set to null.
entId
Holds the entity ID. This is required for Folder notes,
otherwise this should be set to -1.
verId
Holds the version ID. This is required for Folder notes,
otherwise this should be set to null.
folderModId
Holds the folder Mod ID. This is required for Folder notes,
otherwise this should be set to null.
fromFolders
Set to True for Folder notes; otherwise set to False.
displayOnly
Set to True to disable editing and appending of notes.
Return Value

Returns True only if the user changed notes and


DisplayOnlyNotes is False. This can be used to determine
whether to refresh other controls or not.

PopupOperationSelection() Method
The PopupOperationSelection() method displays an Operation
selection dialog. This dialog, given a search pattern, displays
a list of Operations which match the pattern. The selected
Operation (the oper_ID) is placed into the specified control.
Syntax

Wonderware Factelligence Client API Reference Guide

584

Chapter 4 API Classes

[Visual Basic (Declaration)]


Public Shared Sub PopupOperationSelection( _
ByVal control As Control, _
ByVal pattern As String, _
ByVal includeEmptyOperation As Boolean _
)

[C#]

public static void PopupOperationSelection(


Control control,
string pattern,
bool includeEmptyOperation
)

[C++]

public:
static void PopupOperationSelection(
Control control,
String pattern,
bool includeEmptyOperation
)

[J#]

public static void PopupOperationSelection(


Control control,
string pattern,
bool includeEmptyOperation
)

[JScript]

public static function PopupOperationSelection(


control : Control,
pattern : String,
includeEmptyOperation : bool
)

Parameters

control
Holds a reference to the control into which the selected
operation is placed.
pattern
Holds the search pattern used for populating the list of
operations shown in the dialog.
includeEmptyOperation
If true, an entry is included at the beginning of the list of
operations to allow for selection of 'None'.

PopupUtilReasonSelection() Method
The PopupUtilReasonSelection() method displays a Utilization
Reason selection dialog. This dialog,displays a list of Reason
Groups on the left and the specific Reasons associated with
the selected group on the right.
Syntax

Wonderware Factelligence Client API Reference Guide

Utility Class

585

[Visual Basic (Declaration)]


Public Shared Function PopupUtilReasonSelection( _
ByVal includeEmptyReason As Boolean, _
<OutAttribute> ByRef reasCd As Integer, _
<OutAttribute> ByRef reasDesc As String _
) As Boolean

[C#]

public static bool PopupUtilReasonSelection(


bool includeEmptyReason,
out int reasCd,
out string reasDesc
)

[C++]

public:
static bool PopupUtilReasonSelection(
bool includeEmptyReason,
[OutAttribute] int% reasCd,
[OutAttribute] String% reasDesc
)

[J#]

public static bool PopupUtilReasonSelection(


bool includeEmptyReason,
/** @attribute OutAttribute() */ /** @ref */ int
reasCd,
/** @attribute OutAttribute() */ /** @ref */
string reasDesc
)

[JScript]

public static function PopupUtilReasonSelection(


includeEmptyReason : bool,
OutAttribute reasCd : int,
OutAttribute reasDesc : String
) : bool

Parameters

includeEmptyReason
If true, an entry is included at the beginning of the list of
reasons to allow for selection of 'None'.
reasCd
Holds the selected reason code.
reasDesc
Holds the selected reason description.
Return Value

Returns True if a reason was selected.

Wonderware Factelligence Client API Reference Guide

586

Chapter 4 API Classes

PopupWorkOrderSelection() Method
The PopupWorkOrderSelection() method displays a Work
Order selection dialog. This dialog, given a search pattern,
displays a list of Work Orders which match the pattern. The
selected Work Order is placed into the specified control.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopupWorkOrderSelection( _
ByVal control As Control, _
ByVal pattern As String, _
ByVal includeEmptyWorkOrder As Boolean, _
ByVal requireFilter As Boolean _
)

[C#]

public static void PopupWorkOrderSelection(


Control control,
string pattern,
bool includeEmptyWorkOrder,
bool requireFilter
)

[C++]

public:
static void PopupWorkOrderSelection(
Control control,
String pattern,
bool includeEmptyWorkOrder,
bool requireFilter
)

[J#]

public static void PopupWorkOrderSelection(


Control control,
string pattern,
bool includeEmptyWorkOrder,
bool requireFilter
)

[JScript]

public static function PopupWorkOrderSelection(


control : Control,
pattern : String,
includeEmptyWorkOrder : bool,
requireFilter : bool
)

Parameters

control
Holds a reference to the control into which the selected
work order is placed.
pattern
Holds the search pattern used for populating the list of
Work Orders shown in the dialog.

Wonderware Factelligence Client API Reference Guide

Utility Class

587

includeEmptyWorkOrder
If true, an entry is included at the beginning of the list of
work orders to allow for selection of 'None'.
requireFilter
Determines if a filter pattern must be specified prior to
displaying the list of work orders.

ResizeWindowBasedOnFont() Method
The ResizeWindowBasedOnFont() method resizes the specified
form based on the ratio of the size of the font originally used
to the new font size.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub ResizeWindowBasedOnFont( _
ByVal origWidth As Integer, _
ByVal origHeight As Integer, _
ByVal form As Form, _
ByVal origFontSize As Single, _
ByVal newFontSize As Single, _
ByVal isCentered As Boolean _
)

[C#]

public static void ResizeWindowBasedOnFont(


int origWidth,
int origHeight,
Form form,
float origFontSize,
float newFontSize,
bool isCentered
)

[C++]

public:
static void ResizeWindowBasedOnFont(
int origWidth,
int origHeight,
Form form,
float origFontSize,
float newFontSize,
bool isCentered
)

[J#]

public static void ResizeWindowBasedOnFont(


int origWidth,
int origHeight,
Form form,
float origFontSize,
float newFontSize,
bool isCentered
)

[JScript]

Wonderware Factelligence Client API Reference Guide

588

Chapter 4 API Classes

public static function


ResizeWindowBasedOnFont(
origWidth : int,
origHeight : int,
form : Form,
origFontSize : float,
newFontSize : float,
isCentered : bool
)

Parameters

origWidth
Holds the original (as designed) width of the form being
resized
origHeight
Holds the original (as designed) height of the form being
resized
form
Holds the form to be resized.
origFontSize
Holds the original (as designed) font size of the form.
newFontSize
Holds the new font size to use for the form.
isCentered
Holds a flag to indicate if the form should be centered.

SetFont() Method
The SetFont() method recursively descends through all the
controls contained by the control passed in and sets the font
to the value specified.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetFont( _
ByVal control As Control,
ByVal font As Font _
)

[C#]

public static void SetFont(


Control control,
Font font
)

[C++]

public:
static void SetFont(
Control control,
Font font
)

Wonderware Factelligence Client API Reference Guide

Utility Class

589

[J#]
public static void SetFont(
Control control,
Font font
)

[JScript]

public static function SetFont(


control : Control,
font : Font
)

Parameters

control
Holds a reference to the control for which the font should be
set.
font
Holds a reference to the font to which to set the control.

SetTextFromKeyPad() Method (Control, String)


The SetTextFromKeyPad() method accepts a Textbox control
and a keypad value as a string. It inserts the keypad value
string into the proper place in the control or removes the
proper text if a "<--" character is passed. This method pays
attention to the selected text and makes sure that the cursor
is positioned in the proper place.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetTextFromKeyPad( _
ByVal control As Control, _
ByVal keyValue As String _
)

[C#]

public static void SetTextFromKeyPad(


Control control,
string keyValue
)

[C++]

public:
static void SetTextFromKeyPad(
Control control,
String keyValue
)

[J#]

public static void SetTextFromKeyPad(


Control control,
string keyValue
)

[JScript]

Wonderware Factelligence Client API Reference Guide

590

Chapter 4 API Classes

public static function SetTextFromKeyPad(


control : Control,
keyValue : String
)

Parameters

control
Holds the control into which the text is to be inserted.
keyValue
Holds the text to insert into the control or "<--" if text
should be removed.

SetTextFromKeyPad() Method (Control, String,


Int32)
The SetTextFromKeyPad() method accepts a Textbox control
and a keypad value as a string. It inserts the keypad value
string into the proper place in the control or removes the
proper text if a "<--" character is passed. This method pays
attention to the selected text and makes sure that the cursor
is positioned in the proper place.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub SetTextFromKeyPad( _
ByVal control As Control, _
ByVal keyValue As String, _
ByVal numDecimals As Integer _
)

[C#]

public static void SetTextFromKeyPad(


Control control,
string keyValue,
int numDecimals
)

[C++]

[J#]

public:
static void SetTextFromKeyPad(
Control control,
String keyValue,
int numDecimals
)

public static void SetTextFromKeyPad(


Control control,
string keyValue,
int numDecimals
)

[JScript]

public static function SetTextFromKeyPad(


control : Control,

Wonderware Factelligence Client API Reference Guide

Utility Class

591

keyValue : String,
numDecimals : int
)

Parameters

control
Holds the control into which the text is to be inserted.
keyValue
Holds the text to insert into the control or "<--" if text
should be removed.
numDecimals
Holds the number of decimal places that are allowed. Set to
-1 if number of decimals is not to be considered.

ShowHelpFile() Method
The ShowHelpFile() methods opens the Factelligence MES
Help file.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub ShowHelpFile()

[C#]

public static void ShowHelpFile()

[C++]

public:
static void ShowHelpFile()

[J#]

public static void ShowHelpFile()

[JScript]

public static

function ShowHelpFile()

ShowJobFlowDiagram() Method
The ShowJobFlowDiagram() method shows the Job Flow
Diagram for the supplied work order.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub ShowJobFlowDiagram( _
ByVal WoId As String _
)

[C#]

public static void ShowJobFlowDiagram(


string WoId
)

[C++]

Wonderware Factelligence Client API Reference Guide

592

Chapter 4 API Classes

public:
static void ShowJobFlowDiagram(
String WoId
)

[J#]

public static void ShowJobFlowDiagram(


string WoId
)

[JScript]

public static function ShowJobFlowDiagram(


WoId : String
)

TranslateForm() Method (Control)


The TranslateForm() method recursively descends through all
the controls contained within the specified control and
translates all the displayed language strings (such as,
translates all translatable strings in the controls' Text
property). A translatable string is a string with "nnn" within
angle brackets appended, where nnn is the string_ID from
the Language table.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub TranslateForm( _
ByVal control As Control _
)

[C#]

public static void TranslateForm(


Control control
)

[C++]

public:
static void TranslateForm(
Control control
)

[J#]

public static void TranslateForm(


Control control
)

[JScript]

public static function TranslateForm(


control : Control
)

Parameter

control
Holds a reference to the control that should be translated.

Wonderware Factelligence Client API Reference Guide

Utility Class

593

TranslateForm() Method (Control,


ILanguageStrings)
The TranslateForm() method recursively descends through all
the controls contained within the specified control and
translates all the displayed language strings (such as,
translates all translatable strings in the controls' Text
property). A translatable string is a string with "nnn" within
angle brackets appended, where nnn is the string_ID from
the Language table.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub TranslateForm( _
ByVal control As Control, _
ByVal langStrings As ILanguageStrings _
)

[C#]

public static void TranslateForm(


Control control,
ILanguageStrings langStrings
)

[C++]

public:
static void TranslateForm(
Control control,
ILanguageStrings langStrings
)

[J#]

public static void TranslateForm(


Control control,
ILanguageStrings langStrings
)

[JScript]

public static function TranslateForm(


control : Control,
langStrings : ILanguageStrings
)

Parameters

control
Holds a reference to the control that should be translated.
langStrings
Holds a reference to the language to use to translate the
form.

Wonderware Factelligence Client API Reference Guide

594

Chapter 4 API Classes

UtilRawReason Class
This class provides supporting methods for the
Util_Raw_Reas table. The Util_Raw_Reas table associates
utilization raw reasons with an entity and default reason
code.

AddUtilRawReasonLink() Method
The AddUtilRawReasonLink() method creates a utilization
reason link record for the utilization raw reason defining it
as relevant to the supplied entity.
Syntax

[Visual Basic (Declaration)]


Public Sub AddUtilRawReasonLink( _
ByValue entId As Integer, _
ByValue rawReasonCode As String, _
ByValue defReasonCode As Integer
)

[C#]
public void AddUtilRawReasonLink (
int entId,
string

rawReasonCode,

int defReasonCode
)

[C++]
public:
void AddUtilRawReasonLink (
int entId,
string

rawReasonCode,

int defReasonCode
)

[J#]
public void AddUtilRawReasonLink (
int entId,
string

rawReasonCode,

int defReasonCode
)

[Jscript]
public function AddUtilRawReasonLink (
entId

int,

rawReasonCode

string,

defReasonCode

int

Wonderware Factelligence Client API Reference Guide

UtilRawReason Class

595

Parameters

entId
Holds an integer value that identifies the entity for adding
a util raw reason link.
rawReasonCode
Holds a string that is the reason code for the I/O.
defReasonCode
Holds an integer value that is the possible final reason
code.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Delete() Method
The Delete() method removes the raw reason code record for
the entity.
Syntax

[Visual Basic (Declaration)]


Public Sub Delete( _
)

[C#]
public void Delete (
)

[C++]
public:
void Delete (
)

[J#]
public void Delete (
)

[Jscript]
public function Delete (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

596

Chapter 4 API Classes

DeleteUtilRawReasonLink() Method
The DeleteUtilRawReasonLink() method deletes the util
reason link record for the entity and raw reason code
supplied. If a raw reason code is not supplied, all raw reason
links for the entity are deleted.
Syntax

[Visual Basic (Declaration)]


Public Sub DeleteUtilRawReasonLink( _
ByValue entId As Integer, _
ByValue rawReasCd As String, _
ByValue reasCd As Integer
)

[C#]
public void DeleteUtilRawReasonLink (
int entId,
string

rawReasCd,

int reasCd
)

[C++]
public:
void DeleteUtilRawReasonLink (
int entId,
string

rawReasCd,

int reasCd
)

[J#]
public void DeleteUtilRawReasonLink (
int entId,
string

rawReasCd,

int reasCd
)

[Jscript]
public function DeleteUtilRawReasonLink (
entId

int,

rawReasCd

reasCd

int

string,

Parameters

entId
Holds an integer value that identifies the entity for deleting
a util raw reason link.

Wonderware Factelligence Client API Reference Guide

UtilRawReason Class

597

rawReasonCode
Holds a string that is the reason code for the I/O that is to
be deleted.
reasCd
Holds an integer value that is the possible final reason code
of the util raw reason link record that is being deleted.
Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetAllUtilRawReasonLinks() Method
The GetAllUtilRawReasonLinks() method returns a DataSet
containing all util_reas_link records.
Syntax

[Visual Basic (Declaration)]


Public Function GetAllUtilRawReasonLinks( _
) As DataSet

[C#]

public DataSet GetAllUtilRawReasonLinks(


)

[C++]
public:
DataSet GetAllUtilRawReasonLinks (
)

[J#]
public DataSet GetAllUtilRawReasonLinks (
)

[Jscript]
public function GetAllUtilRawReasonLinks (
)

DataSet

Return Value

Returns a DataSet containing all defined util raw reasons


links. This is filtered by entity and/or raw reason code if
they are supplied. An empty DataSet is returned if there is
an error retrieving the records.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

598

Chapter 4 API Classes

GetAllUtilRawReasonLinks() Method
The GetAllUtilRawReasonLinks() method returns a DataSet
containing all util_reas_link records. It can be optionally
filtered by an entity ID.
Syntax

[Visual Basic (Declaration)]


Public Function GetAllUtilRawReasonLinks( _
ByValue entId As Integer
) As DataSet

[C#]

public DataSet GetAllUtilRawReasonLinks(


int entId
)

[C++]
public:
DataSet GetAllUtilRawReasonLinks (
int entId
)

[J#]
public DataSet GetAllUtilRawReasonLinks (
int entId
)

[Jscript]
public function GetAllUtilRawReasonLinks (
entId
)

int

DataSet

Parameter

entId
Holds an integer value that identifies the entity to retrieve
all util raw reasons links.
Return Value

Returns a DataSet containing all defined util raw reasons


links. This is filtered by entity and/or raw reason code if
they are supplied. An empty DataSet is returned if there is
an error retrieving the records.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

UtilRawReason Class

599

GetAllUtilRawReasonLinks() Method
The GetAllUtilRawReasonLinks() method returns a DataSet
containing all util_reas_link records. It can be optionally
filtered by a util raw reason code.
Syntax

[Visual Basic (Declaration)]


Public Function GetAllUtilRawReasonLinks( _
ByValue rawReasCd As String
) As DataSet

[C#]
public DataSet GetAllUtilRawReasonLinks(
string

rawReasCd

[C++]
public:
DataSet GetAllUtilRawReasonLinks (
string

rawReasCd

[J#]
public DataSet GetAllUtilRawReasonLinks (
string

rawReasCd

[Jscript]
public function GetAllUtilRawReasonLinks (
rawReasCd
)

string

DataSet

Parameter

rawReasCd
Holds a string value identifying the raw reason code to
retrieve all util raw reason link records.
Return Value

Returns a DataSet containing all defined util raw reasons


links. The DataSet is filtered by entity and/or raw reason
code if they are supplied. An empty DataSet is returned if
there is an error retrieving the records.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

600

Chapter 4 API Classes

GetAllUtilRawReasonLinks() Method
The GetAllUtilRawReasonLinks() method returns a DataSet
containing all util_reas_link records.
Syntax

[Visual Basic (Declaration)]


Public Function GetAllUtilRawReasonLinks( _
) As DataSet

[C#]

public DataSet GetAllUtilRawReasonLinks(


)

[C++]
public:
DataSet GetAllUtilRawReasonLinks (
)

[J#]
public DataSet GetAllUtilRawReasonLinks (
)

[Jscript]
public function GetAllUtilRawReasonLinks (
)

DataSet

Return Value

Returns a DataSet containing all defined util raw reasons


links. The DataSet is filtered by entity and/or raw reason
code if they are supplied. An empty DataSet is returned if
there is an error retrieving the records.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetAllUtilRawReasonLinks() Method
The GetAllUtilRawReasonLinks() method returns a DataSet
containing all util_reas_link records. It can be optionally
filtered by an entity ID and by a util raw reason code.
Syntax

[Visual Basic (Declaration)]


Public Function GetAllUtilRawReasonLinks( _
ByValue entId As Integer, _
ByValue rawReasCd As String
) As DataSet

[C#]

public DataSet GetAllUtilRawReasonLinks(

Wonderware Factelligence Client API Reference Guide

UtilRawReason Class

601

int entId,
string

rawReasCd

[C++]
public:
DataSet GetAllUtilRawReasonLinks (
int entId,
string

rawReasCd

[J#]
public DataSet GetAllUtilRawReasonLinks (
int entId,
string

rawReasCd

[Jscript]
public function GetAllUtilRawReasonLinks (
entId

rawReasCd
)

int,
:

string

DataSet

Parameters

entId
Holds an integer value identifying the entity to retrieve all
util raw reasons links.
rawReasCd
Holds a string value identifying the raw reason code to
retrieve all util raw reason link records.
Return Value

Returns a DataSet containing all defined util raw reasons


links. The DataSet is filtered by an entity and/or the raw
reason code if they are supplied. An empty DataSet is
returned if there is an error retrieving the records.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUtilRawReasons() Method
The GetUtilRawReason() method returns a DataSet of all
defined util raw reasons.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilRawReasons( _

Wonderware Factelligence Client API Reference Guide

602

Chapter 4 API Classes

) As DataSet

[C#]

public DataSet GetUtilRawReasons(


)

[C++]
public:
DataSet GetUtilRawReasons (
)

[J#]
public DataSet GetUtilRawReasons (
)

[Jscript]
public function GetUtilRawReasons (
)

DataSet

Return Value

Returns a DataSet containing all util raw reasons defined


(for the supplied entity if one is supplied). An empty
DataSet is returned if the records cannot be retrieved.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUtilRawReasons() Method
The GetUtilRawReason() method returns a DataSet of all
defined util raw reasons. It can be optionally filtered by an
entity ID.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilRawReasons( _
ByValue entId As Integer
) As DataSet

[C#]

public DataSet GetUtilRawReasons(


int entId
)

[C++]
public:
DataSet GetUtilRawReasons (
int entId
)

[J#]
public DataSet GetUtilRawReasons (

Wonderware Factelligence Client API Reference Guide

UtilRawReason Class

603

int entId
)

[Jscript]
public function GetUtilRawReasons (
entId
)

int

DataSet

Parameter

entId
Holds an integer value that identifies the entity for which it
needs to get all util raw reasons.
Return Value

Returns a DataSet containing all util raw reasons defined


(for the supplied entity if one is supplied). An empty
DataSet is returned if the records cannot be retrieved.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Refresh() Method
The Refresh() method reads the util raw reason information
from the database to refresh the info in memory.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub Refresh( _
)

[C#]
Public void Refresh(
)

[C++]
public:
void Refresh (
)

[J#]
public void Refresh (
)

[Jscript]
public void Refresh (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

604

Chapter 4 API Classes

Save() Method
The Save() method adds or updates the utilization raw reason
based on changes in memory information.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub Save( _
)

[C#]
Public void Save(
)

[C++]
public:
void Save (
)

[J#]
public void Save(
)

[Jscript]
public void Save (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UtilReason Class
The UtilReason class provides supporting methods for the
Util_Reas table. The Util_Reas table associates utilization
reasons, such as, running or maintenance, with entity states.

Delete() Method
The Delete() method removes the util reason.
Syntax

[Visual Basic (Declaration)]


Public Sub Delete( _
)

[C#]
public void Delete (
)

[C++]
public:

Wonderware Factelligence Client API Reference Guide

UtilReason Class

605

void Delete (
)

[J#]
public static void Delete (
)

[Jscript]
public function Delete (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUtilReasons() Method
The GetUtilReasons() method obtains a DataSet, containing
all defined utilization reasons, ordered by reason's group.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetUtilReasons() As DataSet

[C#]

public static DataSet GetUtilReasons()

[C++]

public:
static DataSet GetUtilReasons()

[J#]

public static DataSet GetUtilReasons()

[JScript]

public static

function GetUtilReasons() : DataSet

Return Value

Returns a DataSet containing all defined utilization


reasons.

LoadHashTableWithUtilReasonData() Method
The LoadHashTableWithUtilReasonData() method creates and
loads a Hashtable containing utilization reason data, keyed
by reason code.
Syntax

[Visual Basic (Declaration)]


Public Shared Function
LoadHashTableWithUtilReasonData() As Hashtable

[C#]

public static Hashtable


LoadHashTableWithUtilReasonData()

Wonderware Factelligence Client API Reference Guide

606

Chapter 4 API Classes

[C++]
public:
static Hashtable LoadHashTableWithUtilReasonData()

[J#]

public static Hashtable


LoadHashTableWithUtilReasonData()

[JScript]

public static function


LoadHashTableWithUtilReasonData() : Hashtable

Return Value

Returns a Hashtable containing the data

Refresh() Method
The Refresh() method reads the util reason information from
the database to refresh the info in memory.
Syntax
[Visual Basic (Declaration)]
Public Shared Sub Refresh( _
)

[C#]
Public void Refresh(
)

[C++]
public:
void Refresh (
)

[J#]
public void Refresh (
)

[Jscript]
public void Refresh (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Save() Method
The Save() method adds or updates the utilization reason
based on changes in memory information.
Syntax
[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

UtilReasonGrp Class

607

Public Shared Sub Save( _


)

[C#]
Public void Save(
)

[C++]
public:
void Save (
)

[J#]
public void Save(
)

[Jscript]
public void Save (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

UtilReasonGrp Class
This class provides supporting methods for the
Util_Reas_Grp table. The Util_Reas_Grp table defines
groups of reasons that a machine may go into a certain state.

Delete() Method
The Delete() method removes the utilization reason group.
Syntax

[Visual Basic (Declaration)]


Public Sub Delete( _
)

[C#]
public void Delete(
)

[C++]
public:
void Delete(
)

[J#]
public static void Delete(
)

[Jscript]

Wonderware Factelligence Client API Reference Guide

608

Chapter 4 API Classes

public function Delete(


)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetUtilReasonGroups() Method
The GetUtilReasonGroups() method returns a DataSet of all
defined util reason groups.
Syntax

[Visual Basic (Declaration)]


Public Function GetUtilReasonGroups( _
) As DataSet

[C#]

public DataSet GetUtilReasonGroups (


)

[C++]
public:
DataSet GetUtilReasonGroups (
)

[J#]
public DataSet GetUtilReasonGroups (
)

[Jscript]
public function GetUtilReasonGroups (
)

DataSet

Return Value

Returns a DataSet of all utilization reason groups that are


defined. An empty DataSet is returned if there is an error.

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Refresh() Method
The Refresh() method reads the util reason group information
from the database to refresh the info in memory.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub Refresh( _
)

[C#]

Wonderware Factelligence Client API Reference Guide

UtilReasonGrp Class

609

Public void Refresh(


)

[C++]
public:
void Refresh (
)

[J#]
public void Refresh (
)

[Jscript]
public void Refresh (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Save() Method
The Save() method adds or updates the utilization reason
group based on changes in memory information.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub Save( _
)

[C#]
Public void Save(
)

[C++]
public:
void Save (
)

[J#]
public void Save(
)

[Jscript]
public void Save (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

610

Chapter 4 API Classes

UtilState Class
The UtilState class provides supporting methods for the
Util_State table. The Util_State table contains the
description and color associated with each entity utilization
state, such as, running or idle.

Delete() Method
The Delete() method removes the utilization state.
Syntax

[Visual Basic (Declaration)]


Public Sub Delete( _
)

[C#]
public void Delete (
)

[C++]
public:
void Delete (
)

[J#]
public void Delete(
)

[Jscript]
public function Delete(
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

GetAllStates() Method
The GetAllStates() method returns a data set containing all
defined utilization state information including the state cd
which is a unique integer used to identify the utilization
state, the description, and the color defined for the utilization
state.
Syntax

[Visual Basic (Declaration)]


Public Shared Function GetAllStates() As DataSet

[C#]

public static DataSet GetAllStates()

[C++]

Wonderware Factelligence Client API Reference Guide

UtilState Class

611

public:
static DataSet GetAllStates()

[J#]

public static DataSet GetAllStates()

[JScript]

public static

function GetAllStates() : DataSet

Return Value

Returns a DataSet containing all defined utilization states.

GetStateDataFromComboBoxEntry() Method
Given an entry from a combo box populated with StateData
objects, the GetStateDataFromComboBoxEntry() method
returns the state code and description.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub GetStateDataFromComboBoxEntry( _
ByVal comboBoxEntry As Object,

<OutAttribute> ByRef stateDesc As String,

<OutAttribute> ByRef stateCd As Integer _


)

[C#]
public static void GetStateDataFromComboBoxEntry(
object comboBoxEntry,
out string stateDesc,
out int stateCd
)

[C++]
public:
static void GetStateDataFromComboBoxEntry(
Object comboBoxEntry,
[OutAttribute] String% stateDesc,
[OutAttribute] int% stateCd
)

[[J#]}
public static void GetStateDataFromComboBoxEntry(
object comboBoxEntry,
/** @attribute OutAttribute() */ /** @ref */ string
stateDesc,
/** @attribute OutAttribute() */ /** @ref */ int
stateCd
)

[JScript]

Wonderware Factelligence Client API Reference Guide

612

Chapter 4 API Classes

public static

function GetStateDataFromComboBoxEntry(

comboBoxEntry : Object,
OutAttribute stateDesc : String,
OutAttribute stateCd : int
)

Parameters

comboBoxEntry
Holds a StateData object from a combo box.
stateDesc
Holds the returned state description.
stateCd
Holds the returned state code.

PopulateComboBoxWithEntStates() Method
The PopulateComboBoxWithEntStates() method populates the
specified combo box with entity utilization state descriptions
from the Util_State table. Each combo box entry is a
StateData instance, so that the associated state ID is stored
with each description.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub PopulateComboBoxWithEntStates( _
ByVal cboStates As ComboBox,

ByVal includeEmptyDesc As Boolean _


)

[C#]
public static void PopulateComboBoxWithEntStates(
ComboBox cboStates,
bool includeEmptyDesc
)

[C++]
public:
static void PopulateComboBoxWithEntStates(
ComboBox cboStates,
bool includeEmptyDesc
)

[J#]
public static void PopulateComboBoxWithEntStates(
ComboBox cboStates,
bool includeEmptyDesc
)

Wonderware Factelligence Client API Reference Guide

UtilState Class

613

[JScript]
public static

function PopulateComboBoxWithEntStates(

cboStates : ComboBox,
includeEmptyDesc : bool
)

Parameters

cboStates
Holds the combo box to populate.
includeEmptyDesc
If true, an empty entry is placed at the beginning of the
ComboBox.

Refresh() Method
The Refresh() method reads the util state information from
the database to refresh the info in memory.
Syntax

[Visual Basic (Declaration)]


Public Shared Sub Refresh( _
)

[C#]
Public void Refresh(
)

[C++]
public:
void Refresh (
)

[J#]
public void Refresh (
)

[Jscript]
public void Refresh (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Save() Method
The Save() method adds or updates the utilization state
based on changes in memory information.
Syntax

[Visual Basic (Declaration)]

Wonderware Factelligence Client API Reference Guide

614

Chapter 4 API Classes

Public Shared Sub Save( _


)

[C#]
Public void Save(
)

[C++]
public:
void Save (
)

[J#]
public void Save(
)

[Jscript]
public void Save (
)

Exceptions

This method throws an exception if an error occurs while


saving the information to the database.

Wonderware Factelligence Client API Reference Guide

615

Index

Symbols
) 470

A
AddCons() Method 311
AddConsByLot() Method (String) 315
AddConsByLot() Method (String,
Double) 315
AddConsDirect() Method 227
AddConsPostExec() Method 231
AddDirectory() Method 123
AddDirectory() Method (Int32,
String) 122
AddEntity() Method 183
AddEntShift() Method 416
AddJobEvent() Method 236
AddLotAttrs() Method 243
AddProdPostExec() Method 243
AddShift() Method 124
AddUser() Method 488
AddUserGroup() Method 494
AddUserToGroups () Method 457
AddUtilRawReasonLink() Method 594
API Methods Reference 227

C
CalculateProductionTarget() Method 320
ChangePassword Method() Method 72
ClearFormLoginStatus() Method 73
CloneUser() Method 459
CloneUserGroup() Method 495
CloseChildForms() Method 74
CloseIPForm() Method 532

ConvertStringToEnum() Method 533


CopyEntityShiftSchedule() Method 127,
419

D
data retrieval
about 25
DefineShift () Method 419
Delete() Method (UtilRawReason
Class) 595
Delete() Method (UtilReasonGrp
Class) 607
Delete() Method (UtilReasons Class) 604
Delete() Method (UtilStates Class) 610
DeleteEntity() Method 189
DeleteEntShift() Method 420
DeleteShift() Method 128, 421
DeleteUIConfigDefaultValue()
Method 436
DeleteUIConfigValue() Method 437
DeleteUserGroup() Method 496
DeleteUtilRawReasonLink() Method 596
documentation conventions 19

E
End Session() Method 74
EndAllJobs () Method 249
EndJob() Method 129, 247, 321
EntIdFromName() Method 130

F
FindButtonBar() Method 534
FormatDuration() Method 534

Wonderware Factelligence Client API Reference Guide

616

FormatUser() Method 489

G
GetAllJobStates() Method 250
GetAllShifts() Method 422
GetAllStates() Method 610
GetAllUtilRawReasonLinks()
Method 597, 598, 599, 600
GetAttrID() Method (String) 44
GetAttrID() Method (String, Generic
Nullable) 45
GetAttrs() Method 46
GetAttrSet() Method 46
GetAttrsVisibleInInv Method 47
GetAttrValue() Method (String, String,
String, String) 48
GetAttrValue() Method (String, String,
String, String, String, String) 49
GetAttrValue() Method (String, String,
String, String, String, String, String,
String) 51
GetAutoLoginUserId() Method 535
GetAutoLoginUserPw() Method 536
GetAutoLogonEntId() Method 536
GetAutoLogonEntIds() Method 537
GetAvailLots() Method 322
GetBatchOfJobs() Method 250
GetCodeColor() Method 537
GetConfirmation() Method 250
GetConsData() Method 324
GetCountsAndDuration() Method 191,
517
GetCurUserCurEntInfo Method (Int32,
Int32) 75
GetCurUserCurEntInfo Method (Object,
Object) 76
GetDirectories() Method 131
GetDirectories() Method (entID,
seqNo) 132
GetDownstreamOperations()
Method 253
GetDownstreamProduction() Method 255
GetDS() Method 77
GetDSbySQL() Method 78
GetEntAttributes() Method 53, 133
GetEntAttrs() Method (Int32) 53
GetEntChildren() Method 194
GetEntityFromComboBoxEntry (Object,
Int32, String) 195

Wonderware Factelligence Client API Reference Guide

GetEntityFromComboBoxEntry Method
(Object, Generic Nullable, String) 197
GetEntityShiftSchedule() Method 139
GetEntList() Method 460
GetEntProperties() Methods 197
GetGroupId() Method 497
GetHashCode() Method 54
GetInstance() Method 78
GetItemGrade() Method 538
GetJob() Method 256
GetJobAttrs() Method 54
GetJobAttrs() Method (String, String,
Int32)(Jobs Class) 260
GetJobAttrs() Method (String, String,
Int32, Int32)(Jobs Class) 262
GetJobBomAvailSubst() Method
(JobExec Class) 265
GetJobBomAvailSubst() Method (Jobs
Class) 263
GetJobBOMData() Method (JobExec
Class) 326
GetJobBOMData() Method (Jobs
Class) 265
GetJobBOMProducibles() Method
(JobExec Class) 268
GetJobBOMProducibles() Method (Jobs
Class) 266
GetJobBomSubst() Method (JobExec
Class) 269
GetJobBomSubst() Method (Jobs
Class) 268
GetJobBomSubstitutesForSerializedItem
() Method 269
GetJobBOMWithSubData() Method
(JobExec Class) 272
GetJobBOMWithSubData() Method (Jobs
Class) 270
GetJobEvents() Method (JobExec
Class) 329
GetJobEvents() Method (Jobs Class) 257,
272
GetJobExecData() Method 259
GetJobPos() Method 134, 275
GetJobQueue() Method 273
GetJobsByWo() Method 274
GetJobSchedData() Method 274
GetJobStateData() Method 275
GetJobString 136
GetLangStringsObject() Method 79
GetLanguages() Method 398

617

GetListIndex() Method 539


GetLotAttrs() Method (Attrs Class) 55
GetNextWOId() Method 276
GetNumberOfJobsOnEntUserLoggedInto
() Method 137
GetOEEExecData() Method 509, 604
GetOldAvailableReasons() Method 510
GetOldAvailableReasons() Method (Util
Class) 519
GetOldAvailableReasons() Method
(UtilExec Class) 519
GetOperationDataFromComboBoxEntry(
) Method 407
GetOperationsForWorkOrder()
Method 408
GetOperEntLinkData() Method 540
GetParameterValue() Method 439
GetPrivObject() Method 486
GetProdData() Method 276
GetProduction () Method 394
GetQueue() Method (JobExec Class) 333
GetQueue() Method (Jobs Class) 276
GetScheduledJobForWo() Method 278
GetServerTime() Method 80
GetShiftDataFromComboBoxEntry()
Method 422
GetShiftID() Method 424
GetShortages() Method 335
GetSPCCharJobData() Method 335
GetStartQtyOfItemInWO() Method 279
GetStateDataFromComboBoxEntry()
Method (UtilStates Class) 611
GetStringFromConfigFile() Method 541
GetTagValue 137
GetTopLevelForm() Method 542
GetTopLevelFormName() Method 542
GetType Method() Method 57
GetUserDataFromComboBoxEntry
Method 490
GetUserGroupEntities() Method 499
GetUserGroupLinks() Method 502, 503,
504
GetUserGroups() Method 498, 499
GetUsers() Method (Boolean)(Users
Class) 492
GetUsers() Method (Users Class) 491
GetUsersOnEnt() Method 138, 280
GetUtilByFilter() Method 522
GetUtilByTimePeriod() Method 526

GetUtilExecData() Method 511


GetUtilExecData() Method (Util
Class) 520
GetUtilExecData() Method (UtilExec
Class) 520
GetUtilLogData() Method 512
GetUtilLogData() Method (Util
Class) 520
GetUtilLogData() Method (UtilExec
Class) 520
GetUtilRawReasons() Method 601, 602
GetUtilReasonGroups() Method 608
GetUtilReasons() Method 521
GetUtilReasons() Method (Util
Class) 513
GetUtilReasons() Method (UtilExec
Class) 280
GetUtilReasons() Method (UtilReasons
Class) 605
GetValue() Method 402
GetWO() Method 280
GetWOAttrs() Method 57
GetWoForSerializedItems() Method 281
GetWORouteData() Method 282
GiveUserGroupEntityAccess()
Method 500

I
InspectorLogin() Method (String,
Boolean, String, String, User) 543
InspectorLogin() Method (String,
Boolean, String, String, User, Boolean,
String) 545
IsFirstJob() Method 283
IsUserLoggedIntoJob() Method (Int32,
String, String, Int32) 461
IsUserLoggedIntoJob() Method (String,
String, Int32) 462
IsUserLoggedOntoEnt() Method 463
ItemConsSplit() Method 285
ItemIDorDesc() Method 546

J
JobBasedLogin() Method 464
JobPos 394
JobStateDesc() Mothod 288

L
LaunchExternalApplication() Method
(String, Boolean) 547

Wonderware Factelligence Client API Reference Guide

618

LaunchExternalApplication() Method
(String, DataRow, Boolean) 548
LaunchStepDocument() Method (String,
String) 549
ListImageNames() Methods 412
LoadHashTableWithUtilReasonData()
Method 605
LoadImage() Method 412
Login() Method 80
LoginWithDialog Method (String,
Boolean, Boolean, Boolean, String) 85
LoginWithDialog() Method (String) 81
LoginWithDialog() Method (String,
Boolean, Boolean) 82
LoginWithDialog() Method (String,
Boolean, Boolean, Boolean) 84
LogOffAllUsers() Method 87
LogOffCurrentUser() Method 87
LogoffEnt Method 465
LogoffEntList() Method 465
LogOffJob() Method 466
LogOffJobWithDialog() Method 468
LogOffUser() Method (String) 88
LogOffUser() Method (String,
Boolean) 89
LogonEnt() Method 469
LogonEntList() Method (String,
DataTable) 471
LogonEntWithDialog() Method
(Boolean) 472
LogonEntWithDialog() Method (Boolean,
Object) 473
LogonEntWithDialog() Method (Boolean,
Object, String) 474
LogOnJob() Method 475

M
MaxSessions() Method 401
MayAccessEntity() Method 477
ModuleLicensed() Method 401

N
NumberOfJobsRunning() Method 198

O
OnRefreshControls() Method 90, 140
OpenIPForm() Method (String) 550
OpenIPForm() Method (String,
FormOpenType) 551

Wonderware Factelligence Client API Reference Guide

OpenIPForm() Method (String,


FormOpenType, String) 552

P
PadDuration() Method 553
ParseDuration() Method 553
ParseNameAndArgs() Method 554
PauseJob() Method (Ent Class) 140
PauseJob() Method (JobStates, String,
String, Int32, String, Boolean,
Int32)(JobExec Class) 336
PauseJob() Method (JobStates, String,
String, Int32, String, Boolean, Int32,
Boolean)(JobExec Class) 338
PopulateComboBoxWithEntStates()
Method 612
PopulateComboBoxWithOperations()
Method 289
PopulateComboBoxWithSeqNos()
Method 410
PopulateComboBoxWithUsers()
Method 493
PopulateEntityComboBox() Method
(ComboBox, Boolean) 199
PopulateEntityComboBox() Method
(ComboBox, DataTable, Boolean) 200
PopUpAddConsDlg Method (String,
Boolean, String, String, Object, Boolean,
Boolean, Boolean, Boolean, Boolean,
Double, Double, Double, Int32) 340
PopUpAddConsDlg() Method (String,
Boolean, String, String, Object, Boolean,
Boolean, Boolean, Boolean, Boolean,
Double, Double, Double, Int32, Double,
Object, Object) 344
PopupAddProdDlg() Method (String,
String, Boolean, Double, Double, Double,
String, DateTime, Int32) 348
PopupAddProdDlg() Method (String,
String, Double, Double, Double,
String) 350
PopupAddWasteDlg() Method 352
PopupConfigureMiddlewareAccess()
Method 90
PopupContextMenu() Method 556
PopupCreateJobDialog() Method
(JobExec Class) 354
PopupCreateJobDialog() Method (Jobs
Class) 289
PopupDateTimeEntry() Method 557

619

PopupDurationEntry() Method (Control,


Int32, Int32, Int32, Int32, Boolean) 558
PopupDurationEntry() Method
(NumericUpDown, MaskedTextBox,
MaskedTextBox, Int32, Int32, Int32,
Int32) 559
PopupEditConsDlg() Method 354
PopupEditProdDlg() Method (String,
String, Int32, String, Int32, Int32,
DateTime, Boolean, Double) 356
PopupEditProdDlg() Method (String,
String, Int32, String, Int32, Int32,
DateTime, Boolean, Double, String) 358
PopupEntitySelection() Method
(EntityCapabilities, Boolean, Int32,
Boolean, Int32, String, String) 561
PopupEntitySelection() Method
(EntityCapabilities, Boolean, Int32,
Int32, String, String) 563
PopupEntitySelection() Method
(EntityCapabilities, Boolean, Int32,
String) 565
PopupEntitySelection() Method
(EntityCapabilities, Int32, Int32,
String) 566
PopupEntitySelection() Method
(EntityCapabilities, Int32, String) 567,
569
PopupEntitySelection() Method
(String) 570
PopupHideControlsForm() Method
(Control) 570
PopupHideControlsForm() Method
(Control, String, String, String,
Boolean) 571
PopupHideTabsForm() Method 573
PopupItemAttributes() Method
(String) 57
PopupItemReasonSelection() Method
(Boolean, Int32, String) 574
PopupItemReasonSelection() Method
(String, Int32, Boolean, Boolean, Int32,
String) 575
PopupJobAttrsDlg Method (String,
String, Int32, String) 59
PopupJobAttrsDlg() Method (String,
String, Int32, String, ColumnList) 60
PopupJobBOMDlg() Method 290
PopupJobEventDlg() Method (JobExec
Class) 293
PopupJobEventDlg() Method (Jobs
Class) 291

PopupJobSplitDlg 293
PopupKeyboard() Method 576
PopupKeypad() Method (Control) 579
PopupKeypad() Method (String, Int32,
Decimal, Decimal, Double) 577
PopupLotAttributes() Method (String,
String) 579
PopupLotAttributes() Method (String,
String, Boolean) 580
PopupLotNoAttributes() Method (String,
String) 61
PopupLotNoAttributes() Method (String,
String, Boolean, ColumnList) 62
PopupNotesDlg() Method 581
PopupOperationSelection() Method 583
PopupReduceConsDlg() Method 362
PopupReduceProdDlg() Method
(DateTime, String, String, String, Int32,
Int32, String, Double, Double, Double,
Object, String, Int32, Boolean) 365
PopupReduceProdDlg() Method
(DateTime, String, String, String, Int32,
Int32, String, Double, Object, String,
Int32) 369
PopupSelectPausedStateDlg()
Method 295
PopupSetConsLotDataDlg() Method 371
PopupSetProdLotDataDlg() Method 295
PopupStartSomeDlg() Method (String,
Int32, String, String, Int32, Double,
Double, Double, Double) 297
PopupStartSomeDlg() Method (String,
String, String, Int32, Double, Double,
Double, Double) 299
PopupSwitchUserDialog() Method
(String, String) 90
PopupSwitchUserDialog() Method
(String, String, Boolean) 92
PopupUtilReasonSelection() Method 584
PopupWorkOrderSelection() Method 586
PrepareProductionAttributes()
Method 146, 201, 204
PromptForQuantities() Method 144
PromptForQuantities() Method (String,
String, String, Int32, Double, Double,
Double, String) 144

R
ReadTextFile() Method 93
ReadUIConfigDefaultValue()
Method 440

Wonderware Factelligence Client API Reference Guide

620

ReadUIConfigValue() Method 441


ReadyJob() Method 375
Refresh() Method 376, 404, 528
Refresh() Method (UtilRawReason
Class) 603
Refresh() Method (UtilReasonGrp
Class) 608
Refresh() Method (UtilReasons
Class) 606
Refresh() Method (UtilStates Class) 613
RefreshCurUserStatusDataSet()
Method 94, 478
RefreshCurUserStatusRecordset()
Method 478
RefreshCurUserStatusRecordset()
Method (DataSet) 478
RegisterDNCControl() Method 94, 377
RejectProd() Method 377
RemoveControlFromSingleSignOn()
Method 95
ResizeWindowBasedOnFont()
Method 587
RestoreControlsVisibility() Method 442
RestoreControlsVisibilityFromDefaults()
Method 444
RestoreTabsVisibilityFromDefaults()
Method 445

S
Save() Method (UtilRawReason
Class) 604
Save() Method (UtilReasonGrp
Class) 609
Save() Method (UtilReasons Class) 606
Save() Method (UtilStates Class) 613
SaveControlsVisibility() Method 446
SaveControlsVisibilityAsDefaults()
Method 447
SaveEntList() Method 446, 479
SaveTabsVisibility() Method 448
SaveTabsVisibilityAsDefaults()
Method 450
SaveTextFile() Method 96
SaveUIConfigDefaultValue() Method 451
SaveUIConfigDefaultValues()
Method 452
SaveUIConfigValue() Method 453
SaveUIConfigValues() Method 455
SelectEntityInComboBox() Method
(ComboBox, Generic Nullable) 208

Wonderware Factelligence Client API Reference Guide

SelectEntityInComboBox() Method
(ComboBox, Int32) 207
SendXMLCmd() Method (String) 97
SendXMLCmd() Method (String,
DateTime) 99
SendXMLCmd() Method (String,
Int32) 100
SendXMLCmd() Method (String, Int32,
DateTime) 101
SendXMLCmd() Method (String, Int32,
String) 102
SendXMLCmd() Method (String,
String) 104
SendXMLCmd() Method (String, String,
Int32) 105
SendXMLCmd() Method (String,
XMLParser) 98
SetAttrValue() Method (String, Object,
String, String, String, String, String,
Boolean) 64
SetAttrValue() Method (String, Object,
String, String, String, String, String,
String, String, Boolean) 65
SetAttrValue() Method (String, Object,
String, String, String, String, String,
String, String, String, String,
Boolean) 68
SetCurJobExec() Method (Int32) 149
SetCurJobExec() Method (String, String,
Int32) 150
SetCurLotdata() Method 378
SetEntAttributes() Method 151
SetFont() Method 588
SetJobConcurrentLink() Method 302
SetJobQueue() Method 303
SetLotAttrs() Method 305
SetProdProcessedFlag() Method 305
SetRawReason() Method 514
SetTagValue() Method 152
SetTextFromKeyPad() Method (Control,
String) 589
SetTextFromKeyPad() Method (Control,
String, Int32) 590
SetUIScreenTagValues() Method 380
SetUserGroupPrivileges() Method 505
SetUserGroupPrivValue() Method 507
ShowHelpFile() Method 591
ShowJobFlowDiagram() Method 591
SplitJob() Method 306
StartDataEntryJob() Method 381

621

StartJob() Method (Ent Class) 154


StartJob() Method (JobExec Class) 383
StartLoggingXMLMsgs() Methods 106
StartSession() Method 107
StartSome() Method 309
SwitchUser() Method 108

T
technical support, contacting 20
timestamping 25
ToString() Method (AttrData Class) 170,
311, 399, 405, 412, 429, 456, 614
Translate() Method 399
TranslateForm() Method (Control) 592
TranslateForm() Method (Control,
ILanguageStrings) 593

U
UnreadyJob() Method 385
UnregisterDNCControl() Method 110
UpdateEntity() Method 155, 209
UpdateEntShift() Method 425
UpdateJobExec() Method 214
UpdateOEEExec() Method 221
UpdateShift 167
UpdateShift() Method 167, 428
UpdateSystemParameter() Method 110
UpdateUser() Method 480
UpdateUserGroup () Method 508
UpdateUtilExec() Method 224

V
VerifyUser() Method 111

Wonderware Factelligence Client API Reference Guide

622

Wonderware Factelligence Client API Reference Guide

Anda mungkin juga menyukai