SoftOne BlackBook ENG_v.1.0

March 19, 2018 | Author: Nick | Category: Boolean Data Type, Databases, Object (Computer Science), Sql, Table (Database)


Comments



Description

Contents1|Page Contents CONTENTS CHAPTER 1 Screen Forms ............................................................................................................ 11 Overview ................................................................................................................................................. 12 A. Form Design ....................................................................................................................................... 13 A.1 Design Options .....................................................................................................................................................................................15 A.2 Toolbar Overview .................................................................................................................................................................................16 B. Layout Controls .................................................................................................................................. 24 B.1 Tabs ............................................................................................................................................................................................................24 B.2 Panels ........................................................................................................................................................................................................25 B.3 Nested Panels ........................................................................................................................................................................................26 B.4 Sub Forms................................................................................................................................................................................................27 C. Data Controls...................................................................................................................................... 31 C.1 String Textbox .......................................................................................................................................................................................31 C.2 Numeric Textbox ..................................................................................................................................................................................33 C.3 Memo Textbox ......................................................................................................................................................................................35 C.4 Password Textbox ................................................................................................................................................................................36 C.5 Webpage / Email Textbox .................................................................................................................................................................37 C.6 Datagrid ...................................................................................................................................................................................................38 C.7 Selector List ............................................................................................................................................................................................40 C.8 Combo Box .............................................................................................................................................................................................41 C.9 Text Picker ...............................................................................................................................................................................................42 C.10 Checkbox...............................................................................................................................................................................................43 C.11 Multiple Checkbox ............................................................................................................................................................................44 C.12 Image ......................................................................................................................................................................................................45 C.13 HTML Editor .........................................................................................................................................................................................46 C.14 SoftOne Spreadsheet .......................................................................................................................................................................47 C.15 Datetime ................................................................................................................................................................................................48 D. Dialog Controls .................................................................................................................................. 50 D.1 File Picker ................................................................................................................................................................................................50 D.2 Color Picker ............................................................................................................................................................................................51 D.3 Printers Picker........................................................................................................................................................................................52 D.4 Time Scheduler .....................................................................................................................................................................................53 E. Command Controls ............................................................................................................................ 54 E.1 Buttons ......................................................................................................................................................................................................54 E.2 Hyperlinks ................................................................................................................................................................................................56 F. Editor Commands ............................................................................................................................... 57 G. Editor Attributes ................................................................................................................................ 58 CHAPTER 2 Browsers ................................................................................................................... 59 Overview ................................................................................................................................................. 60 A. Toolbar Buttons ................................................................................................................................. 61 B. Columns & Attributes........................................................................................................................ 62 B.1 Field Settings ..........................................................................................................................................................................................63 B.2 General Settings ....................................................................................................................................................................................64 C. Filters ................................................................................................................................................... 65 2|Page Contents D. Grouping ............................................................................................................................................ 65 E. Sorting ................................................................................................................................................. 66 F. Parent / Child Browsers ..................................................................................................................... 67 G. User-defined Tables .......................................................................................................................... 69 CHAPTER 3 Printout Forms ......................................................................................................... 72 A. General Printing Features ................................................................................................................. 73 A.1 Printer Settings......................................................................................................................................................................................73 A.2 Available Printing Methods ..............................................................................................................................................................74 A.3 Printout Form Types............................................................................................................................................................................74 A.4 Import / Export Printout Forms ......................................................................................................................................................75 B. Internal Printout Forms ..................................................................................................................... 76 B.1 Sections ....................................................................................................................................................................................................76 B.2 Toolbar......................................................................................................................................................................................................77 B.3 General Form Operations ..................................................................................................................................................................78 B.4 Page Size ..................................................................................................................................................................................................79 B.5 Draft Printout Fonts .............................................................................................................................................................................80 B.6 Image Printout Fonts ..........................................................................................................................................................................80 B.7 Recurrent Zone ......................................................................................................................................................................................81 B.8 Band Image .............................................................................................................................................................................................81 C. Ms-Word Printout Forms .................................................................................................................. 82 C.1 Add Form .................................................................................................................................................................................................82 C.2 Form Design ...........................................................................................................................................................................................82 C.3 Filters – Sorting – Grouping .............................................................................................................................................................83 C.4 Field decimals ........................................................................................................................................................................................83 C.5 Report Footer .........................................................................................................................................................................................84 C.6 Item Image ..............................................................................................................................................................................................85 C.7 Text wrap .................................................................................................................................................................................................86 D. Ms-Excel Printout Forms................................................................................................................... 87 D.1 Insert Form .............................................................................................................................................................................................87 D.2 Form Design ...........................................................................................................................................................................................87 E. Label Printout Forms.......................................................................................................................... 88 F. Crystal Reports Printout Forms......................................................................................................... 89 F.1 Basics .........................................................................................................................................................................................................89 F.2 Crystal Report Design .........................................................................................................................................................................90 F.3 Reports using tables ............................................................................................................................................................................91 F.4 Create Reports using commands ...................................................................................................................................................93 F.5 Import Crystal Report into SoftOne ..............................................................................................................................................94 G. Automations....................................................................................................................................... 95 G.1 Auto Email...............................................................................................................................................................................................95 G.2 Auto Save to file ...................................................................................................................................................................................96 CHAPTER 4 Event Driven Actions (EDA - Alerts) ...................................................................... 97 Overview ................................................................................................................................................. 98 A. Events & Conditions .......................................................................................................................... 98 A.1 Field Rule (On Change) ......................................................................................................................................................................98 A.2 Table Rule................................................................................................................................................................................................99 A.3 Module Rule ........................................................................................................................................................................................ 100 A.4 Index – Search Conditions ............................................................................................................................................................. 102 B. Actions .............................................................................................................................................. 103 B.1 Send Message ..................................................................................................................................................................................... 103 3|Page Contents B.2 Display Message (Notification) .................................................................................................................................................... 104 B.3 Error Display (Exception) ................................................................................................................................................................ 104 B.4 Run .......................................................................................................................................................................................................... 104 B.5 Update ................................................................................................................................................................................................... 104 B.6 Reminder .............................................................................................................................................................................................. 104 C. Examples ........................................................................................................................................... 105 C.1 Field Rule – Message display ........................................................................................................................................................ 105 C.2 Table Rule – Error message display ........................................................................................................................................... 105 C.3 Object Rule – Message send ........................................................................................................................................................ 106 C.4 Index – search condition ................................................................................................................................................................ 106 CHAPTER 5 Defined Fields ........................................................................................................ 107 A. Basics................................................................................................................................................. 108 B. Operation Options ........................................................................................................................... 109 B.1 Line Balance / Calculation .............................................................................................................................................................. 109 B.2 Calculation of line+totals ............................................................................................................................................................... 116 B.3 SQL command .................................................................................................................................................................................... 116 B.4 Question ................................................................................................................................................................................................ 117 B.5 SQL Filter ............................................................................................................................................................................................... 119 B.6 Single filter / Multiple filter ........................................................................................................................................................... 119 B.7 Function ................................................................................................................................................................................................ 119 CHAPTER 6 Database Designer ................................................................................................ 120 A. Basics................................................................................................................................................. 121 B. Fields ................................................................................................................................................. 124 B.1 Field Data Types ................................................................................................................................................................................. 125 B.2 Field Properties .................................................................................................................................................................................. 125 B.3 Editor Fields ......................................................................................................................................................................................... 126 C. Tables ................................................................................................................................................ 127 C.1 Table properties ................................................................................................................................................................................. 127 C.2 Tables in memory .............................................................................................................................................................................. 131 C.3 Child Tables ......................................................................................................................................................................................... 135 D. String Lists ........................................................................................................................................ 138 E. Database Views................................................................................................................................. 139 E.1 Create Database View ...................................................................................................................................................................... 139 E.2 Database view redirection .............................................................................................................................................................. 139 E.3 Database View Examples ................................................................................................................................................................ 140 F. Objects ............................................................................................................................................... 144 F.1 Create Objects ..................................................................................................................................................................................... 144 F2. Object Properties ............................................................................................................................................................................... 145 F.3 Table Properties ................................................................................................................................................................................. 147 F.4 Field Properties ................................................................................................................................................................................... 150 F.5 Calculated Fields ................................................................................................................................................................................ 151 F.6 Linked Tables ....................................................................................................................................................................................... 152 F.7 Browsers Design ................................................................................................................................................................................. 153 F.8 Forms Design ....................................................................................................................................................................................... 154 F.9 Display Object in Menu ................................................................................................................................................................... 156 F.10 Printout Forms .................................................................................................................................................................................. 157 F.11 Object Examples .............................................................................................................................................................................. 158 G. Virtual Tables ................................................................................................................................... 162 G.1 Design Virtual Table ......................................................................................................................................................................... 162 G.2 Virtual Table Example ...................................................................................................................................................................... 162 4|Page Contents H. Report Objects ................................................................................................................................. 164 H.1 Design Report Object ...................................................................................................................................................................... 164 H.2 Report Object Example ................................................................................................................................................................... 167 CHAPTER 7 Advanced Tools...................................................................................................... 169 A. Auto Login from Windows Shortcut.............................................................................................. 170 A.1 Create a Windows Shortcut .......................................................................................................................................................... 170 A.2 Configuration of XCO connection file ....................................................................................................................................... 170 A.3 XCO file Commands ......................................................................................................................................................................... 171 A.4 EXEC Commands ............................................................................................................................................................................... 171 B. Maximum Entries per Module (Select Top) .................................................................................. 172 B.1 How to use ........................................................................................................................................................................................... 172 B.2 User define top entries .................................................................................................................................................................... 173 C. Design Menu – Menu Jobs .............................................................................................................. 174 C.1 Create Job ............................................................................................................................................................................................ 174 C.2 Job Types .............................................................................................................................................................................................. 175 C.3 Menu job parameters – Menu Commands ............................................................................................................................. 176 C.4 Examples of Menu Jobs .................................................................................................................................................................. 177 CHAPTER 8 Schedule Tasks ....................................................................................................... 178 A. Remote Server.................................................................................................................................. 179 A.1 Activation ............................................................................................................................................................................................. 180 A.2 Remote Server Commands ........................................................................................................................................................... 181 A.3 Send SMS - Email .............................................................................................................................................................................. 182 B. Windows Scheduler ......................................................................................................................... 184 B.1 SoftOne Scheduler Commands.................................................................................................................................................... 184 B.2 Windows Scheduler Task ................................................................................................................................................................ 185 B.3 XCO Connection File ........................................................................................................................................................................ 188 C. SoftOne Scheduler ........................................................................................................................... 189 C.1 Create Task .......................................................................................................................................................................................... 190 C.2 Scheduler Commands ..................................................................................................................................................................... 192 D. Messages – Reminder ...................................................................................................................... 193 CHAPTER 9 Form Scripts ........................................................................................................... 194 A. Object Methods ............................................................................................................................... 195 BATCHEXECUTE ......................................................................................................................................................................................... 195 BEEP ................................................................................................................................................................................................................ 195 CANCELEDITS ............................................................................................................................................................................................. 195 CLOSEAPPLICATION ................................................................................................................................................................................ 195 CLOSEFORM................................................................................................................................................................................................ 195 CLOSESUBFORM (SubFormName: string) ....................................................................................................................................... 195 DBDELETE ..................................................................................................................................................................................................... 196 DBLOCATE (KeyData: variant) .............................................................................................................................................................. 196 DBINSERT ..................................................................................................................................................................................................... 196 DBPOST ......................................................................................................................................................................................................... 197 EXCEPTION (Message: string) .............................................................................................................................................................. 197 FIELDCOLOR (FieldName: string; UserColor: integer) ................................................................................................................ 197 FOCUSFIELD (FieldName: string) ........................................................................................................................................................ 198 FREE ................................................................................................................................................................................................................ 198 INVALIDATEFIELD (FieldName: string).............................................................................................................................................. 198 INCLUDE (filename: string) .................................................................................................................................................................... 198 OPENSUBFORM (SubFormName: string) ........................................................................................................................................ 198 5|Page Contents QUICKVIEW (ObjectName: string, ListName: string, Keydata: string) .................................................................................. 199 PRINTFORM (FormCode: integer; PrinterName: string; FileName: string) ......................................................................... 199 REFRESH ....................................................................................................................................................................................................... 199 RUNSQL (ASQL: string; AParams: Variant) ...................................................................................................................................... 199 SETDECIMALS (FieldName: string; Decimals: integer) ................................................................................................................ 199 SETDOCPRINT (PrintNum, Mode, TemplD: integer; PrinterName, Caption: string) ....................................................... 200 SETFIELDVALUE (FieldName: string; Value: Variant) ................................................................................................................... 200 SETPROPERTY ('MERCHANGELOG'; 'True or False') .................................................................................................................... 200 SETPROPERTY ('FIELD', FieldName', 'CAPTION', 'NewCaption') ............................................................................................. 200 SETPROPERTY ('FIELD or PANEL', Name', 'VISIBLE', 'True or False')...................................................................................... 200 SETFIELDEDITOR (FieldName: string; Editor: String) ................................................................................................................... 201 TOFILE (FileName, AMessage: string) ............................................................................................................................................... 201 WARNING (Message: string) ................................................................................................................................................................ 201 B. Object Functions .............................................................................................................................. 202 ASK (ACaption, AMessage: string): integer..................................................................................................................................... 202 CASE (IfCase, ThenCase, ElseCase: variant): Variant; ................................................................................................................... 202 CHECKMODULE(ModuleNum): Boolean ......................................................................................................................................... 202 CONNECTIONSTATUS: string; .............................................................................................................................................................. 202 CREATEOBJ (ObjectName: string): OBJECT (IDispatch) .............................................................................................................. 203 CREATEOBJFORM (ObjectName: string): OBJECT (IDispatch) ................................................................................................. 203 DOUBLE (StrNum: string): real ............................................................................................................................................................. 204 DIR (Name: string): string ...................................................................................................................................................................... 204 EVAL (Formula: string): Variant ............................................................................................................................................................ 204 EXEC (Command: string): variant ........................................................................................................................................................ 204 FINDTABLE (TableName: string): variant ......................................................................................................................................... 205 FILTERSUM (FieldName, Filter: string): real ..................................................................................................................................... 205 FORM: string ............................................................................................................................................................................................... 205 FORMATFLOAT (Value: float; format: string): string.................................................................................................................... 205 FORMATDATE (Date: TDateTime; format: string): string ........................................................................................................... 206 FROMFILE (FileName: string): string .................................................................................................................................................. 206 GETYEARPERIOD (ADate: TDateTime): Variant .............................................................................................................................. 206 GETLASTERROR: string ............................................................................................................................................................................ 206 GETSQLDATASET (ASQL: string; AParams: Variant): TDataset ................................................................................................ 206 ID (TableName: string; code: string): integer ................................................................................................................................. 207 INPUTBOX (Prompt: string; DefaultValue: string): string .......................................................................................................... 207 INPUTQUERY (ACaption: string, APrompt: string, Value:Variant, vPassword:integer) : Variant................................. 207 ISVALIDCONTRACT: boolean ............................................................................................................................................................... 207 LIST: string ................................................................................................................................................................................................... 207 LOCALE: integer ......................................................................................................................................................................................... 207 LOCALESTRING (value: string): string ............................................................................................................................................... 207 LOGINDATE: TDateTime ......................................................................................................................................................................... 207 NEWID: integer .......................................................................................................................................................................................... 208 PASSWORDVALIDATE(stringtoValidate: string, Password: string): boolean ..................................................................... 208 PLAY (SoundFileName: string): boolean .......................................................................................................................................... 208 SHOWOBJFORM: integer ....................................................................................................................................................................... 208 SPELL (Num: Real): string ....................................................................................................................................................................... 208 SQL (ASQL: string; AParams: Variant): string .................................................................................................................................. 209 SUM (FieldName: string): real .............................................................................................................................................................. 209 TIME: string.................................................................................................................................................................................................. 209 USERVALIDATE(UserName: string, Password: string): boolean .............................................................................................. 209 C. Dataset Methods .............................................................................................................................. 210 APPEND ........................................................................................................................................................................................................ 210 DELETE ........................................................................................................................................................................................................... 210 DISABLECONTROLS ................................................................................................................................................................................. 210 ENABLECONTROLS .................................................................................................................................................................................. 211 6|Page ................................................................ 218 ON_<DatasetName>_AFTERPOST ................................................................................................................................................................................................ 215 ISNULL (FieldName: string): boolean .................................................................... 219 ON_DESTROY ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 219 ON_LOCATE ............................................................................................................ 218 ON_<DatasetName>_AFTERDELETE ................................................................................................ 213 D.......................................................................................................................................................................................................... 214 FIELDCOUNT: integer ......... Object Events ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... Field Events ................................................................................................................................... 212 NEXT.............................................................................................................................................................................................................................................................................................. 219 ON_POST ..................................................................................................................................................................................................................................................................... 216 GETXML (writemetadata: Boolean): string .................................................................................................................. 219 ON_DOCPRINT ....................................................................................................................... ResultFields: string): Variant.................................................................. 213 SETREADONLY (FieldName: string............................................................................................... 217 STATE: integer ....................... 217 RECNO: integer ....................................................................................................................................................................................... 219 ON_AFTERPOST ................................................................................................................................................................. 218 G................... 219 ON_CANCEL ................................................................................................................................................... 214 FILTER: string ........................... 218 ON_<DatasetName>_BEFOREDELETE ................................................................................................................................................................................................... 219 ON_DELETE ....................................................................................................................................... 216 LOCATE (FieldNames: string................................................................................. 219 EXECCOMMAND(cmd) (cmd=-2) ............................................................................... 217 LOOKUP (KeyFields: string............ 211 INSERT ................... KeyValues: Variant.................................................................................................................................................................................................. 218 ON_<ObjectName>_<FieldName>..................................................................................................................................... 217 E............................. 213 PRIOR ... 219 ON_CREATE ........................................................................................................................ 214 FIELDS (index: integer): variant ...... DatasetHandle......................................................................................................................... Value: True/False).......................................................................................................................................................... ValueFieldName: string): string ..............................................................................................................................................................................................................................................................................................................................................Contents EDIT ................................................................... 215 GETGRAPH (LabelFieldName: string... 211 FIRST ...................................................... 219 EXECCOMMAND(cmd) (cmd=-1) ........................................................................................ 219 EXECCOMMAND (cmd) ............................. 219 ON_INSERT ................................................................................................................................................................... 219 ON_RESTOREEVENTS ............ 215 FILTERED: boolean ................................................................................................................................. ......................................................................................................................................................................................................................................................................... 219 ON_AFTERDELETE ..... 212 LAST.................. Sub Form Events ................................................................................................................................... 220 7|Page ................. 217 RECORDCOUNT: integer ............................................................................................................................................................................................................................................... 212 POST ..... 218 ON_<ObjectName>_<FieldName>_VALIDATE ....................... 214 EOF: boolean........................................................... 214 FIELDNAME (index: integer): string ....................................................................................... Dataset Functions ................... 220 H....................................................................................................................................................................................................................... 214 ACTIVE: boolean ................................................................................................................................................................................................................................................................................................................................................................................................................................... 215 GETHTML (FieldNames: string): string .................................................................................................................... FieldValues: variant): boolean ................................................................................................................................ Value) ...................................................................................................................................................... 218 ON_<DatasetName>_NEW ................................................................................................. 219 ON_OPENREPORT .... Dataset Events .............................................................................................................................................. 213 SETDATASETLINKS(ModuleHandle........................................................................................................................................................ 218 F................................................................................................................................................. 218 ON_<DatasetName>_POST ................................................................................................. 214 FIELDBYNAME (FieldName: string): variant ............................................................................................................................ 219 ON_EDIT ........................................................................................................................................................................................................................................................................................................................................................................................................... ........................................................................................................................................................ 245 Case Study 3 .............................................................. 259 C..................................................................................... Main Code ........ 241 C.................................................................................................................................................. 222 Case Study 1 ............................. 232 CHAPTER 10 Data Flows ...........1 Section TABLES.....................................................................1 Source entity ..............................................................................................................................................................................7 Error Messages .......... 253 B............................................................................................................ 244 Case Study 2 .... 221 ON_BANDTRANSFER (BandName) ................................................................................................................................. Data Flow Scenarios .................................................................................................................................... 242 D.................... 226 Case Study 5 .......................................2 Section CACHETABLES ...................................................................................................................................................... 221 ON_BANDEND (BandName) ............................................... 253 B.............................................................................................................................................5 Section FIELDEXEC ........................................................................................................................... 255 C...........................................1 Case Insensitive .........................................................................................................................................2 Target entity ......................... 253 B.................................................8 Comparison symbols............................................................................... 221 ON_BANDSTART (BandName) ............................................................................................................................................................................... 260 C.. 247 Case Study 4 .................................... 228 Case Study 6 .......................3 Section PANELS ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 255 B.............................................................................. 224 Case Study 3 ............................. 243 E. 236 A.................................................................................................................................. 225 Case Study 4 ........................................................................................................5 Libraries References................................................................................................................................................................................................................................................................................. 244 Case Study 1 .................................................................................................... Dialog screen design (Interface) ...................... 252 B............. 220 I...................................................................................................................................................................................................................................................................................................... 238 B..................................................................................................................................... 266 8|Page ........................................................................................................................... Case Studies .................................................Contents ON_<Subform name>_SHOW ............ 253 B............................................................................................ Overview ................................................... 220 ON_<Subform name>_ACCEPT ................................................................................. 251 A.......................................................... Line Printing Events .....................................................................................6 Functions..................... 238 B....................................................................................................... 253 B............ 221 J......................................................................................................................................................... 230 Case Study 7 ..................................................................................................... 255 B.....................................................................................................................................................................................................................................................2 Semicolons ..........................................................................................................................3 Runtime Settings ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ Syntax Basics ...............................3 Comments ............................................ 262 C................................................................................................................................................................................................................................................... 253 B................................................................................................................................................... 220 ON_<Subform name>_CANCEL....... 237 B................................................. Overview .........................................................................4 Section STRINGS ...................................... 221 ON_BANDLINE (BandName)....................................................................... Case Studies ............................9 Logical operators ........................................................................................................................ 256 C................................................................................................................................................................................................................................................................................. 249 Case Study 5 ........................................................................................................................................... Execute Data Flows from Screen Scripts .................. 250 CHAPTER 11 SoftOne Batch Script Language (SBSL) . 256 C........................................................................................ 263 D............................................................................................................................................................ 222 Case Study 2 .................................................................................................................................................... 239 B...................................................................... Data Flow Rules .................................................................................................................................................................................................4 Variables ............................................ 253 B...................................................... .......................................... 278 QuotedStr (text:string).......... 279 Resultnum.... ms:integer): TDateTime.................. 266 D................................................ 276 Delay(Time:Integer)...................................................... 277 GetTimeMin(DateTime:TDateTime): integer..................................................................................................................... 275 CallPublished(FunctionName:string...................................... ....................... ... 279 SendResponse(Values............. ............................................................. ....... text:string.............................................................................................. . 270 E.................................................................................................... ............. Params:VarArray)....... 269 E..............................................5 Use Libraries ................................................ 279 RollBack(Connectionstring:string).................................................................................................................................................... 276 EncodeTime(Hours:integer.........2 Functions ................................. Params:VarArray)................. 278 ModuleCommand (Module........................................................................................................................................................................................................................... ......................... 276 GetIndexVar (Array:VarArray...3 Form Screen Execution ............................................................................................................................................................................................................ ............................................................................................................................................... 269 D............... 275 DateOfDateTime(DateTime:TDateTime).................... 279 SafeCallPublished(FunctionName:string............................................................................................. 278 Pos(Source:string................................................................... 280 Space (num:integer)....... ............................................................................. 275 DayOfDate(DateTime:TDateTime): integer.......... Query:string............................ ................................................................................................................................................ ............................ .................................. ..................................................................... 276 DayOfWeek(): integer........ ................4 Run Parameters ................... 275 AddMessage(). Query:string..................................................... 278 RaiseException(Message:string).............................. ........................................... SBSL Built-in Functions ............ ................................ ....................... ..................................................................... 278 MonthOfDate(DateTime:TDateTime): integer.............................................................................................................................................. ........................................... 280 9|Page .............................. Param3(0=and..................................................................................................1 Menu Execution ...... ...... Params:String).......................... ....................................................................... ........ 279 ReplaceStr (text:string........... index:integer)................................................ ................................................................................ ......................................1 Converters........ ............................................................................................................................. 275 Abs(Number: numeric): numeric........................................................ 276 DaysinMonth(DateTime:TDateTime): integer................................... 270 E.......1=where))............................................................................................ 278 OEMToChar (oem:var)........................................................................... 277 GetTimeHour(DateTime:TDateTime): integer... ........................... ................................. ............ .................................................................. 277 GetQueryDataset(Datasetname:string..................................................................................................................................................................... Soft1Command.................................................... sec:integer................ 279 SafeExecSQL(Connection:string................. 276 Fetch SQLCursorName..................................................... 275 CharToOem (var:string)................... Query:string.......... ................................ Count:integer)................................. 278 Now():TDateTime..............Contents D.......................................... Query:string........................... Params:VarArray)..... Fields:string)............................................... 277 GetTimems(DateTime:TDateTime): integer................................................................ ParamWhere:string.................................................................................................................. 275 Copy(Source:string................................................................................................................. 279 RefreshMemoryTable(MemoryTable:string).................................................................................................................................... 280 StartTrans(Connectionstring:string)........................................................................................................................................................ ................................ 268 D........................................................... ...................................................................... ................................................................................................................................................................ ............................................................................ 275 Commit(Connectionstring:string).. String1:string........................................................................................................................................ Params:VarArray).......................................................................................................................................................... Params:VarArray).... 277 GetWhere(XModule.......................................................................... 278 ImportModule(Module:string). 276 ExecSQL(Connection:string...................................................................................... 266 D........ 278 GrConvert(text:string): string................................... Params:string)................................ . SBSL Script Execution ............. Connection:string.................................... 271 E.......... 276 DeQuotedStr (text:string)................................................ .................................................................................................................................................................. ............................................................................................................. ......................................................................................................... Minutes:integer....................................................................................................................................................................................................................... 273 E............................................................................... Params:VarArray).......................................3 Connection Types ............... 277 GetTimeSec(DateTime:TDateTime): integer... 276 FormatSQLText(Connection:string.............................................................................................................................. text:string): integer............................................................................................. Start:integer..............................................................................................................................................................................................4 Variables ........................ 278 Len(text:string): integer...................................................................................................... String2:string)................................................................................................................................. ....................................................................................................................................................................................................................................................... 277 GetQueryResults(Connection:string.............................................................................................. 274 F.......................... ................................... 276 ExecPrg(File:string.................................2 Browser Execution ...................................................... ......................................................................................................................................................... Params:VarArray)........................................................................................................................................ ......................................................................................................... 281 VarToStr(Param:Variant).................................................................................................................................................. ....................... Dim:integer)....................................................................................................................................................... Built-in Editors ................................................................................................................................................................................................................................................. 309 E..................................... Varn..................................Contents StrToDate(text:string):TDateTime.................. ........................................................................ 281 XSupport()...................... SoftOne Libraries ............... Editor Commands ...................................................................................................................................................................................................... 298 Case Study 2 ...................................................................... System Parameters (X......................................................................................................................................................................................................... Case Studies ................... .................................................................................... 302 APPENDIX Common Parameters & Commands ............................... ....................................................................................1 ModuleIntf ...................................... 280 Trim(text:string): string............................................................................... 281 XModule()............................................................................................................................................................................................... 280 Time():TDateTime................................................ 312 G......... 306 C......................................... .................................................................................................. Softone Object Types (SodType) .............................................................................................................................. Transactions Source Types (Origin) ..... 314 H..............................................SYS) ................................................... 307 D.........................TableName:string).................................... ….............................. 280 VarArrayDimCount (Array:VarArray)................ 298 Case Study 1 ............................................................................................................................................................................. .................................... 318 10 | P a g e ............................... 291 G....................................................................... 282 G............................................................................................................................................................................................................. .......................................... 280 StrToInt (var:string).............................................................................. 280 StrToFloat (var:string)...................... ....... 280 VarArray(Var1...................................................................................................................... 311 F.................................................................................................. 281 YearOfDate(DateTime:TDateTime): integer.................................................................. 280 TableExists(Connection:string......................................................2 PiLib .......................................................................................................... Var2.......... ...... 299 Case Study 3 .......................................................................... 304 A.......................................................................................................................... 295 H........................................................................ ..... 315 I............................................................... 305 B......................................... 281 VarArrayHighBound(Array:VarArray............................... ............. Menu Jobs / System Tools (acCommands) . ....................................................................................................................................................................................................... Related Jobs / Commands ............................................................................................................. Softone Transaction Objects (SoSource) ......................................................................3 SysRequest .............. n)...... Browser Job Commands ........................ 281 G............................................................................................................ 282 G...................................................................... Form Design B.Chapter 1 – Screen Forms CHAPTER 1 Screen Forms A. Dialog Controls E. Editor Attributes 11 | P a g e . Command Controls F. Editor Commands G. Layout Controls C. Data Controls D. such as Tables. and are potentially accessible to any time. String Lists. data are processed by using any of the available SoftOne controls. Instead you can create as many custom forms as you like to develop your solution. All the internal controls that can be used inside SoftOne Forms are discussed in the following sections. that SoftOne default object forms cannot be updated.Chapter 1 – Screen Forms Overview Forms are visual surfaces that contain controls on which you display information to users.NET or Delphi. Additionally. Modify and Delete). Your forms can respond to these events using script code (Form Script) and process the events when they occur. etc. Forms are saved as records inside the database in a blob field. Import and export of forms can be done from the “Custom Administration” tool. SoftOne provides a fully functional API which allows you to create DLL applications in . For more information. see Chapter Form Scripts. 12 | P a g e . They offer a graphical environment to display and process data from databases (View. that can be displayed or interact with SoftOne object forms. Most of the actions users do inside form controls generate events. You can alter the default object forms and create new forms to meet your needs. Database Views. SoftOne application provides many controls with a rich feature set. Insert. Inside forms. Virtual Tables. Please note though. Figure A1 This displays window is a WYSIWYG tool that allows you to alter the user interface to meet your needs. The only difference is that it also contains a toolbar with the available tools for designing the form (Figure A3).Chapter 1 – Screen Forms A. Form Design Forms design is accessed through the “Design” button of the window displayed when clicking on the arrow button next to “Form” (Figure A1). Saving the form can be done through the buttons “Save” or “Save as” (Figure A2). Figure A3 13 | P a g e . Figure A2 Notice that the design screen looks very familiar because it displays exactly the runtime screen form. and this design can be exported in a cst file through the “Custom Administration” tool. Figure A5 14 | P a g e . Figure A4 You can also display the object parameters and controls as code through the keyboard shortcut keys: CTRL + ALT + SHIFT + F11 (Figure A5).Chapter 1 – Screen Forms The internal design code of the form can be displayed through the keyboard shortcut keys: CTRL + ALT + SHIFT + F12 (Figure A4). memo textboxes and images) (Figure A1. Creates a new panel under the selected panel. Opens the datagrid properties window 15 | P a g e .1). Creates a new image textbox under the selected datagrid.Chapter 1 – Screen Forms A. Figure A1. Creates a new datagrid under the selected panel. New picture Create a new image in the selected tab. datagrids. Deletes the selected datagrid. Creates a new image textbox under the selected panel. Creates a new tab under the selected panel. Not applicable New datagrid Create a new datagrid in the selected tab. Creates a new tab under the selected datagrid. Creates a new memo textbox under the selected datagrid. which provides the available options that can be used to create controls (panels.1 Design Options The basic design options are displayed through the right click pop up menu. Not applicable New memo textbox Create a new memo textbox in the selected tab. Deletes the selected panel. Delete Deletes the selected tab. Creates a new memo textbox under the selected panel. Properties Not applicable Opens the panel properties window.1 Form Design Options Option Applies to Selected tab Selected panel Selected datagrid New tab Creates a new tab on the left of the selected tab. The controls that can be added to a form are discussed in detail below. tabs. New panel Create a new panel in the selected tab. views. Figure A2 A.2. This command is automatically inserted when you enable the custom field property “Exclude from Copy Buffer”. but works for custom fields. Figure A2.2 Toolbar Overview The toolbar on the top of the form window provides you the commands for designing a form (Figure A2).2. Figure A2.2 shows an example of the parameter command BUFEXCLUDE. These commands are the same as the object properties and are explained fully in the section Object Properties. 16 | P a g e . captions and the way the form will interact with users. In the example the field “NAME” from the table “PRSN” is excluded when users click on the toolbar button “Copy from last”.3 displays another example.1 Tab General parameters The first tab “General parameters” allows you to add parameter commands.2 Figure A2. A.1). The same tool allows you also to change default values. The second command EDITOPTIONS=NOINSERT.2 Configuration The toolbar button “Configuration” displays a window through which you can change the database objects (tables. which is used to exclude data from copy. using the command CUSTOMBUFEXCLUDE which is the same as BUFEXCLUDE.1 Fields The toolbar button “Fields” displays a window with all the available tables and fields that are defined in the object (Figure A2.Chapter 1 – Screen Forms A.NODELETE does not display the toolbar buttons “New” and “Delete” for the selected form. by entering your own code in JavaScript or VBscript. Figure A2. virtual tables) that will be displayed in the form. You can drag and drop fields and display them anywhere on the form. From this tab you can add and edit tables and also alter the field properties (Figure A2. Figure A2.4 17 | P a g e .4).3 Tab User defined tables The second tab “User defined tables” contains all the details of the current object tables and fields.Chapter 1 – Screen Forms Figure A2. 6 – Exclude from Copy Buffer 18 | P a g e . when a record is copied through the toolbar button “Copy from last” (Figure A2.Q. Users cannot change it at runtime.5 – Field Properties Figure A2.%. Required Decimals Exclude from Copy Buffer Specifies whether a value for the field is required for the record to be saved (e. ReadOnly Specifies whether the contents of the field can change at runtime by users.5) are summarized in the table below.g. If selected then the value of this field is not copied. Users can change it at runtime. Visible only in custom fields. Indicates the number of the decimal places. Visible Indicates whether the field is displayed or not. null values are not permitted). Default Value Sets a default value to the field that applies to new entries. Specific commands (P.V.6) Figure A2. PROPERTY DESCRIPTION Caption Sets the title of the field Forced Value Indicates the forced value applied to a field.Chapter 1 – Screen Forms Field properties (Figure A2.C) can be used in order to define the use of the company defaults for decimal places. Click on button “New table” and select from the available tables. Figure A2.7 Tables can be deleted using the button “Delete table”.7).8). click on the arrow button next to “New table” and insert the selected the table in the left panel of the form. Then. (Figure A2. dataset e. while tables linked to fields (through editor property) can be deleted using the right click option “Delete link…” (Figure A2.c.8 19 | P a g e .Chapter 1 – Screen Forms This tab also provides the option of inserting SoftOne designer objects. virtual tables and database views. such as tables. Figure A2.t. CHFIELD2=:PRFIELD1.9).:PRFIELD2.:PRFIELD2. Field data of other tables are defined using a colon : and the name of the field (:FIELD). For example. More than one field can be defined separated with semicolons.Chapter 1 – Screen Forms Table properties are displayed in the right panel of the “Configuration” window (Figure A2.9 “Locate statement” property is used to define the fields that will be used to locate the data of this table according to the parent table. You can also use specific values inside the locate statement: CHFIELD1.CHFIELD3.Value1.CHFIELD4=:PRFIELD1.10 20 | P a g e .Value2 Figure A2.CHFIELD2. Figure A2.10). then you have to enter ITEM=:MTRL (Figure A2. CHFIELD1. if the name of the parent table field is MTRL and the child field name is ITEM. given different alias table names (VQAFORM1 and VQAFORM2). Figure A2.11 Tab String lists This tab provides you the option of creating string lists that can be used in the form.Chapter 1 – Screen Forms “Alias table name” property is used to define the alias name of the table.12).12 21 | P a g e .11 shows that the table named VQAFORM1 is inserted twice inside an object. References to tables are made through their alias name. Figure A2. Figure A2. String Lists display a collection of keys and values and can be used as editors to numeric fields in a combo box control with fast lookups (Figure A2. This means that you can use the same table more than once inside the object as long as you have different alias names. 22 | P a g e .13).14 Tab Script This tab is used for adding extra code in JavaScript or VBscript that implements functionality in the form. Figure A2.Chapter 1 – Screen Forms Create a new string list from the right click option “New” on the left panel.13 Finally add the name of the string list to the editor property of a numeric field (Figure A2. $DesignerStringListName). functions and events that you can be used inside a form script are covered in Chapter Form Scripts. Figure A2.g. Note that string lists created through SoftOne Designer are referenced with a $ prefix (e. The available commands. Add the preferred values in the grid of the right panel (Figure A2.14). 2.t.16). by creating a parent panel and then creating the child (horizontal) panels inside it (See Nested Panels).15 Figure A2.15). Figure A2. e.16 Nested / horizontal panels (Figure A2. Simply drag a control (tab.3 Layout tree The toolbar button “Layout tree” displays the form controls structure in a tree view. The hierarchical arrangement of the controls in the form is done through this tool.17 23 | P a g e . This tool has all the controls that are used inside the form as well as the sub forms.c) from a lower node and drop it to the preferred higher node. This way your control is moved to a new position inside the form (Figure A2.17) are also created through this tool. It also provides the same tools as the designer window. Use the right click context menu to display all the available commands for designing the form through this tool (Figure A2.Chapter 1 – Screen Forms A. panel. Figure A2. which means that you can design the whole form through this tool. 2 Tab Order: The order of tabs in a form can be altered by using the “Layout tree” button (Figure B1.2). Figure B1. By using the Tab control. Inside the window that appears you can position the tabs by performing a drag and drop action.Chapter 1 – Screen Forms B. you can define multiple tabs in a SoftOne object form. moving them from lower nodes to higher ones.3 24 | P a g e . Layout Controls B.1 Tabs can be created in forms design mode with the option “New tab” of the right click pop up menu. Figure B1.1). Properties Title: Right click a tab and select Properties to change the title of the tab (Figure B1.3). Figure B1. The following image displays an example of tabs inside the Items object form (Figure B1.1 Tabs Tab control provides a way to present related information on separate labeled tabs (pages) within the form. Each page consists of a group of controls that an object view displays when the user selects the corresponding tab. combo boxes and checkboxes or for invoking commands within the application. Fields can be added into panels through drag and drop action either from the “Fields” window or through “Configuration” window. Figure B2. Caption Sets the text that appears as title of the panel. which are either designed for data entry such as textboxes.2 Panels Forms and tabs consist of panels that contain controls. PROPERY DESCRIPTION Name Sets the name of the panel control. Not all the controls use all the available properties (although some of them are displayed). Columns percentage Percentage of displayed columns. Properties Most of the controls share similar properties that enable you to alter their appearance and behavior.1 Design Panels are created by right clicking on a form or tab and selecting “New Panel”. All panels that have the same number align their controls in the same way. The figure B2. The table below lists panel properties which are the same for nested panels. It also sets the control tab order to vertical instead of horizontal Group Indicates a number that defines the selected panel. Vertical order Vertical order of the panel controls.Chapter 1 – Screen Forms B. Height Sets the percentage height of the panel. Null value auto increases the height in order to display all the panel controls. 25 | P a g e . Lines Sets the height of the panel in lines number. which is relevant to the width of the panel Floating Auto fits the panel to fill the available space of a form or tab. Works for panels inserted at the bottom of forms or tabs. according to its main layout control. No bottom line Hides bottom border line of panel.1 displays the Customers form in design mode. It is also used in nested panels and defines the number of horizontal panels contained in a master panel. buttons and links that will be displayed in the selected panel. Columns Sets the number of displayed columns (Max=4). Splits data controls into horizontal columns. Fields Fields. such as buttons and links. whose columns define the width of the sub panels (Figure B3. you have to create a main panel that will contain the sub panels.1).1 Design Nested panels are created as sub panels of a main panel. Figure B3. in a horizontal layout. which means that you can have two or more panels. Then. The width of the sub panels is defined as percentage per column in the master panel’s properties. Now. by right clicking and choosing “New Panel”.2 26 | P a g e .Chapter 1 – Screen Forms B.2). except for the “master” panel. Right click a tab and select “New Panel”. First. select the “master” panel and create new panels inside it. A typical example of nested panels is the items form (Figure B3.3 Nested Panels Object forms and tabs can display panels horizontally. containing up to four fields each. Properties The properties of nested panels are the same as Panel properties. you have to click the button “Layout tree” in form design mode and then create the main panel inside the window that appears. you will have one “master” panel with sub panels. In order to achieve that. Figure B3. 4 Sub Forms Sub forms are pop up forms that can be displayed inside the main object form. Figure B4. In the properties window of the newly created form enter its name. datagrids with financial data. select the “Layout tree” button and then right-click to create a new “Sub form”. Figure B4. through user’s interaction.1). which will be later used to retrieve the form (Figure B4.2).2 – Sub Form SFITELINES in sales documents 27 | P a g e . such as calculated values. Another example would be to use a sub form to display additional data associated with a record.1 – Sub Form in sales documents datagrid Design In design mode of an object form.Chapter 1 – Screen Forms B. etc. They have many uses. for example you can use a pop up form to display a more detailed view of a datagrid record that contains many fields (Figure B4. when user clicks on a button of a form or when a form event occurs. Figure B4.Chapter 1 – Screen Forms Any control can be used inside a sub form as long as it is created under the sub form’s node in the layout window. Sub forms can be displayed through button controls. This can be done by entering the command: XCMD:SubFormName in the editor property of a numeric field (Figure B4. etc. OK button Indicates that the OK button will be displayed on the bottom side of the sub form Cancel button Indicates that the Cancel button will be displayed on the bottom side of the sub form 28 | P a g e .4 – Sales documents datagrid properties Properties Sub form properties are listed in the table below. Width Sets the width of the sub form. This can be done by entering the name of the sub form in the “Popup form” property of the datagrid (see Datagrid Properties). Figure B4.3).3 Sub forms can also be displayed through double click on datagrid rows. If you use this command in a numeric field then that field will be displayed as link control. tabs. This name can be used to retrieve the sub form from datagrid records or from any form event. This means that when you right click a sub form (from the layout tree window) you can create panels. datagrids.4 displays the properties of Items datagrid in sales documents form. Height Sets the of the sub form. Figure B4. If you want to display the field as button control then you have to enter the number 1 in the decimals property of the field (see Buttons). Caption Sets the text that appears as title of the sub form. PROPERTY DESCRIPTION Name Sets the name of the pop up form. 5). Finally. which is inside the object “Sales documents”. demonstrates the design of a sub form that is displayed when users double click on a row of the Items datagrid. right click and select “New Form”. you have to add the name of your sub form inside the “pop up form” property of the Items datagrid. Fields can be added through the properties of controls.g. Add a name for your new sub form (e.6 29 | P a g e . tabs and any other control by right-clicking and selecting the appropriate control (Figure B4. Figure B4. MyPopUpform) in the Form Properties (Figure B4.Chapter 1 – Screen Forms Sub Form Examples Example 1 Display pop up form from Datagrid records This example. This way your sub form will be displayed when users double click on a record line of the Items datagrid.    Select a screen form from the object “Sales documents” and the click on the button “Design” Inside the window displayed through the button “Tree layout”.5   Create panels. Figure B4. datagrids.6). by entering a new field (right click) with the command RUNB_ButtonID=ButtonCaption (e. Figure B4.5 Alternatively you can simply use the name of the sub form as the id of the button.Chapter 1 – Screen Forms Example 2 Display pop up form from Button click Create a new button inside the “Fields” property of a panel.OPENSUBFORM('MYPOPUPFORM').5): function EXECCOMMAND(cmd) { if(cmd == 20140101) X. then in order to use this button to open a sub form you have to enter the following command in the editor property of the field XCMD:MYPOPUPFORM 30 | P a g e .6 If you select to use a numeric field as your button. Figure B4.6).5 In the tab “Script” of the configuration window add the following JavaScript code (Figure B4. } Figure B4.g. In this case you don’t need to write any code at all (Figure 4. RUNB_20140101=Open Pop up). C. view tables and database views that exist in object form’s user defined tables (found in the “Configuration” or “Fields” form design window). Figure C1. virtual tables. Design A String Textbox can be created by dragging and dropping string fields inside a panel in form design mode.1 – Add field in panel 31 | P a g e . These fields may belong to database tables.Chapter 1 – Screen Forms C. properties and editor commands of the fields added in a form. Data Controls Data entry controls are basically controls associated with fields. Another way is by dragging and dropping fields inside the box “Fields” of panel properties.1). different data controls are associated with the fields. Depending on the data types. either from the tab “User defined tables” under the window “Configuration” or from the window “Fields”. Moving fields between panels is permitted and can be performed from panels’ properties window (Figure C1.1 String Textbox String Textboxes display data from string (alphanumeric) fields and allow users to edit them as unformatted text. Fields can be added in a layout control of a form through drag and drop. For example the field “Name” of Items (table MTRL) is displayed in a textbox control for text input. Visible only for custom fields. Users cannot change it at runtime. Field properties are summarized below.2 – Field Properties Figure C1. Visible Indicates whether the field is displayed or not.2). Default Value Sets a default value to the field that applies to new entries.Chapter 1 – Screen Forms Properties Click on the button “Configuration” and move to the tab “User defined tables” in order to display and modify the properties of fields.3) Figure C1. Null values are not permitted. If selected then the value of this field is not copied. Specifies whether a value for the field is required for the record to be saved. which affects the way they are processed (Figure C1. ReadOnly Required Exclude from Copy Buffer Specifies whether the contents of the textbox can change by users at runtime. PROPERTY DESCRIPTION Caption Sets the title of the textbox Forced Value Indicates the forced value applied to the field. when a record is copied using the toolbar button “Copy from last” (Figure C1.3 – Exclude from Copy Buffer 32 | P a g e . Changing the value of the textbox by code is allowed. Users can change it in runtime. Chapter 1 – Screen Forms C.2 Numeric Textbox Numeric Textbox control is textbox that accepts only numeric input. Design This type of textbox is created the same way as string textboxes and its properties differ only when it comes to floats. This type of fields displays the number of decimals entered in the “Decimals” property inside the “Configuration” window of a screen form. Default decimal places SoftOne application gives you the ability to display decimals places in float fields corresponding to the ones you have picked to display inside the company’s properties (Figure C2.1). This means that if you enter the letter P (Figure C2.2) in the property “Decimals” of a float field, then the field will display with the same number of decimal places as configured for company prices (field PDECIMALS inside table COMPANY). Below there is a summary table of the available formats. COMMAND DESCRIPTION CORRESPONDING COMPANY FIELD P Prices COMPANY.PDECIMALS V Values COMPANY.VDECIMALS Q Quantities COMPANY.QDECIMALS % Percentages COMPANY.DDECIMALS C Cost Prices COMPANY.CDECIMALS Figure C2.1 33 | P a g e Chapter 1 – Screen Forms Figure C2.2 Calculation formulas At runtime, numbers can be inserted in numeric textboxes by using formulas. Formulas must always begin with the equal sign “=” (Figure C2.3). Figure C2.3 – Calculation formulas in numeric fields 34 | P a g e Chapter 1 – Screen Forms C.3 Memo Textbox Memo control is a multiline textbox that displays data from string fields. Examples of memo control fields are fields REMARKS which can be found in almost every object and table (TRDR, MTRL, FINDOC, etc.). Design In order to display a string field as memo you have to right click a view or page (in design mode) and choose to create a “New text”. Then simply drag and drop a string field inside the “Fields” box of the properties window. Properties The table below summarizes all the memo textbox properties PROPERTY DESCRIPTION Caption Adds a title in the top line (header) of the control Height Changes the height (lines or percentage). If not entered then it auto fits the size of the panel. Visibility of horizontal and vertical scrollbars can be achieved by entering the numbers 1, 2 or 3 inside the Decimals property of the selected string field. Scrollbars 1: Horizontal scrollbar visible 2: Vertical scrollbar visible (Figures C3.1 & C3.2) 3: Both scrollbars visible Figure C3.1 Figure C3.2 35 | P a g e Chapter 1 – Screen Forms C.4 Password Textbox This control is a masked textbox that displays data with asterisks. It applies to string fields. Design In form design mode, open the configuration window and select the field you want to display with asterisks. Then inside the Editor property, on the right hand side of the window, add the command $PASSWORD (Figure C.4.1). Finally, drag and drop the field in any place of your form. In runtime mode the field is displayed as in figure C.4.2. Figure C4.1 Figure C4.2 36 | P a g e Chapter 1 – Screen Forms C.5 Webpage / Email Textbox These controls are the same as string textboxes, but they also add a link to their captions, that auto opens the corresponding programs (the default Browser for Webpage and default email client for Email). Design In form design mode, open the configuration window and select the field you want to display as webpage or email. Then in Editor Property, on the right hand side of the window, add the command $WEBPAGE (Figure C5.1)for webpage or the command $EMAIL for email field (Figure C5.2). Finally, drag and drop the field in any place of your form. In runtime mode, fields are displayed as in figure C.5.3 Figure C5.1 Figure C5.2 Figure C5.3 37 | P a g e Chapter 1 – Screen Forms C.6 Datagrid Datagrid control is used for displaying child database tables, database views and virtual tables that have been created through SoftOne database designer. Figure C6.1 displays a datagrid inside Items object, which is populated from the table “MTRSUBTITUTE” (Alternative items). Figure C6.1 Design In object form design right click on a panel and select “New grid”. Fields can be added in the “Fields” property through drag and drop from the Fields or Configuration windows (Figure C6.2). Figure C6.2 38 | P a g e because the header column width does not auto fit (Figure C6. Fields that will be displayed in the selected datagrid. Figure C6.Chapter 1 – Screen Forms Properties The table below summarizes all the datagrid properties (Figure C6. then the header column width will be adjusted in order to be able to display up until entry 99. For example if you enter the number 2.4). Floating Fields Auto fits the grid to fill the available space of a panel or tab. Works for datagrids inserted at the bottom of forms or tabs.4 39 | P a g e . LN Digits Number of digits that will be displayed in the header column of the datagrid.3). but simply that the header column of records below 99 will not be displayed. PROPERTY DESCRIPTION Name Sets the name of the datagrid Caption Sets the title of the datagrid Lines Sets the number of lines that will be displayed.3 Figure C6. Height Sets the percentage height of the datagrid. This does not mean that it is not possible to insert 100 or more rows. Popup form Defines the name of the pop up form that will be displayed when user double clicks a datagrid row. 7 Selector List Selector list is like a combo box control that displays two text boxes horizontally with a magnify glass button. An example of a selector list control is the field TRDR in the table FINDOC.Chapter 1 – Screen Forms C. database views view tables or inherited tables. Fields are displayed in selector list controls when you enter the name of the linked table.2).1). When the magnify glass button is clicked then a drop down list is displayed that presents either the preselected columns defined in “Selector fields” property of database designer or user defined columns created in the linked object (Figure C7.1 It is usually used with integer fields in order to save the id of a record as a foreign key to another table. view table or inherited table inside their editor property. Figure C7. You can also use any of the available editor attributes in order to alter the format of the displayed data (See Editor attributes). The first textbox usually indicates the code of the selected record and the second one the description. which saves the id of Customers/Suppliers inside documents (Figure C7. which is designed in SoftOne database designer. The data fields that the two textboxes display are defined through the “Selector fields” property of the table. database view. This control is populated by records from tables.2 40 | P a g e . Figure C7. Figure C8. which saves the id of measurement unit in the item record (Figure C8. Designing a combo box is the same as for selector list. a drop down list appears presenting only the columns defined in the “Selector fields” property of the table. The main difference from the selector list control is that it refers to tables in cached memory. which means that you enter the name of the table inside the editor property of a field (Figure C8.Chapter 1 – Screen Forms C. When clicked.1). The drop down list box portion of the control is displayed when the user clicks the drop down arrow.1 Figure C8.2). Example of an in memory combo box is the field MTRUNIT1 inside the table MTRL.2 41 | P a g e .8 Combo Box A combo box control displays two text boxes horizontally with a drop down arrow selector. This control is usually used in small integer fields in order to save the id of a record and link to a foreign table in memory. Simply enter the name of a table in the editor property. using also the editor attributes M.2). which will not affect the data of the drop down list.R[StringFieldColumn].1 Figure C9.1).9 Text Picker Text Picker Control displays one text box with a magnify glass selector. It is usually used when you want to have a text list selector allowing also the users to enter free text. Example of text picker control is the field COMMENTS inside the table FINDOC (Figure C9. Users can alter the data inside the textbox. This control is created as combo boxes.2 42 | P a g e . Figure C9.Chapter 1 – Screen Forms C. When clicked it displays a one column drop down list of alphanumeric data and returns the selected record string. through the editor property of a field. that will return the defined column of the table (Figure C9. 3 43 | P a g e .1 In order to create a check box control you have to insert the command $Y inside the Editor property of the preferred field. while the unselected state returns 0 (Figure C10. This can be done in form design mode by selecting the button “Configuration” and choosing the field from the table tree of the tab “User defined tables” (Figure C10. The selected state of the control returns value 1. Figure C10.Chapter 1 – Screen Forms C. usually associated with a small integer field.2 The “Yes/No” values can be displayed in a datagrid field through a combo box. using the editor $YN.1).2).3 displays the design of field MTRSUBSTITUTE.ISACTIVE that is added in a datagrid of Items.10 Checkbox Checkbox is a two state (Yes / No) control. Figure C10. Figure C10. Figure C10. Returns the selected record codes in comma delimited string (Figure C11.Chapter 1 – Screen Forms C.2). Example of a multiple check box control is the field VISITEVERY inside the table TRDR. Figure C11. Figure C11. Value).2 44 | P a g e .11 Multiple Checkbox Multiple Check Box control displays one text box with a drop-down arrow selector. It is used in alphanumeric fields and presents the data of a table in a pop up box with two columns (Code. use the symbols #$ and the name of the string list (Figure C11. For string lists.1 This control is designed by entering the symbol # and the name of a table inside the editor property of a field. which presents a drop down list of the week days.1). 2 45 | P a g e . Field SODATA inside the table XTRDOCDATA is an example of image field. Figure C11. Figure C12.2).Chapter 1 – Screen Forms C.12 Image Image control displays an image inside a form with the use of image data fields only.1 displays the use of the field XTRDOCDATA in an image control inside the Items object form. Inside the properties window of the image. Figure C12. through the option “New picture” of the right click pop up menu. simply drag and drop the preferred binary field (Figure C12.1 Image control can be created in design mode of a form. 1 HTML editor is designed in form by creating a new special panel through the right click pop up menu.3 46 | P a g e .2 Figure C13. Example of this control can be found in field SOMAIL of the object Email (Figure C13. Figure C13.2). that you have created in the table “TableName” from SoftOne database designer (Figure C13. “BinaryFieldName” is the name of the image field.Chapter 1 – Screen Forms C.3). inside the properties of the special panel you have to enter the command HTMLEDITOR inside the “Popup form” property and also the expression USERPARAMS=TableName. Then.1).13 HTML Editor This control displays an editor for html code that is stored in an image field.BinaryFieldName in the “Editor Params” property (Figure C13. Figure C13. 14 SoftOne Spreadsheet SoftOne Spreadsheet is a spreadsheet displayed by combination of keys Alt + S on fields of the application.2 47 | P a g e .htm). Figure C14. However. The specific control allows you to use simple calculations within a spreadsheet environment and insert the final result (selected cell) within the field through which the tool was called (Figure C14. For example.Chapter 1 – Screen Forms C. By default the spreadsheets in all fields are empty. it is possible to create default spreadsheets which will be matched to specific fields of application modules. you must save the file in the application folder under the name ITEM_CODE1. Figure C14.htm.1 Figure C14.2 depicts the spreadsheet displayed with Alt + S in the BARCODE field of the items. All you need to do is save the desired spreadsheet file in the application folder with htm extension and provide as file name the name of the field (Object_Field.1). if you want to match a file in the Barcode field of the item. 15 Datetime This control is used for displaying datetime fields. The control is displayed as in figure C15. Fields can be displayed in four different ways. Date only The simplest type is Date only.1 Figure C15.4 48 | P a g e .3). which is the default control displayed when you drag and drop a datetime field (Figure C15.1) in a panel of a form(Figure C15.3 Figure C15.Chapter 1 – Screen Forms C. which is displayed when you add the command $DT in the editor property of a datetime field (Figure C15. Figure C15.2).4. Figure C15.2 Date and time The second type you can use is the date time control. 8). Figure C15.7). which is displayed when you add the command $TimeRange in the editor property of a datetime field (Figure C15.6). which is displayed when you add the command $Time in the editor property of a datetime field (Figure C15.6 Time Range The third type can use is the time range control (Figure C15. Figure C15.5 Figure C15.5).Chapter 1 – Screen Forms Time only The third type can use is the time only control (Figure C15.7 Figure C15.8 49 | P a g e . It returns the full path of the selected file (Figure D1.1).1 File Picker This control displays file picker dialog window. Figure D1.1 Figure D1.2 50 | P a g e .Chapter 1 – Screen Forms D. Dialog Controls D. Varchar fields are used to display this control in a form of an object. by adding the command $FILENAME in their editor property (Figure D1.2). Figure D2.2 Color Picker This control displays a color window and returns the selected values (Figure D2.1).2 51 | P a g e .1 Figure D2. by adding the command $COLOR in their editor property (Figure D2. Varchar fields are used to display this control in a form of an object.Chapter 1 – Screen Forms D.2). Varchar fields are used to display this control in a form of an object.1 Figure D3.2).1).3 Printers Picker This control displays a printer dialog window and returns the selected printer string (Figure D3. by adding the command $PRINTERS in their editor property (Figure D3.2 52 | P a g e . Figure D3.Chapter 1 – Screen Forms D. Varchar fields are used to display this control in a form of an object. Figure D4.2 53 | P a g e .4 Time Scheduler This control displays the SoftOne scheduler window and returns the selected values (Figure D4.1).Chapter 1 – Screen Forms D.1 Figure D4.3). by adding the command $RECURRENCE in their editor property (Figure D4. where cmd refers to the id of the button. VBscript or JavaScript function). Command Controls E. The “On Click” event is controlled by script code (JavaScript / VBscript) through the event EXECCOMMAND(cmd).TRDR. Commands can be found in Annex Relative Job Commands.FORM=Myform]')  Display a relative job of an object. Buttons can be inserted in a form using one of the following ways:  Using numeric field from a database table o Insert a numeric field in a panel o Add the command XCMD:xxx (xxx=id of the button defined by the user) in the Editor property of the field (Figure E1.1 Buttons Buttons can be created in any panel of a form and run when users click on them. Inside the editor property of the field enter the following command XCMD:ObjectName. Alternatively you can use form script code that handles the button click (function EXECCOMMAND(cmd) and uses the EXEC function to open the object.1 54 | P a g e .  Execute SBSL script. Inside the editor property of the field enter the following command XCMD:Mypopupform  Display / Open an object. defined from the field SALDOC.TRDR+'.  Execute custom form script code (e. The following command opens the customer object and locates to a specific record.EXEC('XCMD:CUSTOMER[AUTOLOCATE='+SALDOC. Buttons can be used to execute one of the following jobs:  Display / Open a sub form in an object. The field is displayed as hyperlink if you leave the Decimals property blank. o Add the number 1 inside the Decimals property of the field (Displays the button control).1).Chapter 1 – Screen Forms E. Figure E1.g. X. 2 Figure E2.4. where cmd is the button id.  Using the command RUNB_buttonID=buttonCaption inside the panel properties (Recommended) o Right click the “Fields” property of a panel o Select the option “Add field” from the pop up menu (Figure E2.  Figure E2.3 Figure E2.Chapter 1 – Screen Forms Using a numeric field from a virtual table o Insert a virtual table in the “User defined tables” tab of the configuration window.2) o Enter the command RUNB_ButtonID=ButtonCaption (Figure E2.4 55 | P a g e .3) o For hyperlink button add the command RUN_ButtonID=ButtonCaption Buttons are displayed as in Figure E2. The script event that is used for handling button click is EXECCOMMAND(cmd). pick the numeric field and follow the previous steps. Figure E2. In reality.).1).2 Hyperlinks All the fields that are linked to tables through the editor property add a link to their caption.Chapter 1 – Screen Forms E. etc. regardless of "where you are at the time" and "where the target-job is located".g.1 56 | P a g e . More specifically links can be created by:     Fields with lookup to in-memory tables that create combo boxes. Customer in document. that link through their editors to specific objects and tables (Figure E2. This link redirects to the corresponding table or object depending on the editor command. Items in document lines.g. Currencies etc.). Examples of fields with hyperlink captions are all the selector list and combo box controls. each job constitutes a job menu of its related jobs and all can be accessed in an easy way. Fields with lookup to tables that create selector list controls. which almost always lead directly to the administration of the in-memory tables (e. Geographic Zones. which redirect to the object defined in the editor property (e. Webpage and e-mail fields that lead to the corresponding application Command fields that react exactly as buttons The generalized use of hyperlinks renders secondary the importance of the job menus because the operator does not have to "remember" where each job is located. Link to Internet Browser Varchar $EMAIL Email Fields . Editor Commands The table below summarizes all the available editor commands and their use. Varchar 57 | P a g e ."/"+CUSEXTRA. EDITOR COMMANDS Command Operation .VARCHAR01.Use Data Type $DT Date & Time in different fields Datetime $TIME Only Time (Returns the current Date) Datetime $PASSWORD Password (Displays text with asterisks) Varchar $Y Boolean Field (Displays checkbox control) Small Integer $YN Boolean Field in datagrids (Displays “Yes/No” combobox control) Small Integer $WEBPAGE Web Page Fields .exe. Tables used are SOLIST and SOLISTLNS. Varchar $XRUN Runs external program $XRUN(D[0.Chapter 1 – Screen Forms F.Link to Email Program Varchar $PRINTERS Displays Printers Window Dialog Varchar $DATERANGE Date from to Datetime $TIMERANGE Time from to Datetime $COLOR Displays Softone Color Selection window Varchar $ONECOLOR Displays Windows Color Selection window = 256 ^ 2Red * 256 ^ 1Green * 256 ^ 0Blue Varchar $FILENAME Displays File Selection Window and returns its path Varchar $MASKEDIT Code Mask Creation Window Varchar $RECURRENCE Displays Softone Scheduler Window Varchar $MEMOEDIT Corrects word wrap in datagrid lines for memo textbox fields Varchar $LIST:OBJECT Lookup from preselection lists created from browsers.VARCHAR01]) The above example runs SoftOne application using the switch parameters added in field CUSEXTRA.C:\Xplorer. Views or Strings (e. EDITOR ATTRIBUTES Command Operation / Use Syntax Example SALDOC(W[A.2. Editor Attributes In the Editors. when user selects from the available items and clicks on the button “Input” then the data entered will update the QTY1 field.SODTYPE=1. $CCCMYSTR (W[1. C Filter records without the where clause of the Login Company.SYS. such as e. Lookup data from series table and update the FPRMS and BUSUNITS fields with the values of the fields FPRMS and BUSUNITS of the selected series.BUSUNITS@] U Update fields after selection. will always be updated.BUSUNITS.2. Use in Custom Design Printouts SALDOC(J[A. return of a different field.=FPRMS.Chapter 1 – Screen Forms G.g. The @ symbol at the end indicates that the fields on the left. If you do not enter the @ symbol. W[] Filter String Lists. Displays only the data the field CCCField has values 1. R Definition of the field to be returned.2. it is possible to enter commands that have various functions. ITEM). etc. Use in fields linked to string lists. H Redirection to an Object.COMPANY=:X. (Use the Editor of the above example in a varchar field) SERIES(U[FPRMS. Use in selector fields linked to tables.FINDOC]) I Defines the field that will be updated when user uses the button “Input” in fields of datagrids with editors. Use in fields linked to tables stored in memory.g. Lookup data from sales documents table using as filter the Company Login.C) Lookup data from sales documents from all the companies.SYS. CCCMYTABLE(H[CCCMYOBJECT]) Lookup data from the table CCCMYTABLE and redirects to the Object CCCMYOBJECT. Creates a hyperlink to the caption of the field.COMPANY). J Link to specific field. which are used in searches by other Tables.3. The following table summarizes all the available commands as well as examples of their syntax. then the fields will be updated only if they do not already have a value. Login system parameters (as Login Company) can be used by entering a colon : and then the name of the param(:X. 58 | P a g e . Filter in memory tables.3]) Lookup data from the string list CCCMYSTR displaying only the values that the code of the string list is 1 or 2 or 3.51]) F M.R[CODE]) Lookup data from customers with a specific filter from CCC field and return the customer's code. ITEM(I[QTY1]) In sales documents. SALDOC(W[CCCField in (1.3)].COMPANY]) W Filter with Extra where clause in SQL statement. CUSTOMER(W[CCCS1=1]. Use in selector fields linked to tables. Lookup data from the table MTRMARK using as filters the CCCMYFIELD = 1 and SODTYPE = 51 fields and values.M. entries filtering. MTRMARK(F[CCCMYFIELD. no matter if they already have a value or not. Use in selector fields. Use in any field. Chapter 2 . Columns & Attributes C. Toolbar Button B. User-defined Tables 59 | P a g e . Sorting F. Parent / Child Browsers G. Filters D. Grouping E.Browsers CHAPTER 2 Browsers A. where users can define filters and then view the records by clicking on the button “Browse”. The available fields are displayed in the left hand side of the window. The first screen displayed when you double click an object is the “Filters screen”. Designing a browser is very easy. while the right part displays the selected fields (Columns) that will be displayed in runtime of this particular browser. Pivot tool provides all the functions needed to perform full analysis of your data. Spreadsheet file. Import and export of browsers can be done from the “Custom Administration” tool. It serves a lot of features which can be found either on runtime or in design mode. users can filter. HTML file and even attach the file and send it through e-mail. group. The window displayed. shows all the available tools. Figure D1. sort. Just select a browser from the menu displayed under the “Browsers” arrow button and click the “Design” tool. ASCII file. Another great feature of browsers is the ability to print the records displayed in any of the available windows printers or in MS-Word. Browsers also allow users to alter the data of the records as long as the option “Editable” is enabled through the design mode of the browser.Chapter 2 . PDF file.Browsers Overview Browsers is a very flexible tool that is used for displaying data from database tables and views. copy and paste data using the options of the right click pop up menu. The following image displays the design mode of the “Sales documents” browser. Pivot analysis is yet another great tool embedded in browsers that displays data containing summarized numeric columns in pivot table. Document file.Item Printout Form 60 | P a g e . Browsers is the first screen displayed when you double click on any object from the menu.1 . Browsers are saved as records inside the database in blob fields. In runtime mode. MS-Excel. which are summarized in the following sections. which displays records in one or more datagrids depending on the design of the selected browser. The screen that appears next is the “List screen”. Save as Displays the “Save as” window in order to save the browser with a different name. This means that when you use “Save” button in those browsers the “Save as” window will appear. Figure A1 – Browser toolbar buttons Save Saves the changes of the browser using its current name. Be careful though. Toolbar Buttons The toolbar buttons in design mode of a browser are the following (Figure A1). You always have to use the “Save” or “Save as” buttons in order to permanently save a browser in the database for later use.Chapter 2 . Delete Deletes the selected browser from the database. Apply Applies the changes of the browser and makes it possible to run it and see if it fits your needs. 61 | P a g e . because by using this button browsers are not saved in the database. SoftOne browsers cannot be overwritten.Browsers A. Figure B1 You can also add a column in the “Colum fields” and uncheck it so as to run in the SQL select statement.Chapter 2 . Using the button arrow keys on the right side of the selected columns you can change the display order of columns or remove them. Columns & Attributes In the Columns tab (Figure B1) select a column from the left panel and double click or drag-and-drop in the “Column fields”. Figure B2 62 | P a g e .Browsers B. These fields will be displayed as columns of the browser in runtime. but not be displayed as a column in the results of the browser. the results will appear as in Figure B2. After running a browser. Figure B3 The available field options are: Title: Title of the field Width: Set the column width Decimals: Number of decimal places Justify: Column alignment Editable: Sets the column in edit mode. Period) Grouping zones: Extra grouping of the horizontal analysis. proceed with the configuration of each columns field at the bottom part of “Column fields” as shown in Figure B3.g.1 Field Settings Once finished adding columns.Chapter 2 . Figure B4 displays a sales browser grouped by customer names and horizontal analysis of the total value in months.Browsers B. Field values can change through browser Totals: Summarizes numeric fields at the bottom line of the browser Color zone: Color zone that will be applied to a field depending on the values range Horizontal analysis: Horizontal Analysis of a field based on a specific column (e. Figure B4 63 | P a g e . if you selected a date field as horizontal analysis then you can perform grouping by month. For example. Auto fit columns size: Automatically adjusts the size of the columns of the browser based on the column contents. For example. Display zeros: It specifies whether the numeric columns of zero value will be displayed with zero or blank. in item lines of Sales documents object the right click option “Quick view” is enabled if you have created a “Quick View” browser in Items object Force Pivot: Execution of the browser opens the Pivot Analysis tool automatically. For example if you enter the number 2. This does not mean that the browser will be limited to this number of rows. Quick View: Enables the right click option “Quick view” in fields that are linked to this table through their editor property. Auto preselection: Auto selects all the records displayed in the browser.Chapter 2 . because the header column width does not auto fit.2 General Settings The settings displayed in Figure B5 affect all the columns of the browser: Figure B5 LN Digits: Number of digits that will be displayed in the header column of browser results. Totals file: Enter a name of a file that will be created in SoftOne Temp path. containing the total values of the numeric fields of the browser. but simply that the header column of records below 99 will not be displayed. The default value is 2.Browsers B. All the record required fields must be filled. The path where the file is saved is: <Drive letter>:\Documents and Settings\ <Windows user >\Application Data\SoftOne\Temp Fast entry: It allows inserting new entries directly from the browser. then the header column width will be adjusted in order to be able to display up until entry 99. 64 | P a g e . Fixed columns: Number of columns that are kept visible while scrolling the browser results. Auto filtering: Selecting the cost accounting view displays all the selected columns of operating results (see above). Additionally. Required: Defines that user have to enter data in this field for running the browser Figure C1 D. Locked: Set the mode of the field to Read only. Value: Default value of the field.Chapter 2 .Browsers C. otherwise only the grouping and value fields columns shown as totals. Title: Title of the field as it will be displayed in filter dialog. You can also use any of the available system parameters. you can set the following parameters (Figure D1): Grouping intervals: Define the grouping intervals depending on the type of field Auto Run: Auto execute grouping after running the browser. Grouping This tab contains the fields that will be used for grouping the data of the browser in runtime. Add the fields using drag and drop or double click. will be displayed. Add the fields using drag and drop or double click (Figure C1). Auto filtering: Hides the field group entries that are not included in the results of the browser. then the grouping columns are also used as sorting columns. Filters This tab contains the fields that will be displayed in the first dialog of the browser and will be used to filter the data of the browser. Note: While running the browser with grouping. Figure D1 65 | P a g e . Paging: Export the group index in different worksheets of Excel file. Figure E1 66 | P a g e . Sorting Inside this tab you can define the fields that will be used to sort the results of a browser.Chapter 2 . Ascending or descending sort can be performed by selecting the appropriate option (Figure E1).Browsers E. Figure F2 67 | P a g e . Figure F1 Browser data will be displayed as Figure F2.Browsers F. The header datagrid displays data from Sales documents table. the table item lines. Figure F1 displays the design of a sales documents browser using except for the parent module (Sales documents). Parent / Child Browsers Browser tables are divided into modules (Bands). In "Define report" tab you can set the tables that will be used in a browser. while the detail datagrid from Item lines table.Chapter 2 . Chapter 2 . Figure F4 Double click to enter the table of your choice. which on the right of the textbox "Table" (Figure F4). Figure F5 68 | P a g e .Browsers The detail (2 ) band in a module can be add through the "Add module" button (Figure F3). In order to pick fields from the inserted table you have to select the table from the Module combo box (Figure F5). nd Figure F3 Then select the table that you want to be displayed by clicking on the “Select table” button. User-defined Tables The browsers provide the ability to design child bands (detail) using user defined tables. you can create a sql statement that will populate a datatable. Create the table using the following steps:  Click the “*” «User defined SQL tables" button (Figure G5). Figure G5  In the window displayed. that can be used as child table. That is.  Enter the sql statement in SQL the right panel box (Figure G6). create a new table from the button upper left panel (e. Figure C6 69 | P a g e . MyLines).Browsers G.Chapter 2 .g. Figure C7  Enter captions in the fields and select editor where required by clicking on the "Details" button. Create the fields that will be displayed on the browser clicking on the «Create fields from SQL» button. located in the "Fields" tab (Figure C7). where ID is the primary key of the parent table.  Chapter 2 . Figure C8 70 | P a g e .Browsers The sql statement uses a command to link to the parent table of the browser.  Insert the new table as a detail module following the instructions of the previous section (Figure C8).ID. This command is :ParentTable. Figure C9 Figure C10 Figure C11 71 | P a g e . Save the browser under a name of your choice.  In the "Modules" tab of the browser. select the second module from the combo box and add the fields in the right panel “Field columns”.  Run the browser and the results will be displayed as shown in Figure C11.  Create a new table and enter the sql statement as in Figure C9.  Then create the fields through the "Fields" Tab. enter the captions and the editor FISCPRD in the editor property of the FISCPRD and PERIOD in the editor property of the field PERIOD (Figure C10).Browsers Example Create a browser in customers object that will display in a 2nd band the financial data of customers per year and month.  Insert a new module and select the table you have created through the user defined tables.Chapter 2 . Ms-Word Printout Forms D. Internal Printout Forms C. Automations 72 | P a g e . Ms-Excel Printout Forms E. General Printing Features B. Crystal Reports Printout Forms G.Chapter 3 – Printout Forms CHAPTER 3 Printout Forms A. Label Printout Forms F. 1 Printer Settings The printer mode (Image or Draft) is set through the "Printers" tab of application settings (Figure A1).cfg file. Inside the window that appears by clicking on the "Details" button. database views. etc. Figure A2 73 | P a g e . Select and double click on a printer in order to change its printing mode from Image to Draft. Figure A1 If you select the Draft mode then the option button "Details" (in lower left corner) is activated. you can set the Dot Matrix printer settings. General Printing Features A. Default printing values are inserted through click on the button “Default values” (Figure A2).) of an object and makes the associated fields available for use in report by simple drag and drop. These settings are applied per working station and are saved in the Xplorer.Chapter 3 – Printout Forms Printout form is a report tool that is used for printing records through SoftOne objects. This means that this tool auto inherits the data structure (tables. Link for this folder can be found under the "Identity" button. This file is saved in the "User Profile Directory Softone" folder. A. Printout forms run from the button “Print” while in object view of a record or through right click on a record from browser. Ascii file Windows: Saves data in ASCII file using Windows 1253 encoding. MS-Word: Opens and prints data in new Microsoft Word file. SoftOne runs in "viewer mode" and does not contain any other job. Html format: Saves data html file. External (Excel): Design printout forms using MS Excel.xpr file is <double clicked>. Through a settings screen that is displayed you can set the file format as well as whether the data will be sent in the email body or in an attachment file. SoftOne MetaFile: Saves data in xpr SoftOne format file. Microsoft Word has to be installed on the client computer. It does not necessarily require the installation of Microsoft Excel. Figure A3 74 | P a g e . Spreadsheet File: Exports the data in xls format. If at the time of their execution.2 Available Printing Methods Data viewed in screens can also be sent to the following media: MS-Excel: Opens and prints data in new Microsoft Excel file. Crystal reports runtime must be installed. If SoftOne is not running when the . the operator is subjected to login process and immediately afterwards the report is displayed on the screen. Label: Design printout forms for labels print using the internal report tool. but any spreadsheet application. It does not necessarily require the installation of Microsoft Word. Microsoft Excel has to be installed on the client computer. These files run through SoftOne application (directly from Windows Explorer through <double click>). then the relative printout is displayed on the application screen. the application is running.Chapter 3 – Printout Forms A.3 Printout Form Types The available printout form types (Figure A3) are the following: Internal use: Design printout forms using the internal report tool. A. then (the application runs automatically). but any text processing application. E-mail: Sends email using the selected data. Ascii file DOS: Saves data in ASCII file using 437 character set. In this case. Crystal Report: Design and print forms using Crystal Reports. External (Word): Design printout forms using MS Word. Document File: It exports data in doc format. Fiscal printer: Retail receipts printout forms that are printed through POS Fiscal Printers. xxf file”.1 PTF File This option saves only the structure of the printout form. Figure A4.2). The file extension is xxf and can be imported through the System menu job “Import from . the code and the name. Background images are not saved.2 75 | P a g e . Right click a printout form browser and select the option “Export to xxf file” (Figure A4.1). The file extension is ptf. and can be processed through a notepad editor.4 Import / Export Printout Forms Printout forms can be exported and used in other installations using the following two ways: XXF File This option saves the structure of the printout form as well as the object that uses it. Ptf files are imported into forms using the right click option “Load from file…”. While in printout form right click and select the option “Save to file…” (Figure A4.Chapter 3 – Printout Forms A. It can be inserted in any object as long as you change properly the table and field names. Figure A4. customer data.g. Figure B1 76 | P a g e . prices-quantities totals.Chapter 3 – Printout Forms B.t.Footer (light green): It contains the footer data of a report (e. item lines of a document). Recurrent section (yellow): It contains the recurrent part of a report (e.1 Sections Internal forms are divided in three sections (Figure B1): Beginning of page . comments of a document). date and number of a document.g. B. What differ are the settings and printer commands that can be used. inkjet printers. Internal Printout Forms Printout forms can be designed using the following modes: Draft: Reports printed on dot matrix printers.g. The design environment is the same for both modes. In this case the printer must necessarily be defined as draft and the table "Printer commands" must be filled in (see Printer Settings).). e. Image: Reports printed on laser.c. End of page .Header (light blue): It contains the header data of a report (e. 1 Fields: Displays the fields that can be inserted in the form through double click or drag and drop (Figure B2.2 Figure B2.3 Figure B2. "Blank characters on the left" and "Useful page lines" are used in label printout forms (Figure B2. Printer command: Window for adding printer commands on the forms.1) which appears in the design of internal forms has the following commands: Figure B2.5 Figure B2. Figure B2.6 77 | P a g e .4 shows the properties of the field "Type" of sales documents.3) Properties: Displays the Properties window for the selected point on the form (the option is also available by right-clicking on the form).2 Toolbar The toolbar (Figure B2. Sections: Displays the available sections of the form (Figure B2. Figure B2. (Figure B2.5) Page Properties: Printout form Properties window.6).2).Chapter 3 – Printout Forms B.4 Figure B2. The options "Blank lines above". It can be used as an alternative of "Properties" button which is in the toolbar.3 General Form Operations Right clicking in any place of the form to display the list of available options (Figure B3.to…": Inserts page numbers.1): Zoom In / Out: Zooms the form Lines: Show / Hide page lines. image etc.. Insert line: Inserts a line at the selected point. It works only in the footer and only in internal forms... which can be edited by Windows Notepad Load from file . zone. It works only in footer. Delete line data: Deletes all fields and texts of the selected line.Chapter 3 – Printout Forms B.. Delete: Delete the selected field. Background Figure properties: Figure properties configuration Export background image to a file: Saves image in a file Band Picture: Inserts an image at the selected point Digital signature type B: Inserts a digital signature at the selected point. Delete line: Deletes the selected line. Add background: Inserts an image as background (image in jpg or bmp format). (Greek Legislation) User defined label "from . image etc. Properties: Displays the properties of the selected field.: Imports a form from ptf file Figure B3. zone. User defined Tables: Inserts a User defined table in the form layout Save to file…: Saves form to a file in ptf extension.1 78 | P a g e . at the end of the report. Characters width: 137 Draft Printouts: Lines height: 66. the ruler that surrounds the design screen of the form will be adjusted accordingly (Figure B4.2). Figure B4.1). Characters width: 137 Note : The actual dimensions of the printout in centimeters depends additionally on the settings of the geometry font for the image printouts. In case of using a document without distinctive paging (e. roll paper of a cash device). Once page dimensions setting is completed. Basic Dimensions Parameters Laser Printouts: Lines height: 85.1 Figure B4. while for draft printouts depends also on the used printer commands.2 79 | P a g e .Chapter 3 – Printout Forms B.4 Page Size The size of the form is set through the right click option "Properties" which is available at any point between the zone of the recurrent part (white color) and the footer of the form (Figure B4. set the parameter "Dynamic page length" to "Yes" so that the footer is printed only once.g. Specifically. The option "Default Page Font" determines the default font for each field or text you enter. Figure B5. The option "Geometry font" sets the font type and size that will determine the size of the grid cells of the form. the geometry font is the key parameter that determines the space available for printing each character on the page. Special settings regarding the printing method (font type and characters size) for the different sections of the form or even for specific fields can be set through their "Properties". If your data exceed this width. Note: If these parameters are not entered. Essentially.5 Draft Printout Fonts The font size in draft printouts is set by printer commands. Inside the properties window you can apply the appropriate setting (Figure B5. Suppose you set 12CPI size and the maximum width according to the settings. if there is a printer command of 12CPI. through page properties you can set the fonts to be used in the designed form.1 B. is 96 characters. The width of the line you have set at form settings determines the maximum number of characters per line. Printer command settings are applied in form until you use a new one. then all elements of the form that follow will have this size. Printer commands (red squares) are added in forms by clicking on the button “Printer command” of the toolbar.6 Image Printout Fonts The font size in image printouts is initially set by "Page properties" button on the toolbar. For example. even if the overall width of the printout form is larger. 80 | P a g e . A printout form can have one or more printer commands. It is obvious that the default page font cannot be larger than the geometry font because this would lead to characters overlapping during printing. which apply different font sizes per line or module.Chapter 3 – Printout Forms B. then the default fonts are used (Lucida Console 8pt). line folding will be applied. The size is applied in combination with the special settings that have been set in the draft printer. Note that the actual size of the printout is enlarged proportionally to the size of the selected geometry font.1). 8 Band Image Images can be add into a form section through the right click option "Band Picture". it sorts the data of the table according to the selected field. The recurrent section contains prints the data entered in the yellow line. it groups the data according to the selected fields. Right click the recurrent part (yellow line). Expression must be entered using only the name of the field (not the table). Fields are separated with semicolons. Pack fields: If used. B7. you have to enter QTY1>0. click the "Properties" button and the window of Figure B7.1 B. Figure B8. The field must be added in the same way as it is displayed when you add it inside a section of the form. Section properties are the following: Lines: Indicates the section number of lines Table: Name of the table that will be used for displaying data / fields in this section Filter: If used.1) you can define the path and the filename of the image in the Value textbox.0. Images saved in Items related files are displayed through the use of the command $MTRLINES.7 Recurrent Zone The first thing you have to define before inserting fields in the recurrent part of the form is the table that will be used in this section.MTRL. Sorting: If used.. using the command $MTRLINES.. Inside the properties of the image (Figure B8.1 will be displayed. it filters the data of the table according to the expression.MTRL. For example if you want to filter item lines that have quantity larger than zero.1 81 | P a g e . You can also add the image used in Items object.Chapter 3 – Printout Forms B. Header fields must be inserted in the document header.2) Figure C1. To set the SoftOne table from which data are retrieved for the recurrent zone. create a hyperlink to symbol {@ of the first column.2 displays an example of a recurrent part referring to the document lines (MTRLINES). Create a new form and use the option "External (Word)" in the form type. Ms-Word Printout Forms C. 82 | P a g e .1 Figure C1. Symbol @} of the last column of the table does not need a hyperlink. Figure C2. are divided in three sections: header.1 Add Form MS Word forms are designed through Microsoft Word application.1 Figure C2. The first column of the table must contain the symbols {@ and the last column the symbols @} (Figure C2. Page Footer is created in MS Word form by inserting a new textbox at the bottom (not the footer) of the document page and grouping the items inside it.1).2 Fields are inserted in the word form by double-clicking SoftOne form fields window. The fields of the recurrent part must be entered in a Word table.2 C.Chapter 3 – Printout Forms C. recurrent part and footer.2 Form Design Word Forms. create a new Word document through the right click option or by clicking on the "New model report" button (Figure C1.1) Next. (Figure C1. Report footer is created by adding a hyperlink to the textbox at the bottom of the document page with the command "XTR: LP_FOOTER" in the Address field. entering in the address field the command "Table: tablename". Figure C2. If you do not add the fields in the form. sorted and grouped. in order to work properly. Figure C3.1): TABLE:<Table>. by adding extra commands to the hyperlink of the first column ({@). an exception message wil be displayed informing you that a field is not found.<FilterField 1> AND<FilterField 2> OR<FilterField 3>. The syntax is the following (Figure C3. Figure C4.1): FIELD:<Field>.1 C.n where n is the number of decimal places.2 83 | P a g e .3 Filters – Sorting – Grouping Data of the recurrent part of a Word can be filtered.4 Field decimals Decimal places can be added to numeric fields. then in runtime. through editing the field hyperlink and adding the following command in the address textbox (Figure C4. <SortField>.Chapter 3 – Printout Forms C. <GroupField> The fields used in the above command must also be inserted in the form.  Insert a text box outside the above text boxes. (Figure C5.2) Figure C5.5 Report Footer Data can be displayed in report footer using the following steps:  Insert text boxes at the bottom of the page and enter the text you want to be displayed. entering the command "XTR:LP_FOOTER" in Address textbox.1)  Group all text boxes.2 84 | P a g e .1 Figure C5.Chapter 3 – Printout Forms C. (Figure C5.  Select the grouped box and add a hyperlink. 1 Figure C6.Shape . Use the formatting marks to help you achieve that (Figure C6.2 Figure C6.3 85 | P a g e .MTRL.2) Note: You have to be very accurate for entering the shape into the right column of the table.0 (Figure C6. Figure C6.Chapter 3 – Printout Forms C.6 Item Image Image fields can be added in the document form lines.1).Rectangle) (Figure C6. using the following steps:  Insert a Rectangle Shape (Insert .  Insert a hyperlink in the shape and enter in the address textbox the command: IMAGE:$MTRLINES.3). Moreover.2): REPLACE(REPLACE(A.REMARKS. The following example uses the field Remarks of Sales documents. in which you have entered multiline text (enters line breaks). Figure C7.3 86 | P a g e .char(13).char(11)) The result of using the local field on the form is shown in Figure C7.7 Text wrap When printing a word form with a memo field (i.char(10).1) Figure C7. it performs a line break if the field is inserted directly into the text. customer remarks). that is it displays the enter character symbols (). while it does not insert a line break if the field is inserted into a table cell (Figure C7.Chapter 3 – Printout Forms C. Create a defined field and add the following statement (Figure C7.1 The specific behavior can be corrected through the creation of a defined field which will replace the line break characters #13 & #10 with #11.3. word displays text erroneously.e.'').2 Figure C7. 2) Figure D1. Fields are inserted through double click.1 Figure D1. sorting or grouping data is the same as in MS-Word printout forms: TABLE:<Table>. Recurrent section must have as first column the {> symbol signs and as last column the symbols <}.2 D.1) Next. (Figure D1.Chapter 3 – Printout Forms D.1 Insert Form MS Excel forms are designed through Microsoft Excel application. create a new Excel document through the right click option or by clicking on the "New model report" button (Figure D1. <GroupField> Figure D2. The syntax for filtering. Ms-Excel Printout Forms D. select the {> symbol in the first column and create a hyperlink entering in the address box the command "Table: table name" (Figure D2.2 Form Design Excel forms have also the recurring section but do not support pagination. Create a new form and use the option "External (Excel)" in the form type.1 87 | P a g e . To set the SoftOne table from which to retrieve data of the recurrent section. You do not need to insert a hyperlink in the <} symbol of the last column cell.<FilterField 1> AND<FilterField 2> OR<FilterField 3>.1). <SortField>. Note: Fields in recurrent section must be entered after you insert the {> symbol of the first column in order for the form to run properly. Enable the option “Automatically from form” for activating the commands you have entered in the “Printing – repetition condition” property of the label. Before printing labels. Barcodes can be displayed by choosing the appropriate font. allowing you to change the printing settings. From the same window you can set the number of copies that a label will be printed (Figure E2).Chapter 3 – Printout Forms E. The tool for designing labels is the same as the one used for internal printout forms (Figure E1). In runtime. Figure E2 Fields are added in the label in the same way as in internal forms (drag and drop or double click). labels are printed through the right click option “Print labels”. Figure E1 Through form properties you can define the label size. as well as the table that will be used for retrieving data. the window of figure E3 is displayed. Figure E3 88 | P a g e . Label Printout Forms Labels are designed through the option “Label”. Crystal Reports Printout Forms F.1) Next.2 To create a report form in Crystal Reports you need to know the following:  The database tables that contain the data you want to display  The field names of the above tables  The primary keys of the tables that will be used to link them.1 Figure F1.1 Basics The forms in Crystal Reports are designed exclusively from within the Crystal Reports application. using the option "Crystal Report" in the form type. which is located in the SoftOne common area. (Figure F1. Create a new form.  If the SoftOne installation is on premise or on Azure. These fields will be matched through SoftOne local fields.  The key fields of the object tables through which SoftOne will connect to the Crystal report. create a new Crystal Reports printout form through the right click option or by clicking on the "New model report" button (Figure F1.Chapter 3 – Printout Forms F. as long as you have installed the Crystal Reports Runtime application. 89 | P a g e . Crystal Reports forms can run from computers where Crystal Reports is not installed. Designing a form in Crystal Reports application can be done in two ways. To create a crystal report in a Windows Azure environment it is mandatory to use a command. Printout forms designed using crystal reports can only be printed on a physical printer or in pdf file.2) Figure F1. either using tables or using commands (direct use of sql statements to define the data and the structure (tables and fields) that will be used in the report). 2) asks for the Server credentials and the database name that will be used in the report. In the window displayed choose "Microsoft OLE DB Provider for SQL Server".1 Figure F2.Chapter 3 – Printout Forms F.1).Standard report menu and then from the window that appears choose OLE DB(ADO).2 90 | P a g e . if the database is on an SQL Server (Figure F2.2 Crystal Report Design Create a new report from the File .New . The next window (Figure F2. Figure F2. Figure F3. design the report by selecting the fields you want display (Figure F3.Chapter 3 – Printout Forms F. The example below uses tables for creating a crystal report that will be inserted in SoftOne documents printout form.1). 91 | P a g e . The example uses the parameter iFINDOC which links to the FINDOC field of documents (Figure F3.g. the FINDOC field) you must set a Parameter field which will be linked to the primary field of the SoftOne entry.3). then select from the tab “Data” the name of the database and then add the tables you want to use in the right panel of the window (Figure F3.2 From the main report Design screen.4).3 To link the report to a SoftOne entry (e. The next step is to link the tables based on the primary keys (Figure F3.1 Figure F3.2). Figure F3.3 Reports using tables If you choose to create a report using tables. follow the steps of the section F5. Figure F3.Record and in the window that appears "link" the iFindoc parameter filter to the field FINDOC.5 92 | P a g e .4 The next step is to create a filter for the report entries based on the Parameter field.Chapter 3 – Printout Forms When creating the Parameter field you should always pay attention to the field type.FINDOC as shown in Figure F3.5. Figure F3.Selection Formulas . From the menu choose Report . To import the report into SoftOne as report form. In this case the link field FINDOC is an integer. so the parameter type must be Number. In the same window you may also enter the parameter fields (Command Parameter) which will link your crystal report to a SoftOne record. To import the report into SoftOne as a printout form.1 displays the design of a crystal report through a sql query command. The example in Figure F4. since the parameter (iFINDOC) can be linked with a document record (FINDOC) through a defined field inside the printout form. This report can be used in Sales documents printout forms.1 Figure F4.Chapter 3 – Printout Forms F.2 93 | P a g e . Figure F4. follow the steps of the next section. Design your report as in the previous section omitting the part of matching the Parameter Field with a table field. because it is already defined in the sql command (Figure F4.4 Create Reports using commands If you want to create a report using a command.2). which is mandatory for Azure installations. select "Add command" and in the window that appears type in the sql statement. 3 Note: If you have matched the parameter fields of a Crystal Report with SoftOne fields through user defined fields. If you choose "Yes" then the Parameter fields will be automatically imported into the "User defined fields" section of the report form defined fields (Figure F5. From the “Fields” button of the printout form. Select the rpt file you have created and the window shown in Figure F5.1 Figure F5.2). Add the defined field iFINDOC which is the name of the parameter field of crystal reports.3). into SoftOne printout form you must choose not to let SoftOne automatically define questions. select the “User defined fields" section.FINDOC (Figure F5. then when adding again the crystal report. In the calculation formula add the SoftOne matching field which in this case is SALDOC.1 will be displayed. select "Crystal Reports" as form type and then right click to select "Insert document from file". Figure F5. Figure F5.2 The example below imports a crystal report into sales documents. Create a new report form. 94 | P a g e . since otherwise the matches you have created will be deleted and then you will need to recreate them. just follow the steps below.5 Import Crystal Report into SoftOne In order to import a crystal report inside SoftOne as a printout form.Chapter 3 – Printout Forms F. There is also the option of auto saving the report in a file and path. Completed similarly to "Formula To" Formula BCC: Bcc.Chapter 3 – Printout Forms G. Formula CC: Notification. You can also use html code. Automations Printout forms can be used to automatically send reports via email in pdf format. Enter in single quotations the main text of the email. upon usage of the specific form. then the email files sent include the two txt files produced in collaboration with the Special Secure Tax Layout of Data Marking. Formula Body: Email text.1 The email parameters are the following: Formula To: Email Recipient. Using this option the document will be sent directly in the chosen format. In this box. Figure G1.2). enter the recipient's email in single quotes. Note: If you have tax mechanism of B type. Completed similarly to "Formula To" Formula Subject: Email subject.1).2 95 | P a g e . Enter in single quotations the text of the subject. G. Note: You can add any form fields to all the above mentioned boxes. which must be entered in a defined field (Figure G1. or the email field from the corresponding table of the form.1 Auto Email Automatic routing (email sending) is performed by activating the corresponding option in the "Parameters" Tab (Figure G1. Figure G1. 1 96 | P a g e . In runtime.e. can include form fields (Figure G2. Formula for file name: Filename. In the "Files" panel fill in the “Formula for path” and “Formula for file” textboxes.1). Figure G1. The text body will display the text of field XBODY.FINCODE). Figure G2. Use single quotes to specify the path where the file will be saved. Formula for path: File path. This option can be used either individually or in combination with automatic routing. the document will be sent to the email of the document customer (SALDOC.Chapter 3 – Printout Forms Figure G1. i.3 G. You must necessarily indicate the extension of the file. Use single quotes to specify the file name.3 provides a simple example that uses text and fields inside the email properties.2 Auto Save to file Automatic filing (file saving) is performed by activating the corresponding option in the "Parameters" Tab. located within the defined fields from the sales documents table of the printout form. The path can be parametric. after printing the particular sales document form.TRDR_CUSTOMER_EMAIL) having as a subject the combination of the text 'Invoice' and the document (SALDOC. Chapter 4 – EDA CHAPTER 4 Event Driven Actions (EDA . Actions C. Events & Conditions B. Examples 97 | P a g e .Alerts) A. Multiple rules can be defined in a single EDA. More experienced developers can also find this tool very useful. When such conditions are met.Chapter 4 – EDA Overview Event Driven Actions (Alerts) is a very powerful tool that that allows you to add new functionality to any built-in or custom object in a way that it meets your needs. that the command should run only when the retail field's price is greater than 10. Note: In case of more than one arguments in the "Condition" field.1 Field Rule (On Change) The On change field event fires after data are changed in a field.c.e. field value calculations and many others can be easily developed with simple clicks or drag and drop actions. because apart from the above. A. like custom messages. different events occur in fields. One thing that you must always keep in mind is that EDA affects by default all the forms of an object. In the example of Figure A1 an alert has been created that updates the wholesale price (ITEM. Examples of EDA are the following: display a message when text is changed in a field. calculate and set the data of a table field when a new row is inserted in a datagrid or even send email and sms when a record is posted and certain conditions are met. In "Condition" field you enter the condition for running the command that is you specify when it is going to run. these should always be placed in parentheses.t. you could enter command ITEM. e. field and record validation.PRICER) times 0. it fully supports sql statements and coding in JavaScript or VBscript. you need to know the basic structural components (tables. virtual tables.7. e. The operation is performed using the internal function SETVALUE.PRICEW) of the item with the retail price's product (ITEM.) that compose the objects of the application. object Customers. built in commands and internal functions are available through a very friendly interface that even amateur developers can use. A. In order to use events. Figure A1 98 | P a g e . The command is applied upon a change in the retail field. All the events. Events & Conditions EDA tool allows you to set the events and the conditions where actions will take place. Jobs. More specifically.PRICER > 10 i. separated by AND or OR. a series of actions can be executed. datagrids and objects and can be used to create new rules and jobs.g. In the following example. sms and email sending. For example. Usually used for setting default values. Before Delete Fires before a dataset record is deleted.SALESMAN'. Use it to perform any actions that you want to occur before a dataset record is posted. which populate datagrids in screen forms are summarized below. Before Post Fires before changes to a dataset record are posted. On Insert Fires when a new record is added in the dataset. Use it to raise custom messages or perform any other updating actions.Chapter 4 – EDA A. CUSTOMER. because they may fire twice. Use it to perform validation or to raise custom error messages.2 Table Rule All the events that fire on Datasets. Figure A2 99 | P a g e . Usually used to display / send a message or for calculating purposes in order to update values. After Post Fires after changes to a dataset record have been posted.SALESMAN) is executed and sets as the default salesman of the branches the customer's salesman. if you enable both “Before Post” and “After Post” and choose to display a message. After Delete Fires after a dataset record is deleted. Be careful when enabling more than one events. then this message will be displayed two times when you move to the next record of a datagrid or dataset. Example The EDA rule of the example in Figure A2 operates in the customers' object as follows: When users add a new branch in table CUSBRANCH then the function SETVALUE('CUSBRANCH. performing validation or raising custom error messages. It is commonly used for updating values. Available events are: On Insert Occurs when a new record is created For example. After DB Update Occurs after updating a record in an object For example. it fires when users edit / change the contents of a record and then click on “Save” button. For example. after the record is saved in the database. it fires when users edit / change the contents of a record and then click on “Save” button. so be carefull not to combine it with these events because it will fire twice. The event rises before the record is saved in the database. Notice that you can create jobs to be executed in one or more events by simply checking the appropriate events. After DB Post Occurs after saving record data of an object It is this same as “After DB Insert” and “After DB Update”.Chapter 4 – EDA A. On Locate Occurs after locating a record in an object. 100 | P a g e . so be careful not to combine it with these events because it will fire twice. The event rises after the record is saved in the database. it fires when users double click on a record in a browser.3 Module Rule These events occur in objects. Before DB Delete Occurs before deleting a record of an object For example. After DB Insert Occurs after inserting a new record in an object For example. display the record in screen form. it fires when users click on “Save” button for a newly created record of an object. it fires when users click on toolbar button “Delete”. before the record is saved in the database. Before DB Update Occurs before updating a record in an object For example. Before DB Insert Occurs before inserting a new record in an object For example. Before DB Post Occurs before saving record data of an object It is this same as “Before DB Insert” and “Before DB Update”. it fires when users click on toolbar button “New”. it fires when users click on “Save” button for a newly created record of an object. but always be careful of accidentally running the same job twice by clicking more than one events. before the changes take effect. Chapter 4 – EDA After DB Delete Occurs after deleting a record of an object For example. after the changes take effect. Figure A3 Figure A4 101 | P a g e .TFPRMS<>201). it fires when users click on toolbar button “Delete”. displaying a warning message (Figure A4). Example The EDA rule of the following example (Figure A3) is applied in sales document posting. Additionally. It prevents saving a record if the transaction’s currency is different from the customer’s currency. it checks if the field TFPRMS of the document is different from a certain value (SALDOC. Chapter 4 – EDA A.4 Index – Search Conditions The index . select "Run"as Fact. set the run condition (Formula) and the caption (Indication) that will appear in the browser as title. Moreover. To create an index condition. which will be inserted in the “where clause” of the sql query of the browser when the condition is met. The application user with code 504 will display only the meetings entries for which he is defined as the operator.search conditions operate as filters in the running browsers of the objects. In the “Formula facts” panel. the meeting lists' title will display the caption "Locked for 504" (Figure A6). "SQL filter" as Type and in the Text field enter the SQL filter. Figure A5 Figure A6 102 | P a g e . Example The following example (Figure A5) applies to object Meetings. In order to use this type you need to setup the cell phone from the SoftOne Remote Server or use a Web SMS provider from the Settings window.1 B.Chapter 4 – EDA B. The recipient may be entered through a formula or a table field (e.EMAIL). 103 | P a g e . TRDR. Available types are (Figure B1.PHONE01).g. Select the user from the column “Recipient”.1): Figure B1. the message will be displayed on the screen.2): Figure B1. To email address of the user Sends the message to the email address specified in the “Recipient” column. The message is saved and as soon as the selected user is available (logs in the application). In order to use this type you need to setup the outgoing email from the Settings window or from the SoftOne Remote Server. To user’s cell phone Sends the message to the cell phone specified in the “Recipient” column.1 Send Message Sends a message specified in the “Formula” column to the recipient of the column “Recipient”.2 On the screen of the user Sends the message to a user of the application. TRDR. Actions The datagrid “Actions” contains all the jobs that can be executed whenever the selected events fire and certain conditions are met. The recipient may be entered through a formula or a table field (e.g. The available actions are the following (Figure B1. 4 Run Apart from the display or sending messages. VB Script Runs the VB script described in the “Formula” column. an event confirmation question is displayed. In this case. Job Runs the SQL statement described in the “Formula” column. On "after Event " actions. EDA allows you to run various commands. you don't need to set anything but the formula as all the rest elements are calculated automatically.2 Display Message (Notification) Displays on the screen of the login user a text message described in the “Formula” column. B. B. It can only be used for object rules and only for the events related to the database.6 Reminder This type of action is the same as sending a message to a user of the application and it only differs to the fact that the message is saved and displayed as a reminder. The available types / run commands are (Figure B4): Figure B4 SQL Command Runs the SQL statement described in the “Formula” column. 104 | P a g e . On "before Event" actions.5 Update This type of action can be used only in object rules and it displays a validation message box before committing the changes to the database. Java Script Runs the Java script described in the “Formula” column. Function Runs the internal function of the program described in the “Formula” column.Chapter 4 – EDA B. B.3 Error Display (Exception) Displays on the screen of the login user a text message described in the “Formula” column and stops the flow of the program. an event completed message is displayed. B. Figure C2 105 | P a g e . Figure C1 C. Examples C.1 Field Rule – Message display Each time the log in user changes the address of a customer and the turnover of the customer is greater than zero. then the operator's screen will display the message "Changed the address of the customer [customer's name] (Figure C1).2 Table Rule – Error message display Prohibition on deletion of a customer's branch when the customer's turnover is positive. displaying the message "Deletion is aborted" (Figure C2).Chapter 4 – EDA C. 3 Object Rule – Message send Once the operator chooses to delete a customer with a positive turnover. the application will stop the process showing a message to his screen. can only view the item browser records that the field “Code” starts with “000-000”. Figure C3 C. Figure C4 106 | P a g e .4 Index – search condition The operator in the workstation named “user1” .Chapter 4 – EDA C. The title of browser will also display the phrase 'For the computer user1’. The message will also be sent and displayed to the “Administrator’s” screen (Figure C3). Operation Options 107 | P a g e . Basics B.Chapter 5 – Defined Fields CHAPTER 5 Defined Fields A.  Field type options are different depending on the selected operation. EDA (alerts). as it will be displayed in dialog filters. By default. Operation Commands / SoftOne Tools Browsers Design Reports Line Balance / Calculation   Calculation of line+totals   SQL command   Question   SQL filter   Single filter   Multiple filter (OR)   Multiple filter (AND)   Function   Open Reports  Imports Printout forms EDA (Alerts)          Remote Commands     108 | P a g e . which begins with the letter V and is followed by an auto increment number. Basics Defined fields are used for displaying data using simple or advanced calculations between database fields. you are allowed to change the name in a name that meets your needs. printout forms and in any other tool that they are displayed as an option.  The Caption defines the title of the defined field. if the operation is “SQL filter” then the only available option is “Boolean”.  Select if the field is available in the design columns of the tool through the Displayed option. For example.  Operation defines the way data will be accessed and are discussed in the following sections.c. e. All the available operation options are summarized in the table below. reports.t. imports. columns. since the can only be used from other defined fields.  In the Calculation formula enter the commands that will be used to calculate the value of the defined field. The available options when designing a defined field are the following:  The Name of the defined field is used for reference between the defined fields. Of course. for every new defined field you enter a preselected name is auto-inserted. Note: Defined fields using the option “Function” in operation column cannot be displayed. They can be used in browsers.Chapter 5 – Defined Fields A. 1 – Defined field using RUNSQL function Figure B1. you use a defined field in a browser that at runtime displays 1000 records. because for each query. This means that defined fields using RUNSQL function may be a cause for reports or browsers delay. when you need to use sql statements.SYS. Note: System parameters are available through this operation command (e. The “Calculation formula” used in fields with this operation option. Operation Options B.g.1 Line Balance / Calculation This option is used for displaying data in columns. so. is executed for each record displayed in the tool that the defined field is used.Chapter 5 – Defined Fields B.2). the database server has to execute it and return the results (Figure 1. using math calculations or built-in functions and is accessible through all SoftOne tools. If you use the function RUNSQL for retrieving results in a field. then one sql query will be executed per record displayed. This might cause slow performance.1). then the calculation will be executed 1000 times (each for every record) (Figure B1. Figure B1. it is much better to use the operation command “Sql command” in the controls that is available.USER). This means that if for example.2 – SQL Monitor 109 | P a g e . :X. using the expression: Sales value .SalVal-VSALSTAT.3 – Calculations between Fields Example 2 (Report) Defined field in the report “Sales per customer” that displays the concatenation of the name and surname of Salesmen. use the operation option “Line Balance”. Example 1 (Browser) Defined field in the Sales Statistics browser that calculates the gross profit. Enter the calculation formula (or drag and drop the fields): VSALSTAT. Create a defined field and select “Line Balance” as operation and “Number” as field type (Figure B1.SCpurmtk Figure B1. Figure B1. as Field type “Alphanumeric” and enter the following formula: CUSTOMER.1.1 Basic calculations Calculations between fields is achieved using a defined field with “Line Balance / Calculation” operation.4).g.4 110 | P a g e . Create a new defined field.SALESMAN_PRSNIN_NAME2+' '+CUSTOMER. Number) and then enter or drag and drop the fields.3).SALESMAN_PRSNIN_NAME (Figure B1. Select the field type (e.Sales cost. applying the preferred math formulas.Chapter 5 – Defined Fields B. This expression uses also the built-in function if for the validation check.SalVal+VSALSTAT.SalVatAmnt))/VSALSTAT. minutes.Chapter 5 – Defined Fields B. seconds).(Abs(VSALSTAT. Create a new defined field using the Operation “Line Balance” and “Number” as Field type.5). Basic functions and examples of them are discussed below.1.6 111 | P a g e .2 Built-in Functions SoftOne application has predefined functions that are available in defined fields and can help you do more advanced calculations.SoTime) (Figure B1.5 – Abs Function FormatDateTime(Param1:string. set the Operation to “Line Balance / Calculation”. Figure B1. in a specific format (hours. Abs(Param1:double):double Returns the absolute number defined in Param1. You can find them in the window that appears using the button “Available functions” (upper left corner inside defined fields window). Example (Browser) Defined field in a Sales statistics browser that displays the absolute number of the expression: (Sales value + Vat Value) / Abs(Sales value). Create a new defined field. Example (Browser) Defined field in Sales statistics browser that displays the insert time of sales documents.6). This formula returns the date of the field in “hh:mm:ss’ format.SalQty1<>0. Param2: Date]): String Returns the date of the Param2 in Param1 format.SalQty1.VSALSTAT.0) (Figure B1. Figure B1. The expression will be executed only if the sales quantity is larger than zero. Enter the formula expression: IF(VSALSTAT. the field type to “Number” and enter the following formula: FormatDateTime('hh:mm:ss'. the field type to “Alphanumeric” and enter the formula (Figure B1.V1) The field EVTCUSTOMER.'0') Return to the main screen of the EDA and create a new Formula fact using “Run” as Action. Open the EDA tool of the customers object. “Function” as Type and enter the formula (Figure B1. Create a new EDA and add a Module rule. Click on the toolbar button “Fields” and move to the Defined fields (available through the node <Event fields>).7 – Lpad function Figure B1.8): SETVALUE('CUSTOMER.Chapter 5 – Defined Fields SetValue(Param1:string.EVTCUSTOMER.CODE'.CODE1. Note that the first parameter (Param1) is string. You may drag and drop it instead of typing it.V1 is the defined field you have created.8 – SetValue function 112 | P a g e . which means that fields have to be inserted in single quotes. adding zeroes as a prefix in such a way that the whole length of the field is no longer than 15 characters. Param2:variant):integer This function is usually used in EDA (Alerts) for setting a value (Param2) to a field (Param1). set the operation to “Line Balance / Calculation”.7) : LPad(CUSTOMER. Enable the event «Before DB Insert». Figure B1. Create a new defined field.15. Example (EDA) EDA in Customers that that sets to the value of field Code1 the value of field Code. 10 displays the sql query in SQL Monitor.mtrlines m where m.findocs=f.FINCODE)+' and m. The field (VSALSTAT. This function is used for retrieving data from database objects.findocs=f.findoc = '+STRING(VSALSTAT.10 – SQL Monitor 113 | P a g e .fincode from findoc f.Findoc)) Figure B1. because one statement is executed per results record and this can cause slow performance.fincode='+QUOTESTR(VSALSTAT.9 – Defined field using RUNSQL function Figure B1. Be careful when you use this function. Example 1 (Browser) Defined field in a Sales statistics browser that displays the fincode field of the “converted from”document that is linked to the Sales document displayed in each record of the browser.Chapter 5 – Defined Fields RunSQL(Param1:string):string Executes the SQL statement (Param1) and returns the results. Note: If you need a reference to a varchar field then you have to use the QUOTESTR function instead of STRING function. select “Line Balance / Calculation” as operation.fincode from findoc f.Findoc)) (Figure B1. “Alphanumeric” as field type and enter the formula: RunSql('select f.FINDOC) is entered in single quotes.findoc='+STRING(VSALSTAT.9) Note that the formula uses the function String for reference to the FINDOC id of each record. Create a defined field.mtrlines m where m.findoc and m.findoc and m. For example for applying as extra filter the value of the FINCODE field then the sql statement should be: RunSql('select f. Figure B1. This can be implement in three different ways.11). The formula is: RUNSQL('SELECT AFM FROM COMPANY WHERE COMPANY='+STRING(CompanyCode)) Figure B1.COMPANY system parameter. The formula is: RUNSQL('SELECT AFM FROM COMPANY WHERE COMPANY='+STRING(SALDOC. Figure B1.11 Figure B1.No. using the RUNSQL function (Figure B1.SYS. the only thing that is different is the way you can use the system parameter Login Company.SYS. The first defined field uses the value of the field SALDOC. The sql statement produced is the same.12 – SQL Monitor 114 | P a g e .COMPANY. prefixed with a colon that retrieves the login company. that can be found in “Available functions”.Chapter 5 – Defined Fields Example 2 (Printout form) Defined field in Sales documents printout form that displays in header the company T. The formula is: RUNSQL('SELECT AFM FROM COMPANY WHERE COMPANY=:X.12 displays the sql statements that will be executed at runtime.COMPANY)) The second defined field uses the X.R.COMPANY') The third defined field retrieves the login company using the internal parameter CompanyCode. 15 115 | P a g e . The text will wrap every 20 characters. The defined field V2 will be used to display all the rest text of the field MTRL.Chapter 5 – Defined Fields Copy(Param1:string. starting from Param2 position.MTRL_MTRL_REMARKS.15.1000).13 – Function Copy Figure B1. Create the two defined fields inside the “Material Lines” (table MTRLINES) as in Figure B1. At runtime the form will be printed as in Figure B1.COMMENTS using the formula: COPY(MTRLINES. Set the width to 20 characters.14 Figure B1.14). using the $ sign (Figure B1.Param3:integer):string Returns the number of characters defined in Param3 for the string Param1.1. The defined field V1 will display the first 20 characters of the field MTRL.MTRL_MTRL_REMARKS. Field wrap is achieved through the $ sign.COMMENTS using the formula: COPY(MTRLINES. in the properties.21. Note that the comments of the first line are wrapped in four lines. Insert the field V1 in the recurrent section of the form and then enter the V2 field. Example (Printout Form) Defined fields in sales documents printout form that display the field Comments of Items in the recurrent section of the form.13. Figure B1.20).Param2. which uses exactly the same commands and functions as “Line Balance / Calculation”. Aliases can be easily spotted in the sql statement that runs if you execute the browser.17 – SQL Monitor 116 | P a g e .Chapter 5 – Defined Fields B.COMPANY AND MTRCATEGORY=A. Create a defined field in Item browser and select SQL Command as operation. It differs to the fact that it can only be used in numeric field types for displaying the totals if there is grouping in the browser or report. It substitutes the RUNSQL function in browsers.16) Note that the alias A is used for linking the primary key field MTRCATEGORY of the table MTRCATEGORY with the MTRCATEGORY field of item. Sql statements are displayed inside the the SQL Monitor tool (Figure B1. reports and printout forms.MTRCATEGORY (Figure B1. B. It is executed within the select clause of the report. Example 1 (Browser) Defined field in Items browser that displays the Name field of the Item commercial category.3 SQL command This operation is used in sql statements for retrieving data from the database.16 Figure B1.2 Calculation of line+totals This operation is the same as “Line Balance / Calculation”.SYS. Figure B1. This means that in case you want to display the totals of a defined field in browsers or reports that have grouped data then you have to use this operation.17). Alphanumeric as field type and enter the formula: SELECT NAME FROM MTRCATEGORY WHERE SODTYPE=51 AND COMPANY=:X. so it runs much faster. Figure B1. It is usually used combined to the operation SQL filter for applying the filters inside the where clause of sql statements.19 – Dialog filters using Question Operation The second defined field (V2) uses a sql statement for filtering the records depending on the selected daterange. The formula is: NOT EXISTS (SELECT 1 FROM TRDTRN WHERE SODTYPE=13 AND TRDR=A.18.TRDRV1L)] AND [SQLDATE(USR. Figure B1. 117 | P a g e . You can use any built-in function inside sql statements.TRDRV1L and USR.18 The V1 field uses the command $DATERANGE which displays range (Date from – Date to) in a datetime field (Figure B1.TRDR AND TRNDATE BETWEEN [SQLDATE(USR.19). Set also the current year as the default value of the date.TRDRV1H)] ) Note that square brackets are used within the sql statement that include the function SQLDATE and the commands USR. Figure B1.4 Question This operation is used for defined fields that will be displayed as dialog filters in browsers or reports. The SQLDATE function returns the date in SQL format (‘yyyymmdd’). Example (Browser) In Customers browser create a defined field that will display customer records that don’t have transactions within a date range defined in dialog filters.TRDRV1H. as long as it is inserted in square brackets [].20 displays the sql statement that is executed at runtime through the SQL Monitor tool.Chapter 5 – Defined Fields B. Create two defined fields V1 and V2 as in Figure B1. The filtering is performed at runtime when users select a date range and enable the dialog filter V2. which is the value for Current Year.22 118 | P a g e . as it is defined through the Date Ranges object (Figure B1.TRDRV1L and USR. The names TRDRV1L and TRDRV1H are found with the use of the shortcut keys CTRL+SHIFT+F12 that is performed in the dialog filter field V1 at runtime (Figure B1. Select the defined field V1 and enter the value 131.Chapter 5 – Defined Fields Figure B1. Figure B1.20 – SQL Monitor The USR. Figure B1.21).21 – CTRL+SHIFT+F12 The default value is set through the filters tab of the browser in design mode.TRDRV1H are the values that the user has entered inside the dialog filter field V1.22). Figure B6.5 SQL Filter This operation is used for filtering the records of a sql query. At runtime. Fields created using this operation cannot be displayed as columns.3. then this value can be used to filter the records. B.6 Single filter / Multiple filter The operation types “Single filter” and “Multiple filter” are used for dialog filters that have specific values and are displayed in combobox control.Chapter 5 – Defined Fields B. through a “SQL filter” defined field. Example of this operation can be found in the previous section. when users select a value. 119 | P a g e . It is used in reports or browsers.1) next to the textbox of the calculation formula to enter the values that will populate the combobox through the window of the Figure B6.2 Figure B6.2. Use the button (Figure B6.7 Function This operation is used for creating functions that can be used from other defined fields. The field will be displayed in dialog filters as in Figure B6.3 B.1 Figure B6. Objects G. Tables D. String Lists E. Database Views F. Basics B. Fields C. Virtual Tables H. Report Objects 120 | P a g e .Chapter 6 – Database Designer CHAPTER 6 Database Designer A. Figure A1 – SoftOne Designer Designer entries can be merged in one designer project by inheriting others (Used Projects). database views. Basics The application allows you to configure the structure of the database by entering new fields in tables. defined by the user. objects etc. virtual tables. description and version. objects and string lists.Designer with Used Projects 121 | P a g e . Each SoftOne designer entry is a different Design Project with a specific name. Figure A1 shows an example of various design projects. creating new tables. Figure A2 . tables. inside the folder “Tools”. located under the “Report Tools” section menu.Chapter 6 – Database Designer A. Database structure is managed through SoftOne Designer tool. each of which has its own fields. The option of creating many design projects can be very helpful when deploying customer projects that involve different implementers and at the same time can also be used to generate a custom solution for exploitation (Figure A2). Figure A4 .Chapter 6 – Database Designer Whenever there are changes in SoftOne designer that affect the database structure (new fields. through SoftOne sync tool. upon your next login to the application.Sync database message box 122 | P a g e . views) the database must be synchronized. Synchronization applies only upon manual change of the version of each designer project (Figure A3). The different versions of the design projects will be displayed in a question message asking you to accept the synchronization. tables. Figure A3 .Designer version change After changing the version and saving an entry of SoftOne designer you will be requested to synchronize. In the example of figure A4 you can see that the version of the custom designer named DEMO has changed from 2 to 3. stating also the time of execution of the synchronization (e. You can state the manufacturer’s name. views. Figure A5 . which path is displayed under the window "Identity" (System settings – button Identity).Custom solution publication 123 | P a g e .g. log").Chapter 6 – Database Designer The synchronization file is saved inside the «Log» folder of the "Program Profile Directory". database views. a date restriction use (Demo) or a SoftOne Serial Number restriction use and of course it can be password protected. "S1Training_ 20110426-132848.) can create a comprehensive Solution. or constraints in the database. All the above suggest that any custom solution you create can be copyrighted (Figure A5). The filename of the log file is named after the connection file XCO. Design projects can be exported independently throughout the Custom Administration tool as cst files. This file contains also possible errors that prevented the creation of tables. which can be also enriched with additional publication information. Multiple selection and export of design projects and other cst files (browsers. etc. Figure B1 shows an example of adding fields inside table MTRL using different data types. Figure B2 124 | P a g e . even SoftOne tables.g. PRSN). Figure B1 Fields with data type "float" can display the same number of decimal places as the ones you have picked to display inside the company’s properties (same as Numeric TextBox Control) (Figure B2). Field names should always begin with the prefix CCC. In order to create a new field you have to select the desired table (e. move to the last field and then use the down arrow of the keyboard. which will bring you up a new empty field record. That ensures that these fields will never be “touched” when upgrading to newer SoftOne versions.Chapter 6 – Database Designer B. Fields Inside SoftOne designer entries you can create new fields in any table of the database. Editor Sets the field editor. Hidden field Indicates whether the field is displayed or not.147.147. Always included in select statement Indicates that the field will always appear in select clause statement.060 bytes per row (SQL Server).g.2 Field Properties Field properties (Figure B4) are summarized in the table below: PROPERTY DESCRIPTION Size Sets the size of the field (Varchar data type).147. null values are not permitted).647 bytes B. Users cannot change it at runtime.647 4 bytes Float -1. Fields can be displayed with different controls depending on the provided editors.483. See editors.768 32. Data Type Min Max Storage Size Small Integer -32. Users can change it at runtime. For fields displayed in datagrids or browsers. Always keep in mind that a table can contain a maximum of 8.483.647 4 bytes DateTime 1753/01/01 9999/12/31 8 bytes Varchar 0 chars 8000 chars 2 bytes + number of chars Text 0 chars 2. The following table lists the available data types and their specifications.147. Analysis of all the available Editors is provided in the section Editors in Chapter "Screen Forms".767 2 bytes Integer -2. Figure B4 125 | P a g e .Chapter 6 – Database Designer B. Title Sets the title of the field Required Default Value Specifies whether a value for the field is required for the record to be saved (e. Sets a default value to the field that applies to new entries.647 chars 4 bytes + number of chars Image 0 bytes 2.79E + 308 4 bytes (24 digits) Auto-inc Integer 1 2.648 2.483.1 Field Data Types Fields in database tables require a name and a data type. Size (in characters) Sets the width size of the field.483.147.483. Forced Value Indicates the forced value applied to a field.79E + 308 1. Views" section Editors Attributes. To create a Search by field select as data type "Integer". All commands applicable to table search using the Editor are detailed in "Chapter 1 . Figure B3 Figure B4 Figure B5 126 | P a g e . while fields that draw data from regular tables. When selecting a table you can apply other commands such as.Chapter 6 – Database Designer B. are displayed such as the one in Figure B5. Then enter the table name in the Search by(Editor) card. to filter the entries or to return a different field from the key field of the table. for example. The fields that draw data from the memory table are displayed in views such as the one in Figure B4.3 Editor Fields Search by fields draw data from other tables of the application that is they are used as links to tables and store data from a field of the table to which the connection is to be made. Figure B3 shows an example of connecting field to table CCCFAMLSTAT to table FAMLSTAT in order to search data from this table. "Small Integer" or "Alphanumeric" according to the key of the table from which data is to be drawn or the data type you wish to save in your field. Figure C1 Figure C2 127 | P a g e . 1. e.1 Basic Data The properties you can define through this tab are the following: Name Name of the table Title Title / caption of the table Primary key Table primary key fields divided by semicolon Process with This property has different uses depending on the type of the table you want to create. Tables New tables can be created in database through SoftOne designer tool. C.t.2. The fields that are linked to tables of this type (using editor command) are displayed through “Selector list” control as in figure C2. Table names must always start with the prefix CCC. while the fields inside custom tables can be created using any name.Chapter 6 – Database Designer C. The redirection object defined will be displayed when users click on the caption of fields that are linked to this table.1 Table properties Table properties can be defined through the tabs displayed on the top of the table design tool. C. It also provides a different use when creating database views. by using the option “New – Table” from the right click pop up menu. This property is the same as the H[] editor attribute which is defined in field editors. Name of the redirection object This is used when you want to create tables that will be linked through fields from other tables.c.). which shortens the process of using internal commands in controls (editors. It is advisable when creating a new table to use the same table name and primary key field name in order to maintain the same logic with SoftOne tables. Fields divided by semicolons that define the locate record ID This is usually used in database views that are displayed in objects and have only a browser view and not a form view.Chapter 6 – Database Designer 2. This means that you can either add them as columns of the browser or enable the field property “Always included in select statement”. 128 | P a g e . #Field or id of the redirection object. Analysis of this type of tables can be found in the next sections.g. It is used for tables that don’t have a lot of data. Figure C3 Figure C4 3.FINDOC.Myfield Note: All the fields defined in the above statement have to appear in the select clause of the database view. This means that if for example you have created a custom object by the id 20000 and you want to make a redirection from a database view to this object by using as locate record the field “Myfield” you should enter the statement: #20000. the database view VMTRSTAT uses the statement: #SOSOURCE+SOREDIR. Command $ It is used for tables in memory and defines that the data of these tables will be processed through a simple edit list control (datagrid). Figure C3 displays the configuration of table MTRMANFCTR which is processed through edit list (Figure C4). For example.MTRTRN SOSOURCE and SOREDIR are fields inside the database view that define the redirection object id(e. 1351+10000 = 11351 which is RETAILDOC[Retail documents]. 1251+0=1251 which is PURDOC [Purchase documents]). FINDOC and MTRTRN are also fields of the database view and define the record that the user will be redirected. When users double click on a record/line of the browser then the they are redirected to the object and record defined from the above statement. Table in memory This option defines that the data of this table will be loaded in memory. Displays the linked tables in object browsers.… XU XI Creates non-unique. XI_KEYNAME = FIELDNAME1. non-clustered index. XC_KEYNAME =(FIELD1>100) AND (FIELD1<500) Foreign key with Cascade Delete. XR Logical/Internal Limitation: Creates foreign key in objects XR Logical/Internal Limitation: Cascade Delete in objects Example: Cascade delete customer branches. non-clustered index.Chapter 6 – Database Designer C. XD_CHILDTABLE_HEADERTABLE XT Logical/Internal Limitation: Defines links to tables. If a record of the parent table is deleted then the corresponding records of the child table are also deleted. XU_KEYNAME = FIELD1.CODE XF_TABLE_FOREIGNKEY = REFERENCETABLE or when fields of both tables and foreign table have the same name XF_TABLE_FOREIGNKEY XF Creates a foreign key to a table. FIELDNAME2. Example: Restrict values entered to FIELD1 (Values permitted are between 100 to 500). Creates a unique.1 Limitation DB/Logical Inside the textbox of this tab you define the constraints of the table using following commands.2. Used when you want to prevent duplicate values. FIELD2. Example 1: Table TRDR Command: XF_TRDR_SALESMAN = PRSN ConstraintName: XF_TRDR_SALESMAN Foreign Key: SALESMAN Reference Table: PRSN Example 2: Define that the field COUNTRY of the table Bank has a foreign key to the primary key field COUNTRY of the table XF_BANK_COUNTRY XC_KEYNAME = (FIELDNAME>=value) XC XD Check constrain Sets restrictions on data added to the table. Used for creating indexes. XU_TRDBRANCH_CODE=TRDR. XD_TRDBRANCH_TRDR XT_TABLEFIELD_OBJECT Example: Item EXTRA fields (Link field) XT_MTRL_ITEEXTRA XR_TABLE_FIELDNAME = OBJECT Example: Relative item XR_MTRL_RELITEM = ITEM XR_CHILDTABLE_PARENTTABLE Example: Item lines in documents XR_MTRLINES_FINDOC 129 | P a g e . Used in child tables.… XP_KEYNAME (KEYNAME is the name of the primary key) Example: Unique customer branch codes. The fields of the primary key are the ones entered in the textbox “Primary key” of the tab “Basic Data”. Database Limitations / Logical Limitations Command Process Analysis Syntax / Example XP Defines the name of primary key of the table. Note: The selector list works properly only when you have valid display sizes in all the fields you define as selector fields. Figure C5 Figure C6 130 | P a g e . This means that except for the sizes you have to define inside this datagrid you also have to enter values in the display size property of the fields.1 Selector Fields In the datagrid of this tab you enter the columns that will be displayed in the selector list of fields linked to this table(through editor command).Chapter 6 – Database Designer C.2. Chapter 6 – Database Designer C.2 Tables in memory C.2.1 Design Memory Table Tables in memory are displayed as combo boxes in fields linked to them. Their data are also loaded into memory during application log in, which means that they shouldn’t have many records. The steps of creating a table in memory are described below:  Right click the left pane of SoftOne designer and select “New table” from the pop up menu.  Enter the name and title of the table.  Enter the primary keys separated by semicolons (;).  Enter the command $ in the textbox “Process with”.  Add the fields and select the option "Required" for the primary key fields (Figure C7). Figure C7  Enter values in property “Default Value” for the fields you want display default values when entering new records (Figure C8). Figure C8 131 | P a g e Chapter 6 – Database Designer  Enter the display size of the fields in order to be displayed properly in the edit list control.  Enter the name of the primary key in the textbox of the tab “Limitation DB/Logical” (Figure C9). Figure C9  In the datagrid of the tab “Selector fields” enter the columns and the size that will be displayed in the selector list of fields linked to this table (Figure C10). Figure C10 132 | P a g e Chapter 6 – Database Designer C.2.2 Display Table in Menu Memory tables can be displayed in menus by creating a menu job and selecting them through the button next to the textbox “Action/File” (Figure C11).  Right click menu and select “New Job” from the popup menu  Job type: Table process  Action/File: Enter the command $ following the table name  Job title: The caption you wish to appear in the menu When you execute the above job the edit list of Figure C12 will be displayed, that allows you to process the data of the table. After completing the above process save the menu as a user menu, or add the specific job in a classic menu for later use. Figure C11 Figure C12 133 | P a g e Chapter 6 – Database Designer C.2.3 Link field to table Inside the configuration window of an object form, select a numeric field and enter the name of the table in the editor property (Figure C13). Figure C13 In run mode the field will be displayed in the object form as in Figure C14. Figure C14 134 | P a g e Chapter 6 – Database Designer C.3 Child Tables Child tables are tables that are displayed through datagrid control inside object forms. These tables “act” also as detail tables in the objects’ parent tables. That means that the relationship between child and parent tables is “One to many”. C.3.1 Design Child Table The design of a child table uses the same principles as the design of any table, such as a table in memory. The only difference is that you have to add a field that will link this table to the parent table, which in most cases has the name of the parent table. A typical example of parent – child tables are the tables FINDOC(Documents) – MTRLINES (Document lines) where the link field is FINDOC (primary key in table FINDOC). The first step after entering the fields of the table is to define the primary key fields. In this case the primary keys are, additionally to the table ID, the field of the parent table. This field will be used to store the corresponding id field of the parent table. Of course these fields are mandatory, so you have to enable the property option “Required”. (Figure C15) Figure C15 135 | P a g e Chapter 6 – Database Designer C.3.2 Display in object To display a detail table in an object form follow the steps Open the design mode of the object (e.g. CCCMYOBJECT) where you wish to display the table. Click on the “Configuration” button (Figure C16) Figure C16 In the tab "User defined tables" select the child table through the button arrow "New table"(Figure C17). Figure C17 Select the table from the left panel and then enter in the locate statement property enter the field expression that will be used to locate the data of the table. The locate statement expression may contain parent fields and specific values. Syntax is: ChildField1;ChildField2;ChildField3=:ParentField1;:ParentField2;Value1 If the field of the child table used to locate data has the same name as the parent table field, then you can just enter the name of the field (Figure C18). Figure C18 136 | P a g e Chapter 6 – Database Designer Select the fields that are mentioned in the locate statement and enter the appropriate values in the “Forced value” property so that they meet the expression of the locate statement. Right-click and create a new datagrid and then drag and drop the fields you want to be displayed (Figure C20) Figure C20 137 | P a g e . Figure C19 The last step is to display the table in the form using a datagrid control. Figure C19 has an example of the forced value of the field CCCMYTABLE which would be the value of the field CCCMYTABLE of the parent table CCCMYTABLE. select a numeric field and enter the command $STRINGLISTNAME inside the Editor property (Figure D2). Gift.  Enter the name of the string list in the textbox “Name”. while those created inside an object can only be used in fields of the object. Design Create a string list using the following steps:  Right click the left panel of SoftOne Designer and select “New string list” from the pop up menu.Chapter 6 – Database Designer D. The ones that are created through SoftOne designer can be used in any numeric field of the application.". String Lists String Lists display a collection of keys and values. e. They also display only two fields and their data are loaded in memory.  In “Key” column. which displays the values "Normal. String lists can be created either from SoftOne designer or through the configuration window of an object form. enter the key codes and in column “Value” the values that will be displayed in the fields that will use this string list in their editor property (Figure D1). They are like dictionaries and can be used as editors to numeric fields providing fast lookups. The main difference of tables and string lists is that string list data cannot change from a user during runtime.t. An example of a field using string list is the Type field in the Items object. Field will be displayed as in Figure D3. Figure D1 Display in field Inside the Configuration window of an object. Figure E2 Figure E3 138 | P a g e .c. Chapter 6 – Database Designer E. the database view VMTRSTAT uses the statement: #SOSOURCE+SOREDIR. 1351+10000 = 11351 which is RETAILDOC[Retail documents]. 1251+0=1251 which is PURDOC [Purchase documents]).g.1 Create Database View Create a database view using the following steps:  Right click the left panel of SoftOne Designer and select “New database view” from the pop up menu. E. This means that if for example you want to make a redirection to a custom object that has the id 20000 by using as locate record the field “Myfield” you should enter the statement: #20000. to create the fields. or from another database)  In object form datagrids in order to display entries from various tables. This means that when users double click on a record/line of the browser they can be redirected to a specific object and record. If you need to create database views that redirect to certain objects then you have to enter the object id and key fields inside the “Process with” property of the database view.MTRTRN SOSOURCE and SOREDIR are fields inside the database view that define the redirection object id(e. 139 | P a g e . displaying data from various tables (whether from the application. For example. etc.Myfield Note: All the fields defined in the “Process with” property have to appear in the select clause of the database view.  Finally.FINDOC. E. You can also define an object redirection from browsers. editors. This means that you can either add them as columns of the browser or enable the field property “Always included in select statement”.  Configure fields by entering titles.  In the textbox "Primary Key" insert the field that you wish the Database View to return.2 Database view redirection Database views can be used in objects in order to display data in browsers and pivot tables.  As object in order to display data in browsers. Database Views Database Views are stored in the database and can be used in the following cases:  As Editors in lookup fields. or the object id and the fields that will be used to locate a record of an object. After completing the creation of the database view the database must be synchronized. FINDOC and MTRTRN are also fields of the database view and define the record that the user will be redirected. in Tab "Selector fields" insert the fields that you wish to display if the specific database view will be used as lookup table in field editor.  Inside the textbox of the tab SQL enter the sql statement and then click on the button "Create Fields". TRDR.0) AS LTURNOVR.COMPANY=A2.SODTYPE=13 and click on the button “Create Fields” (Figure E1) Figure E1 Enter titles in the fields and add the selector fields as in Figure E2.TRDFINDATA A2 WHERE A1. $NVL(A2. Save the changes and synchronize the database. Enter the sql statement: SELECT A1. Create a database view named CCCViewCustomer with primary key TRDR.0) AS LBAL. Figure E2 140 | P a g e .3.LBAL.1 Use in lookup fields (Editor) Create a database view that will be used as lookup list in field customer (TRDR) of sales documents. A1.NAME. The lookup list will display the code and the names of customers.ISACTIVE FROM TRDR A1.TRDR AND A1.ISPROSP. A1.LTURNOVR. A1. A1.COMPANY AND A1. A1.TRDR=A2. as well as some financial data from table TRDFINADATA and return the id (TRDR) of the selected customer.COMPANY. $NVL(A2.Chapter 6 – Database Designer E.CODE.3 Database View Examples E. (Figure E3) Figure E3 The field will be displayed at runtime as in Figure E4. select the Customer field and enter the name of the database view “CCCViewCustomer” in the Editor property. Figure E4 141 | P a g e .Chapter 6 – Database Designer In sales documents configuration window. TRDR=B. add the view by clicking on the arrow next to "New Table" and set the locate statement as in Figure E6 (TRDR=:TRDR. This example displays a datagrid with the crm actions in the customers object. B.SOACTION.TRDR FROM SOACTION A LEFT OUTER JOIN TRDR B ON A. Enter the sql statement: SELECT A.TRDR). Inside customer form configuration window.2 Use in Datagrids Display CRM actions of customer.3.TRDR and click on “Create Fields” (Figure E5) Figure E5 Enter titles in the fields.Chapter 6 – Database Designer E. save the changes and synchronize the database. Figure E6 142 | P a g e . Create a database view named CCCTRDRSOACTION with primary key TRDR. Chapter 6 – Database Designer In order to use fields among the fields of the actions table. The datagrid will be displayed in the form as in Figure E8. Figure E7 Create a new tab and a new datagrid and drag and drop fields from the action table of the database view. Notice that the table is linked to the field after you accept the changes and reopen “Configuration”. enter SOACTION in the field editor (Figure E7). Figure E8 143 | P a g e . Browsers. Figure F1. database views e.) can be inserted through drag and drop as long as you lock the object.1 Figure F1. as long as they are designed through SoftOne designer.c.c. Sales documents.t.t.). database views. virtual tables. F. can be processed. Object names must have the prefix CCC. e.c. e. which means that they include all the tools that can be found in an object (EDA. Objects Form Objects are used for creating a user interface where data from tables.2). Printout Forms. Imports.c. e.1).Chapter 6 – Database Designer F.). Forms.2 144 | P a g e . database views. They function exactly as SoftOne objects (Customers. Database objects (tables.) can be used inside form objects.t.t.t. using the toolbar button “Lock Tree” (Figure F1.1 Create Objects Objects are created through the right click option “New – Object” of SoftOne Designer (Figure F1. e. Database objects (tables.c. t.15. Ref. Helpful when you want to create only one interface (object) and use it for different record types.  Caption Name that will be displayed in the default object form.21) and the different objects created in the menu have the command AREAS. every new record adds the value of the menu job command (13) in the field SODTYPE. Forms.xxx .) o Edit List Creates an edit list object that uses a single toolbar only. EDA. The Domain Info property of the AREAS object is SODTYPE=SODTYPE(12. For example. there is only one object created for table AREAS. This ID can also be used in hyperlink redirection.16.g.ObjectID. suppliers (SODTYPE=12).13. but there are different menu jobs for customers (SODTYPE=13). where xxx is the SODTYPE value.c. Object Properties Object properties are the following (Figure F2. That is.Obj.  Domain Info Declares the field whose value is used to distinguish between different object records. Customer Parameters). then your object will be listed in the relative jobs of items. Object ids (SOSOURCE & SODTYPE) can be found in Annex SODTYPE and SOSOURCE tables. for customer areas the menu job command is AREAS.c. For example if you enter the number 51.Chapter 6 – Database Designer F2. e.g.t.20. as long as you have used it inside the table’s “Process with” property. For example printout forms that refer to this object are created through the menu command Templates.  Object Type (mandatory) o Master Form Creates a form object that uses all the available tools (Browsers.1): Figure F2. that is defined in Domain Info property of the main object.Id Defines the reference object that will display your object in its “Relative jobs”. e. 145 | P a g e .13. Moreover. Customer Professional categories) or in a single record form using the command EDITOPTIONS=ONEROW (e.  Object ID Declares the ID of the object that can be used from as a reference from other tools. Data are displayed either in a datagrid (e.1  Object Name (mandatory) Object name with CCC prefix. Sales Statistics) AUTOLOCATE = xxx Locates the record with id = xxx CUSTOMBUFEXCLUDE=CCCFIELD1.NODELETE Prohibits save & delete EDITOPTIONS = READONLY Disables edit in object fields EDITOPTIONS = NOBROWSER Hides toolbar button "Browser" EDITOPTIONS = ONEROW The object displays only one record BROWSERONLY = 1 Displays object only as a browser (e.Chapter 6 – Database Designer  Object Type Internal use  In Menu Internal use  Parameters The following table displays the various commands that can be used as Parameters (Figure 2.g. Note: These commands can also be used inside the “General parameters” tab of “Configuration” window inside designed forms.2 146 | P a g e . Object Parameters Command Operation EDITOPTIONS = NOINSERT Prohibits saving a new entry (Hides toolbar button “New”) EDITOPTIONS = NODELETE Prohibits entry delete (Hides toolbar button “Delete”) EDITOPTIONS = NOINSERT. Copy from last excludes the SoftOne fields defined Figure F2.2).S1FIELD2.CCCFIELD2. Copy from last excludes the custom fields defined BUFEXCLUDE=S1FIELD1. 2). if the name of the parent table field is TRDR and the linked child field name is REFOBJID.c.t.3 Table Properties Database objects (tables. db views. You can only enter the name of the linked field.g.t. o Dialog: Use in Dialog objects (e. o Report: Use in Report objects (e.CHFIELD4=:PRFIELD1.Chapter 6 – Database Designer F.) used in objects have the following properties (Figure F3. Customer Balance report).1): Figure F3. If you need to use other fields for locating a record then you have to define them separated with semicolons (Figure F3.Value1. e. Customers reupdate) or filter tables in Report objects (e. Field data of other tables are defined using a colon : following the name of the field (:FIELD).1  Caption Auto filled with the title of the table  Original Name Auto filled with name of the table  Filled with Data from Indicates the way table records are populated  o SQL: Use in Form objects (e.). Customer Balance report). if its name is the same in both tables (parent – child). then you have to enter REFOBJID=:TRDR.c. For example.g. Sales documents. Customers.:PRFIELD2.g. The main syntax for the locate statement is: CHFIELD1.CHFIELD2.Value2 147 | P a g e .CHFIELD3.g. e. Locate Defines the fields that will be used to locate the data of this table according to the parent table. 3  Primary Key Auto filled with the primary keys of the selected table  Master Table Used in second child tables. 148 | P a g e . Index field is MTRLINES (exists in both tables so there is no need to enter MTRLINES=:MTRLINES).2  Index Fields Used in second child tables (child tables linked to child tables). Indicates the fields of the master child table that define the child to child relationship.3 shows the table SNLINES which is child table to MTRLINES (child table of the parent table FINDOC). The example of Figure 3.  Master Fields Used in second child tables.Chapter 6 – Database Designer Figure F3. Indicates the name of the master child table that will be used for locating the records of the second child table. Figure F3. Indicates the fields that define the child to child relationship.  Create the primary key field of the child table using any name and add the command :ParentTableName. This way your field will automatically be filled with an auto increment number that is created through an internal SoftOne procedure.5 show the primary key field MTRLINES of the child table MTRLINES that uses the above command in the object Sales documents.4 and F. For example.LOCKID in its Forced Value property.3.4 Figure F3. Figure F3. General Instruction for child tables It’s better not to use identity fields in child tables because they are processed faster from the database.3. while the table “MTRLINES” has a “one to many” relationship.  Auto increment Assignments Internal use  Sort (Check=Asc/Uncheck=Desc) Indicates the fields that will be used by default for sorting the records of the object.Chapter 6 – Database Designer  Display Level Internal use  Master / Detail Relationship Indicates the master detail relationship.5 149 | P a g e . in Sales documents the table MTRDOC has “one to one” relationship with table FINDOC. Figures F. In order to create a unique key that is not identity use the following:  Create a field named LOCKID in your parent table. SYS.  Display size Sets the width size of the field. Other table field values are defined through the syntax :TABLENAME.C) can be used in order to define the use of the company defaults for decimal places.1): Figure F4.Q.  Forced Value Indicates the forced value applied to the field. for use in datagrids or edit list objects.FIELD. System parameter values are defined through the syntax :X.FIELD.PARAMNAME  Default Value Indicates the default value applied to the field. 150 | P a g e . Specific commands (P. See Editor Commands. System parameter values are defined through the syntax :X.  Decimals Indicates the number of the decimal places.  Hidden field If enabled then the field will not appear in the field list of the object in Browsers and Forms. Other table field values are defined through the syntax :TABLENAME.Chapter 6 – Database Designer F.%.1  Caption Sets the title of the field.PARAMNAME  Editor Defines how the field is populated.SYS.V.4 Field Properties Table fields have the following properties (Figure F4.  Display Level Internal use  Read Only Specifies whether the contents of the field can change at runtime by users  Required Specifies whether a value for the field is required for the record to be saved. 1 Calculated fields created in Report Objects can be used for assigning values to other fields. If the first character of the command is ^ then the calculation will take place after totals are calculated.Chapter 6 – Database Designer F.2 151 | P a g e .SUM_LCREDIT. SmallInt. there is an option of creating calculated (virtual) fields that can be populated through form script code (JavaScript or VBscript). Create a field and then add the following  Field Type: Indicates the type of the field (Varchar. Figure F5. Then enter the preferred calculation in the Formula property.2 the field CLREMAIN will be calculated after the calculation of the fields ACCTRN.1). In the example of Figure F5.SUM_LDEBIT and ACCTRN. through the Formula property. Date. Double. Integer)  Size: Sets the size of the field  Caption: Sets the title of the field  Formula: Refers to Report Objects only Enable the checkbox Formula. Figure F5. Calculated fields are created through right click on tables of the object and the selection of the option “Add calculated Field” (Figure F5.5 Calculated Fields Apart from the database fields. 2 links the field MTRL to the table LINEITEM. The example of Figure F6. This means that you can refer to a linked field through Form script code. Reference to the field CODE of the linked table LINEITEM is achieved through the use of CCCDVXREOP. Uniqueness is done by using different field names in linked tables: X_MCODE. NAME).1 Figure F6. Another advantage of linked tables is that if you rename the selected fields adding the prefix X_ then you can refer to these fields as if they were database fields. click on the “Lock Tree” button.2. X_MNAME for table LINEITEM and X_TCODE.2 152 | P a g e . Figure F6.Chapter 6 – Database Designer F. by entering only the name of the master table and the name of the linked field (TableName. This is why except for the editor property you need also to use linked tables inside your objects. Then. drag a table from the left panel of SoftOne designer and drop it into the property “Link To Table”. but these fields are not available when designing the default browsers or forms inside an object. so their names must be unique. Check any of the available fields of the table as in Figure F6.X_Fieldname). Fields are linked to tables through the right click option “Add Link” (Figure F6. This gives you the ability to use any field of the linked tables inside designed forms or browsers.X_MCODE.6 Linked Tables Tables are linked to fields through the editor property. that the linked tables LINEITEM and TRDR use fields with same names (CODE.1). X_TNAME for table TRDR. Note also. for example MyMasterBand (Figure F7.Chapter 6 – Database Designer F.7 Browsers Design Objects give you the option of designing default browsers. Fields can be added through drag and drop. Use the button “Lock Tree” when needed and follow the steps below to create a default browser:  Right click the “Report” node and select “Add Band”  Give a name to the band. which cannot be deleted or updated at runtime.1 153 | P a g e .  Enter the fields (columns) that the browser will display at runtime in the tab “Band Fields”  Enter the fields that will be used for sorting in the tab “Sort Order”  Enter the fields that will be used for grouping in the tab “Grouping”  Finally. for the object to work properly.  “Secondary Band Tables” is used for browsers displaying master detail tables.1)  Select a table of your object and drag & drop it into the property “Primary Band Table”. enter the dialog filter fields in the tab “Questions”. Note that default browsers must always have a Primary Band Table. For each field you may also fill the following” o Field Name: Name of the field. o From Caption: Title that will be displayed in the dialog textbox “From” o Default From Value: Default value that will be displayed in the dialog textbox “From” o To Caption: Title that will be displayed in the dialog textbox “To” o Default To Value: Default value that will be displayed in the dialog textbox “To” o Forced Value: Defines the forced value of the field Figure F7. Figure F8.1 Add Datagrid: Adds a new datagrid. Figure F8.Chapter 6 – Database Designer F.2 154 | P a g e . Fields are added through drag and drop.8 Forms Design Default forms can be designed using the toolbar buttons or the right click options.1). in the textbox “Fields with Totals” (Figure F8. The commands are the same as in internal objects form design (Figure F8. There is also the option of adding a Totals line at the end of the datagrid.2). To enable this option you only need to enter the field names that will be used in the Totals line. This is only available in datagrids created in custom objects. 2). Add Panel: Adds a new panel. you can return to object design through the close button in the upper right corner (Figure F8. Figure F8. Properties are the same as in section Screen Forms – SubForms.Chapter 6 – Database Designer Add Tab: Adds a new tab. Properties are the same as in section Screen Forms – String Lists.4).3 Fields can be added in a form control as long as you have enabled the toolbar button “Lock Tree”. After the preview. This code is added through the use of the node “SCRIPT” (Figure F8. Properties are the same as in section Screen Forms – Panels. Delete: Deletes the selected control. Add Image: Adds a new image. Inside the default form you can add a form script (JavaScript or VBscript) in the same way you add it through “Configuration” button in designed forms. Add StringList: Adds a new string list. Properties are the same as in section Screen Forms – Image. Add SubForm: Adds a new subform. Properties are the same as in section Screen Forms .4 155 | P a g e . Add Memo TextBox: Adds a new memo text box. Figure F8. Check duplicates: Checks for controls that use the same name. The toolbar button “Test Form” lets you preview the form you have created.Tabs . Properties are the same as in section Screen Forms – Memo TextBox. 9 Display Object in Menu Objects can be displayed in menus as jobs through the following steps:  Save changes in SoftOne Designer. you can manually select “Object process” as Job type.  Select your object from the list. at runtime.  Synchronize the database if needed.1 Figure F9.2. The object. Notice that all the tools are available.1). Alternatively. enter the name of the object in “Action/File” and then the name of the job.  Click on the button next to the textbox “Action/File” (Figure F9.  Create a new job in the menu from the right click option “New job”. Objects design do not need synchronization.2 156 | P a g e .Chapter 6 – Database Designer F. will be displayed as in Figure F9. Figure F9. ObjectID”.  In “Action/File” enter the command “TEMPLATES. The printout form will be displayed as in Figure F10.Chapter 6 – Database Designer F.1 Figure F10.2 157 | P a g e .10 Printout Forms Printout forms that use the custom objects you have created through SoftOne designer are created with the following steps:  Create a new job in the menu and select “Object process” as Job type.2. Figure F10. where ObjectID is the unique ID of your object (Figure F10.  Enter a job title and execute the job.1). allowing you to select from any of the available table fields that have been defined in your object. Then.  Enter the caption of the object.1  Create a new Band under the Report node.  Enter CCCOBJVEHICLES in the Object Name and an id (e.  Drag and drop fields from the table in the “Band Fields” tab so as to be displayed as columns in the default browser (Figure F11. Vehicles (Figure F11. Figure F11. Figure F11.g.1 Create an Object using a custom table The following example uses a custom table “Vehicles” (CCCVehicles) to create an object (CCCOBJVEHICLES).11. drag the custom table CCCVEHICLES from the left panel and drop it under the Object Properties.  Create the Object through the right click option in Database Designer. 20001) in Object ID.2).1). Drag and drop the table CCCVEHICLES in the “Primary Band Table” property.11 Object Examples F.2 158 | P a g e .Chapter 6 – Database Designer F.  Chapter 6 – Database Designer Create a new Panel under the Form node and add fields in the “Available Fields” property.  Create Memo textboxes for text fields (Figure F11.4 159 | P a g e .4) Figure F11.3 Figure F11. create a new job to display the object in the menu (Figure F11.3).  Finally. then you have to do the following: Select the Database View from the SoftOne design and add the command #SODTYPE. Figure F11. Figure F11. Field TRDR will be used for locating a specific record.  Create the Object and enter the name CCCOBJCUSTFINDATA  Insert the database view CCCViewCustomer under the Object Properties  In Parameters textbox.5).5 If you need to locate to a specific object when users double click on a browser record.6 160 | P a g e . according to the value of TRDR selected through the browser.  Follow the steps of the previous example to complete the object.2 Create an Object using database view The following example uses the custom database view “CCCViewCustomer” created in the section Database View Examples to create an object (CCCOBJCUSTFINDATA).11. This command will use the value of the field SODTYPE to identify and open the object(e.6). 12 is Suppliers). 13 is Customers.Chapter 6 – Database Designer F. that displays the object in browser mode only.g.TRDR in the "Process with" property (Figure F11. enter the command BROWSERONLY = 1 (Figure F11. Figure F11. Alternatively. Figure F11. Chapter 6 – Database Designer Add the field SODTYPE in the select clause of the sql query.7).7  Select the field and enable the property “Always included in sql statement” (Figure F11. you can add the SODTYPE field in the browser columns of your object.7 161 | P a g e .  Enter manually the field and its data type in the fields table (Figure F11. through the SQL Tab.8). delete or add new records. Figure G1  After synchronizing the database. as tables (through Configuration window). G. to link the field with Items.Chapter 6 – Database Designer G. datagrids) through drag and drop. MTRL. Fields are added as in tables. Virtual Tables Virtual Tables are cached memory tables (datasets). The main difference with database views is that Virtual Tables can be populated at runtime and are also editable.t. Changes are saved in Item sets. That is. e. G.  Enter ITEM in the editor property of the field MTRL. in Report Objects and in Dialog Objects.1 Design Virtual Table Virtual tables are created through the right click option “New – Virtual Table” of SoftOne Designer. through the “User defined tables” tab.  Create a Virtual Table by right-clicking SoftOne Designer  Insert the fields ITELINESMTRL.2 Virtual Table Example The following example uses a virtual table in sales documents that displays the lines of Item sets and provides the user the ability to edit. QTY as in Figure G1. open the sales documents object in design mode. Virtual Tables are inserted in form.g.  Create a new datagrid in the form and add the columns of the Virtual Table as in Figure G2.). you can use all the properties (Editors. that their fields are defined in SoftOne designer. They are populated through script code and their columns can be displayed in form controls (e. Default values.  Field QTY will be used to display the item sets quantities.c. while database views are populated through the data retrieved from the views of the database. Figure G2 162 | P a g e .  Use the configuration window to add the virtual table. They are populated through script code and can be displayed in datagrids. which populates the virtual table with the lines of the item set. Figure G4 163 | P a g e . enter the code shown in Figure G4. which Locates the Object of Item Sets.SETPROPERTY('MERGECHANGELOG'. 'True'). deletes and re-enters all lines of the Set based on the lines of the Virtual Table of the sales documents. It also uses the command X. Figure G3 In order to update the Item sets object with user changes. Chapter 6 – Database Designer In the tab “Script” of the configuration window enter the code shown in Figure G3. to save the changes and deactivate the “Save” button. H. In Report objects. caption. (Figure H1. virtual tables or view tables. Form is used for dialog filters. Select “Report” in the “Job Type” property of the object. Their difference with the designed reports is that is possible to change at runtime column width. Additionally you have to add the following commands in the object parameters: CODE=SoScriptCodeClt SCRIPTNAME=MyScript.Chapter 6 – Database Designer H.1) Figure H1 Use a virtual table for the dialog filters and select “Dialog” in its “Filled with Data from” property (Figure H2). Figure H2 164 | P a g e . If you use virtual tables then they must be populated through form script. Create a new Report Object through the right click option of SoftOne Designer. while Report displays the columns. Report Objects Report Objects are used to create dynamic reports. depending on the filters. etc.1 Design Report Object Reports using Report Objects are designed using database tables. where MyScript stands for the script that will be used for displaying the columns of the report. The initial value of the field can also be defined. You don’t have to fill in the Locate property in the tables that are used for report columns (Figure H3). Figure H3 Cumulative fields can also be defined inside the report using the prefix SUM_ followed by the name of the field.TOBO. through the “Forced Value” property. The Band Attributes are the following:  Numbering: Auto increment number for each line of the report  Page Break: Change page on record  Offset: Number of empty characters  Column Headers: Displays the column headers (captions)  Bottom Line: Graphical line that separates records Figure H5 165 | P a g e . “Report” or “Function” property. in the “Primary Band Table” textbox (Figure H5).Chapter 6 – Database Designer For tables that will be used as report columns you have to use the “SQL”. In the example of Figure H4 the field SUM_DEBIT will display the cumulative sum of the field DEBIT and will also have as initial value the value of the field FBALDATA. Figure H4 Under the Report node of the object properties add a new band and insert the table. whose fields will be used as report columns. 7=HasSums.Params2. Master headers are declared using the following steps in the “Title” property of the first column: ColumnName@MasterName:NumberofColumns o ColumnName: Name of the table field o MasterName: Sets the name for the master (merged) column o NumberofCcolumns: Number of merged columns for the master column  Size: Sets the width size of the column  Debit / Credit: Calculates the debit / credit according to the value sign  Totals: Displays the totals for a field.Params3. 8=DebCred. Mandatory for fields used in cumulative fields. 9=Transfer) Params4: Property Value 166 | P a g e . 2=Width. Figure H6 The following function SetBandXProperty is used for changing the attributes of the field and has the following parameters: function SetBandXProperty(Params1.Params4) Params1: Band Params2: Band Caption Params3: Property Type (1=Caption.  Transfer Value: Totals will be printed in each page.Decimals. 4=Visible.Chapter 6 – Database Designer Fields entered in the tab “Band Fields” of the form node have the following properties (Figure H6):  Title: Column header caption. you must enter in Editor property the command $SODTYPE(W[13. depending on the filter selection. Module(SODTYPE) displaying only the customers and items.Chapter 6 – Database Designer H. which has the columns that will be displayed in the report (Figure H4). which will be used for the filters of the report.  Create a virtual table named CCCVTFILTERS. thus. the respective data are displayed. Figure H3  Create a virtual table named CCCVTDISPLAY. This report. that displays data from different sql queries. using the filter Sodtype (Module) and selecting either Customers or Items. uses one filter only so the table will have only one field.SOIMPORT SCRIPTNAME=CCCMTRLTRDR (the script that will be executed and create the report) 167 | P a g e .CODE. That is. with concurrent change of the captions and the number of columns. Figure H4  Create a Report Object and enter the parameter commands (Figure D5): CODE=SoScriptCodeClt SCRIPTSOURCE=SOIMPORT SOIMPORT=SOIMPORT.51]) (Figure H3).2 Report Object Example The following example creates a Report. which in this example executes different SQL queries to display columns according to the "Module" filter. Figure H5 Figure H6 Figure H7 168 | P a g e .  Chapter 6 – Database Designer Insert the SBSL script as in Figure H6. The commands used in CallPublished to change the attributes of the report grid are shown in Figure D7. Auto Login from Windows Shortcut B. Design Menu – Menu Jobs 169 | P a g e .Chapter 7 – Advanced Tools CHAPTER 7 Advanced Tools A. Maximum Entries per Module (Select Top) C. company and branch.Chapter 7 – Advanced Tools A. A.1 Create a Windows Shortcut Autologin works by adding the switch /XCO:xcopath to SoftOne application shortcut. [LOGIN] USERNAME=Admin PASSWORD=test COMPANY=1000 BRANCH=1001 170 | P a g e . You can copy the XCO file in the SoftOne folder and then add a command as in Figure A1. C:\Soft1\Xplorer. First you need to create a shortcut for SoftOne Xplorer.XCO" Figure A1 A. using only a Windows shortcut. company and branch.exe and then alter its “target” textbox by entering the path of a XCO file that includes the database login information. with a specific user.2 Configuration of XCO connection file The connection file XCO must have the section [LOGIN] and the following commands for enabling automatic login to a specific database with a specific user.exe /xco:"C:\Soft1\MyCompany. Auto Login from Windows Shortcut The application allows you to automatically login to a specific database. Chapter 7 – Advanced Tools A.3 XCO file Commands In XCO file you can also add other commands. MAXIMIZE=1. It is usually combined with the command that displays an object after autologin (e. without the Related jobs. NOTOOLBAR=0] A. It is usually used with the object you wish to display after login.4 EXEC Commands The following table displays all the EXEC commands that can be used when calling an object. e.c. FORM = FormName Opens the Form named “FormName”. CUSTOM = 0 Locks the Toolbar of the object. RELJOBS=0. hiding the form of the application (e. You can also use any of the EXEC commands when opening an object.History . FORCEFILTERS=CODE=000-00*? DISTRICT=Athens] FORCEVALUES = filedname1:fieldvalue1? filedname2:fieldvalue2 Opens the form of the object in a new entry with the values specified Example: CUSTOMER[AUTOEXEC=2.FORCEVALUES=TRDCATEGORY=3000?TRDBUSINESS=1] 171 | P a g e . AUTOEXEC = 1 Runs the browser using the default filters.t.g.g. COMMAND LINE PARAMS Command Operation BROWSERONLY = 1 Opens an Object displaying only its browser. in full screen. Items. NOTOOLBAR = 1 Hides the Toolbar of the given object. AUTOEXEC = 2 Opens an object in insert mode (new entry).g.Menu selection…) HIDEMENU =1 Hides the user menu. Sales. AUTOEXEC=2. EXEC=SALDOC) EXEC = Objectname Opens the “Objectname” object after autologin (e. HIDEBAR = 1 Hides the main toolbar (Back – Forward . Customers.). The following example opens the retail object in a new entry. Use this command when you want to prevent the user from selecting from the available browsers and forms. LIST = ListName Opens the Browser named “ListName”. PHOTO = MyPhoto Opens an Object in a insert mode with a specific template. EXEC=RETAILDOC) HIDEXPLORER = 1 Minimizes the application to Windows tray. Example: CUSTOMER[LIST=MyList. EXEC=RETAILDOC[FORM=RETAIL.AUTOEXEC=1. which affect the way SoftOne is displayed. STYLE: MODELESS Opens an Object in new Tab (not Modal) FORCEFILTERS = filedname1:fieldvalue1? filedname2:fieldvalue2 Runs the browser with the filters specified. RELJOBS = 0 Hides the Related jobs of the given object. When running the above job. You can also view the sql statement through the Sql Monitor tool. Figure B1 Figure B2 172 | P a g e . all the fields that link to this object (editors) including the browser of the object. This can improve the performance of the application as long as it is used in a proper way. Note that it displays only the number of record that you have set in the "Select Top" window. as well as the number of the entries that will be displayed (Figure B2). After completing the above process. This means that by adding the command “ObjectName = x) to this tool.Chapter 7 – Advanced Tools B. The above operation is done by executing the “SELECT TOP x” clause in the sql statements of the object primary table. B. inserting a new job. a blank window will be displayed. with job type "System Tools" and Command "ACMD:ACSELECTTOP" (Figure B1). you can check that is working fine by opening one of the objects defined inside the “Select top” tool and running its browser.1 How to use In order to use the tool "Select Top" you must call it from the menu. display only the first x rows that meet the condition filters. Maximum Entries per Module (Select Top) The tool "Select Top" can be used to specify the number of entries that can be displayed per object. where you can set the object to which "Select Top" will be applied. In order display all the records of the object. that will be displayed as a filter and provide the user the ability to select whether to display all the records or not. Insert the defined field in the filters of the browser and after the execution. while Figure B5 shows the sql statement that runs when you insert in filters the number 200 (displays the first 200 entries of the sales documents object). Figure B3 Figure B4 Figure B5 173 | P a g e . reports.Chapter 7 – Advanced Tools B. leave blank the field you created (“Max entries”). select “Question” in the column “Operation" and "Number" in column “Field type” (Figure B3). Figures B3 and B4 show an example of the design and appearance of this defined field in the sales documents. editors). However. you have insert in the browser or report a defined field. Create a defined field and type the command SELECTTOP in column “Name”. editor fields only). discussed in Section B. To achieve this.1.g. Note: Browsers or reports design having the "SELECTTOP" defined field can be used without necessarily using the tool "Select Top". there are a lot of times that you need to it only in a certain control(e.2 User define top entries Objects inserted in the tool "Select Top" affect all the controls that the object is displayed (browsers. the browser will be displayed as in Figure B4. forms.g.t. ITEM).c. Items) with specified browsers. C.  In “Job type” select "File Processing" for application objects or “Table processing” for memory tables. The tab “Properties” allows you to set if the job will open automatically on login and if the user is permitted to close the job. open in insert mode with specific template e.e.1 Create Job The easiest way to create a job with a specific browser and form is to open first the object in the desired browser and form and then drag n drop it from the tab to the left menu panel. Alternatively. You also have the ability to create a job by adding some extra commands such as locking the Toolbar. Design Menu – Menu Jobs The application allows you to configure the menu by creating jobs that open different objects (Sales documents. For memory tables add the symbol $ before the name of the table (e.Chapter 7 – Advanced Tools C. These jobs enable you to create custom group and user menus.  In “Order/File” type or select an object (i. Each group or user can set to open objects in specific browsers and views. do the following to create a job:  Right-click the menu panel and select "New Job" (Figure C1). templates etc. Job parameters are discussed in the next section. $DISTRICT). (Figure C2) Figure C1 Figure C2 174 | P a g e . Customers. SCRIPTNAME:MYSCRIPT Web Page It is used for opening a Webpage Other files It is used for opening any file on the computer File list It is used for opening a computer folder System Tools It is used to call Softone Tools Example Job that opens the SoftOne tool “SELECTTOP” ACMD:ACSELECTTOP Qlik View It is used to open a Qlik View file Dll Form It is used to call a form from a dll file Example Job that opens the form “MyMainForm” from “Mydll. Report It is used to call an application report Example Job that opens the designed report named “MYREPORT” REPORTGEN [LIST=MYREPORT] Batch Job It is used to Call Softone Script Example Job that opens the SoftOne script named “myscript” FORMIMPORT.g.dll” file in the application folder .Chapter 7 – Advanced Tools C.dll.2 Job Types The available job types are the following: File processing It is used to call an application object (e. $DISTRICT) Memory tables do not have browsers and forms.g. SALDOC) Table processing It is used to call a memory table (e.MyMainForm 175 | P a g e .Mydll. PHOTO = MyPhoto Opens an Object in an insert mode with a specific template. FORCEFILTERS=CODE=000-00*? DISTRICT=Athens] FORCEVALUES = filedname1:fieldvalue1? filedname2:fieldvalue2 Opens the form of the object in a new entry with the values specified Example: CUSTOMER[AUTOEXEC=2. CUSTOM = 0 Locks the Toolbar of the object.3 Menu job parameters – Menu Commands The following table shows the commands that can be used to display specific Views. Browsers and Properties of application Objects. AUTOEXEC = 2 Opens an object in insert mode (new entry). LIST = ListName Opens the Browser named “ListName”. AUTOEXEC = 1 Runs the browser using the default filters. Use this command when you want to prevent the user from selecting from the available browsers and forms.FORCEVALUES=TRDCATEGORY=3000?TRDBUSINESS=1] 176 | P a g e . STYLE: MODELESS Opens an Object in new Tab (not Modal) FORCEFILTERS = filedname1:fieldvalue1? filedname2:fieldvalue2 Runs the browser with the filters specified. RELJOBS = 0 Hides the Related jobs of the given object. Example: CUSTOMER[LIST=MyList.Chapter 7 – Advanced Tools C. NOTOOLBAR = 1 Hides the Toolbar of the given object.AUTOEXEC=1. through menus: COMMAND LINE PARAMS Command Operation BROWSERONLY = 1 Opens an Object displaying only its browser. FORM = FormName Opens the Form named “FormName”. Open Specific Browser Open specific form Lock toolbar Open object with a specific Template Open specific form in a new entry with toolbar lock Run a browser and lock the toolbar Run browser and hide the toolbar Open in a new entry without the "Related jobs" Open object using only browser operation (Locks all other buttons) 177 | P a g e .Chapter 7 – Advanced Tools C.4 Examples of Menu Jobs Examples of the use of extra commands when running menu jobs are provided below. Messages – Reminder 178 | P a g e . Windows Scheduler C. Remote Server B.Chapter 8 – Schedule Tasks CHAPTER 8 Schedule Tasks A. SoftOne Scheduler D. batch and reports. Examples of jobs you can run through remote server are the following:  Send emails through EDA (Alerts)  Send sms through EDA (Alerts)  Run a report and export the result in any supported format  Run a report in any available printer and send a confirmation message.  Run a batch job.Chapter 8 – Schedule Tasks A. Figure A1 179 | P a g e . sms. Remote Server Remote Server is a SoftOne server that can execute application jobs such as scheduled emails. route the result to a cell phone or an e-mail and sent to the originator a confirmation message. Note: Remote Server uses one SoftOne license for running and executing the above jobs.  Run a report. 1 Activation To activate Remote Server select from settings menu: Tools  Remote Server  Run. Select any other device (GSM Phone.Chapter 8 – Schedule Tasks A. fill in the parameter fields and then select the button “Save config” to save the configuration as in Figure A3. Figure A2 Figure A3 180 | P a g e . Use button “Add device” and select Database to activate the use of Remote Server in the current Database. Activate the option “Auto activation” and then press the button “Activate” (Figure A2). E-mail) you need to activate. PDF File. EXCEL.2 Remote Server Commands All commands that can be used for running specific commands through the Remote Server menu are displayed in the table below. 437. AUTOEXECUTE=1) Auto run OUTPUT 928.e. REPORTLIST. DIALOG. PrinterName Sends Job Results to a specific File or printer FILENAME SENDTO Name of the File for saving the results MAIL.g. COMPANYLIST. Remote Server Commands Command TYPE Parameters REPORT. BRANCHLIST Operation Job type OBJECT Object selection (i. DESIGN. ANSWER. BATCH. GSM Send Results to Email or Cell phone MAILADDR Email Address GSMNUM Cell phone Number 181 | P a g e . PRINTERLIST. WORD.Chapter 8 – Schedule Tasks A. CUSTOMER) JOBNAME Name of Browser or designed Report PHOTO Template name AUTOEXECUTE 0.1 (e. METAFILE. BATCHLIST. 3 Send SMS . enable the parameter “Auto activation and press “Activate” (Figure A4). which will be used to send SMS. Then. Figure A7 182 | P a g e . Finally. Figure A4 You have the ability to display the messages and jobs in progress or already processed using the menu "Remote Server  Scheduled commands" (Figure A7). Inside the textbox “Number” enter the number of the connected phone.Chapter 8 – Schedule Tasks A. inside Remote Server you have to define the Com port (from Windows) to which the cell phone is connected.Email First thing you have to do in order to send messages using a cell phone from within the application is to setup and recognize the cell phone in Windows (drivers). The process is very simple. However. select the button "Fields" and drag n drop the field Phone01 from customers in the field Recipient. Figure A5 From the window that is displayed. you can enter the number directly if you wish to send a message to a specific phone number.Chapter 8 – Schedule Tasks You also have the option to schedule messages or batch jobs (Figure A8). Then from the right-click pop up menu click on the option "Send SMS" (Figure A5). Example Send multiple sms messages to customers using fields from TRDR table. Finally. click the button "Send" to send the message. Of course. you can use and drag in it any of the available fields. In the memo textbox below enter the message to sent. Figure A8 Remote Server can also be used to run any of the jobs you have created inside EDA (Alerts) and have as their type to send messages to email or user cell phones. and the creation of EDA (Alerts) using email or cell phone types. Select one or more customers from the customers’ browser. Figure A6 183 | P a g e . requiring only the activation of the devices (email or sms) through the Remote Server. Figure B1 B.txt) in the application folder. as well as the execution errors. XCOFILENAME  The name of xco connection file Figure B2 184 | P a g e . Enter also the name of the XCO file as in the example of Figure B2. Commands. are kept in a log file named XECUTOR.LOG which is created in the folder: C:\Documents and Settings\All Users\Application Data\SoftOne\Log A basic requirement for the using the Windows Scheduler execution is that the option Scheduler in Softone Settings is not activated (Figure B1).1 SoftOne Scheduler Commands Create a Notepad file and create or copy the desirable commands from a Softone Scheduler job. a task in Windows Scheduler and the connection XCO file with AutoLogin section.Chapter 8 – Schedule Tasks B. Windows Scheduler Jobs running from Remote Server or Softone Scheduler can also run directly from Windows Scheduler. All you need is to create a Notepad file which includes internal scheduler commands. JOBNAME  The name of the job (can be any name) TYPE=BATCH  Job type OBJECT  Object or script to execute. Save the file with any name (e. All actions executed using the above mechanism.g. 2.2 Windows Scheduler Task Create a task in Windows Schedule using the following steps: B. In the next window. enter the user credentials (Figure B6).exe” (Figure B4) Figure B4 Select a name for the task and the execution intervals (Figure B5). Figure B5 Figure B6 185 | P a g e .Chapter 8 – Schedule Tasks B.1 Windows XP Open Windows Scheduler: Control panel  Scheduled task Insert a new Task in Windows Scheduler (Add Scheduled Task) (Figure B3) Figure B3 Using the button “Browse” locate the application folder and then the file “Xplorer. Inside the textbox “Run”.TXT Figure B7 Figure B8 B. (Figure B10) Figure B9 Figure B10 186 | P a g e .exe file.2 Windows 7 Open Windows Scheduler: Control panel  Administrative Tools  Task Scheduler (Figure B9) Create a new task.2. either through right-click. enter the switch parameter /EXECUTE:C:\TEST\Commands. or through panel Actions  Create Basic Task.Chapter 8 – Schedule Tasks In the last window select the option “Open advanced properties” (Figure B7) Press finish to display the window shown in Figure B8. after the path of Xplorer. TXT to run this file after launching SoftOne The last window displays a summary of the actions that will run when executing this Task (Figure B15).Chapter 8 – Schedule Tasks Select a name and a description for the task (Figure B11). Figure B11 In the next window select the execution intervals (Figure B12).exe” (Figure B14) In the same window inside the textbox “Add arguments (optional) enter the switch parameter /EXECUTE:C:\TEST\ENTOLES. Figure B14 Figure B15 187 | P a g e . In the next window. select “Start a program” (Figure B13) Figure B12 Figure B13 Using the button “Browse” locate the application folder and then the file “Xplorer. Chapter 8 – Schedule Tasks B. in order for the Windows Scheduler Task to auto Login to a specific database using a specific user. You can use any Notepad application to open the XCO files.3 XCO Connection File The connection file XCO must necessarily be located within the application folder. Inside this file you have to add the section [LOGIN] (Figure B16). Figure B16 188 | P a g e . company and branch and then execute the selected job. ) which can run at a specific time and day from a specific user and can be repeated within a specific time interval. etc. When you open the Scheduler tool then a browser is displayed with all the scheduled tasks (Figure C2). Reports. SoftOne Scheduler is located under the system settings menu (Figure C1).Chapter 8 – Schedule Tasks C. Figure C1 Figure C2 189 | P a g e . SoftOne Scheduler SoftOne Scheduler is a tool for scheduling SoftOne jobs (Browsers. If you don’t need them you have to delete them in order for the task to work properly. Restart(Minutes): Time for restarting the job. Next Run: Displays the next execution date. Available options are the following: Insert date: Completed automatically with the insert date of the task (Login Date). Figure C3 190 | P a g e . design reports and open reports (Figure C5). Auto run: "Yes"  Displays the task to the user and runs it. or if the task is scheduled to run at regular intervals. For example if you wish to run an object but you don’t want to use a certain template (photo) then you have to delete the line PHOTO=. Select report/printout: Select from the available browsers. Processed: "Yes"  If the task has been executed.1 Create Task While in Scheduler browser click on the button “New” to create a new task (Figure C3). Executed by: Sets the user that will run the task.Chapter 8 – Schedule Tasks C. Note: When inserting a new task some options are preselected from SoftOne. Inserted by: Completed automatically with the insert user of the task (Login User). Select Job: Sellect from the available jobs of the application (Figure C6). Figure C3 shows an example of the creation of a job selecting report "Item analysis Card" from Customer Reports. "No"  Displays the task to the user. Date of Last Run: Displays the last execution date. "No"  If the task is not yet executed. Appointment recurrence: Selects the time intervals of the task (Figure C4). Chapter 8 – Schedule Tasks Figure C4 Figure C5 Figure C6 191 | P a g e . PrinterName Sends Job Results to a specific File or printer FILENAME SENDTO Name of the File for saving the results MAIL. AUTOEXECUTE=1) Auto run OUTPUT 928.2 Scheduler Commands You can use extra commands when creating a task in Scheduler.e. All the available commands are displayed in the table below. ANSWER. BATCH. which are similar to the Remote Server commands. REPORTLIST. WORD. PRINTERLIST.1 (e. Scheduler Commands Command TYPE Parameters REPORT.Chapter 8 – Schedule Tasks C. BATCHLIST. EXCEL. COMPANYLIST. DESIGN. GSM Send Results to Email or Cell phone MAILADDR Email Address GSMNUM Cell phone Number 192 | P a g e . 437. CUSTOMER) JOBNAME Name of Browser or designed Report PHOTO Template name AUTOEXECUTE 0. BRANCHLIST Operation Job type OBJECT Object selection (i. PDF File. METAFILE. DIALOG.g. Figure D1 Messages are displayed on the screen of logged in users as in figure D2.Chapter 8 – Schedule Tasks D. Figure D2 Reminder window is displayed when a user logs in the application (figure D3). The interface is similar to SoftOne Scheduler. Figure D3 193 | P a g e . Messages – Reminder SoftOne messages tool is used for text communication between application users at specific intervals. New messages are added through the menu "Business modules . Message schedule time can be set through the interval window displayed through click in the field “Time scheduling”.Messages" (Figure D1). Sub Form Events I. Dataset Functions E. Object Functions C. Line Printing Events J. Object Events H. Dataset Methods D. Dataset Events G. Field Events F.Chapter 9 – Form Scripts CHAPTER 9 Form Scripts A. Object Methods B. Case Studies 194 | P a g e . CANCELEDITS Cancels all changes made to data in an Object (Cancel entry). CLOSESUBFORM (SubFormName: string) Closes sub form name “SubformName” Example X.CLOSEAPPLICATION(). Example X.CLOSESUBFORM(‘MYSUBFORM’).CLOSEFORM(). function ON_POST() { if(X. Example X.USER == 901) //Checks if Login UserCode = 901 { X. } } CLOSEAPPLICATION Closes the application. CLOSEFORM Closes the active Object.Chapter 9 – Form Scripts A.SYS.cancelation of changes for a specific user when saving an entry.BEEP. 195 | P a g e .CANCELEDITS. Example Prohibition . Object Methods This module demonstrates all the object methods you can use in formscripts. BATCHEXECUTE Runs the Batch Object Example See Case Study 4 BEEP Plays a simple beep sound Example X. CustTbl. ObjSaldoc.FINDTABLE('TRDR'). } Example 2 See  Case Study 2 DBINSERT Modifies the Object status to insert mode in order to accept data Example 1 Add a new customer while in another object and then display a message with the new customer’s id.DBLocate(12345).CreateObj('PURDOC'). If the object does not allow current record deletion. ObjSaldoc. } Example 2 See  Case Study 2 DBLOCATE (KeyData: variant) Locates the record containing “KeyData” value in the primary key Example 1 Locate and delete a record in Sales documents. newid = myObj.Chapter 9 – Form Scripts DBDELETE Deletes the record located in an Object. myObj.DBPOST. ObjSaldoc. try { CustTbl = myObj. executing all SoftOne object methods and jobs. function DeleteRecordfromObject() { ObjSaldoc = X.GETLASTERROR). function LocateObject() { ObjSaldoc = X.WARNING('New Customer's ID is:'+newid).DBLocate(12345).DBINSERT. Example 1 Locate a record in Purchase documents and display a message. X.NAME = 'TEST_CUSTOMER'. function InsertNewCustomer() { myObj = X.WARNING(‘Located record with id=12345’).CREATEOBJ('CUSTOMER').CODE = '12345'. CustTbl.WARNING('Error: '+myObj. X. an error occurs. } catch (e) { X.DBDelete.CreateObj('SALDOC'). } } 196 | P a g e . WARNING('Error: '+myObj.CODE = '12345'.DBINSERT. // else X. } } EXCEPTION (Message: string) Displays an exception message. } 197 | P a g e .EXCEPTION(‘No changes allowed. myObj. Cancells all jobs and stops running code.NAME = 'TEST_CUSTOMER'. function InsertNewCustomer() { myObj = X. try { CustTbl = myObj. X.Chapter 9 – Form Scripts Example 2 See  Case Study 4 DBPOST Posts the data of an Object in the database. applying all SoftOne methods Example Add a new customer while in another object and then display a message with the new customer’s id. 14474285).FIELDCOLOR('CUSTOMER.220) = 45 + 256*220 + 65536*220 = 14474285 if(CUSTOMER. Example X.Country depending on the selection. UserColor = Red + 256 * Green + 65536 * Blue Example Set color in field Customer. UserColor: integer) Sets color "UserColor" in FieldName field.FINDTABLE('TRDR').WARNING('New Customer's ID is:'+newid).COUNTRY == 999) X.255).220. function ON_CUSTOMER_COUNTRY() { // Color RGB (45.COUNTRY'.CREATEOBJ('CUSTOMER'). } catch (e) { X.DBPOST.FIELDCOLOR('CUSTOMER. CustTbl.GETLASTERROR). newid = myObj. The job was canceled!!!’). CustTbl. FIELDCOLOR (FieldName: string.COUNTRY'. function ON_ITEM_MTRMARK() { If( ITEM. } FREE Destroys the Object and deallocates its memory Examples See  Case Study 1 See  Case Study 2 See  Case Study 4 INVALIDATEFIELD (FieldName: string) Repaints the data in a combo box. Usually used after the method Refesh when data are changed through sql update statement. when user selects certain value in field MTRMARK then set inactive a value of the table MTRMANFCTR and refresh the items shown in the appropriate combo box of the form. OPENSUBFORM (SubFormName: string) Opens Sub form named “SubFormName” Example Open sub form Vat Analysis by clicking on a specific button in sales documents function EXECCOMMAND(cmd) { if (cmd == 100001) X.SRCHCODE'). else X.REFRESH. X.Chapter 9 – Form Scripts FOCUSFIELD (FieldName: string) Sets focus in “FieldName” field Example In sales documents. } } INCLUDE (filename: string) Includes code from an external file Include (‘C:\\myfunctions. null).MTRMANFCTR.INVALIDATEFIELD('ITEM. X.OPENSUBFORM('SFVAT').MTRMARK == 1) { X. when user adds a new item line change the focus depending on the selected series.MTRMANFCTR').txt’). Example In Items object.SERIES == 7023) ) X.FOCUSFIELD('ITELINES.X_CODE').FOCUSFIELD('ITELINES.SERIES == 7003) || (SALDOC. } 198 | P a g e . function ON_ITELINES_NEW() { if( (SALDOC.RUNSQL('UPDATE MTRMANFCTR SET ISACTIVE=0 where COMPANY=1 AND MTRMANFCTR=10'. REFRESH.'BROWSER1'. //FormCode=100. Printer=MyPrinterName } Example 2 See  Case Study 1 REFRESH Refreshes the data of a combo box control Example X. AParams: Array list containing ASQL Parameters Example Update custom table field with this value X. Keydata: string) Opens the Quick View window and displays data for the record “Keydata” of the oject “ObjectName”. Word.'SALDOC.''). Example 1 Locate and print a record in Sales document using a specific printout form and printer. PrinterName: string. RUNSQL (ASQL: string. Decimals: integer) Sets the number of decimal digits in the field "FieldName" 199 | P a g e . ObjSaldoc. AParams: Variant) Runs an action query by using the "ASQL" statement.Chapter 9 – Form Scripts QUICKVIEW (ObjectName: string. } } PRINTFORM (FormCode: integer.. etc..PRINTFORM(100. Excel.RUNSQL('UPDATE CCCMYTABLE SET CCCMYFIELD=1 WHERE COMPANY='+X. FileName: string) Prints the form with code number "FormCode" that belongs to the current object using the printer named "PrinterName". The browser used is named “ListName”.'MyPrinterName'.null).) FileName: File path when the "PrinterName" is ASCII.TRDR').MTRMANFCTR.DBLocate(12345). function PrintSalesRecord() { ObjSaldoc = X.COMPANY. then you must also define the "FileName".SYS. Example Open Quick View named “BROWSER1” of the customers by clicking on a specific button in sales documents function EXECCOMMAND(cmd) { if (cmd == 100001) { X.QUICKVIEW('CUSTOMER'. FormCode: Code Number of the printout form PrinterName: Printer name or File type (ASCII. ASQL: The SQL statement to execute.CreateObj('SALDOC'). ObjSaldoc. SETDECIMALS (FieldName: string. If the print media is a file.. Excel. ListName: string. Word. Name'.'TRUE'). 'NewCaption') Changes the caption of the field “FieldName”. TemplD: integer. Example 2 X.SETPROPERTY('FIELD'. in order to "disable" the Save button. SETPROPERTY ('MERCHANGELOG'.SETPROPERTY('MERGECHANGELOG'.SETPROPERTY('MERGECHANGELOG'.Chapter 9 – Form Scripts SETDOCPRINT (PrintNum.'FALSE'). Use the parameter "PANEL" for Datagrids and Tabs. Parameter "FIELD" works only for fields inside datagrids. Mode.'PANEL14'.'CAPTION'. PrintNum: Number of copies Mode: Method (1 = Automatically.'TRUE').'VISIBLE'. Example 2 X. 1).’MYNEWCAPTION’).'SALDOC. 2 = With question) TemplD: Form Code Printer Name: The name of the printer Caption: Window title SETFIELDVALUE (FieldName: string. Example 1 X. 'True or False') Merges and saves any data changes.'MYGRID'. FieldName'. 'True').SETPROPERTY('PANEL'.'ITELINES. SETPROPERTY ('FIELD or PANEL'. overwriting existing values.'VISIBLE'. Tabs and Datagrids. Value: Variant) Assigns the new value to “FieldName” field.SETPROPERTY('PANEL'.SETPROPERTY('FIELD'. Must be used under the event ON_DOCPRINT. 'CAPTION'. Panels. PrinterName. Example 3 X. 200 | P a g e .TRDR'.'VISIBLE'. Example 1 X.'VISIBLE'. SETPROPERTY ('FIELD'. Usually used after populating a virtual table in a view.SETPROPERTY('PANEL'.1).'MYPAGE'. 'True or False') Changes the visible property of Datagrid Fields.. Example X.QTY1'. Example 4 X. 'VISIBLE'. Caption: string) Prints a specific number of copies of the TempID form. MYCCCFIELD=1 AND EXISTS (.Chapter 9 – Form Scripts SETFIELDEDITOR (FieldName: string. Example 1 Change the editor of field ITELINES. 201 | P a g e . AMessage: string) Saves text "AMessage" in file "FileName"..WHOUSE (combo box) in sales documents based on the selected series function ON_SALDOC_SERIES() { if( (SALDOC.'WHOUSE').SETFIELDEDITOR('MTRDOC.)])').'ITEM(W[A.WARNING(' This is a warning message'). Editor: String) Changes the Editor of any field that already has a link (selector) to a table or view.SETFIELDEDITOR('MTRDOC. } TOFILE (FileName. Example X. If the file exists. Example 3 Change the editor of field MTRDOC.SERIES == 7002) ) X.WHOUSE'.SERIES == 7001) || (SALDOC. WARNING (Message: string) Displays a warning message on the user's screen. then it is replaced. else X.MTRL'.SETFIELDEDITOR('ITELINES.MTRL (selector list) in sales documents item lines X..WHOUSE'.'WHOUSE(F[WHOUSE=1001])'). AMessage: string): integer Displays a dialog message (Yes. Otherwise it returns formula "ElseCase" CHECKMODULE(ModuleNum): Boolean Checks if Module exists CONNECTIONSTATUS: string. Cancel). The returned codes are: 0 = Standalone 1 = Client 2 = Server 3 = SleepClient 4 = OffLine 5 = SaaS 6 = ESupport 202 | P a g e . ThenCase. // 6=Yes. ElseCase: variant): Variant. 2=Cancel if ((ans == 7) || (ans == 2)) { X. function ON_POST() { var ans. Returns the SoftOne connection status. No. 'Continue ? '). Returns formula "ThenCase" when formula "IfCase" is true. } } CASE (IfCase. Object Functions This module demonstrates all the object functions you can use in formscripts. ASK (ACaption. AMessage: Message displayed in the window Example Display question for saving an entry. Returned values are: 6=Yes. ans = X. Returns the index of the button pressed. 2=Cancel ACaption: Title of the window.Chapter 9 – Form Scripts B. 7=No. 7=No.EXCEPTION('Save canceled by the user').WARNING('Yes pressed'). } else { X.ASK('Confirm save'. FindTable('FINDOC'). TblFin. waits for the user to save it and then returns the id of the new record.Post.TRDR. TblLns. TblFin. TblFin.MTRL= ITEM. TblFin. TblLns. TblFin.FindTable('ITELINES').TRDR = 123456. which opens the object on the user’s screen.Chapter 9 – Form Scripts CREATEOBJ (ObjectName: string): OBJECT (IDispatch) Creates the "ObjectName" object and returns its IDispatch interface.CreateObj('SALDOC. SalObj.Edit. The only difference is that if can be combined with function "ShowObjForm". X. TblLns=SalObj.QTY1= 100.FindTable('ITELINES').TRDR= CUSTOMER. TblFin=SalObj.SHOWOBJFORM(). while in object Customers.Myform') Example 1 Create and save a sales document.WARNING('New id is:' + id).PRICE= 50. In order to create an object using a specific form use the syntax: CreateObj('ObjectName. TblLns. using current located customer record id.SERIES= 7062. while in object Items. var id=SalObj. Display the purchase document on screen.QTY1= 100.FindTable('FINDOC'). } 203 | P a g e . TblFin. } Example 2 See  Case Study 1 CREATEOBJFORM (ObjectName: string): OBJECT (IDispatch) Creates the "ObjectName" object and returns its IDispatch interface as in "CreateObj" function.DBPOST.DBINSERT. TblLns.MYSALESVIEW').DBINSERT.SERIES= 2001.Post. TblLns=PurObj.Append.CreateObjForm('PURDOC'). TblLns.Append. PurObj. TblLns.Edit.MTRL. TblLns.MTRL= 123456. TblFin=PurObj. TblLns. wait for the user to save it and then display the new id in a message box. TblLns. TblLns. Example Create a purchase document. var id=PurObj. X.WARNING('New id is:' + id).PRICE= 50. using current located item record id. function CreateSales() { SalObj = X. function CreatePurchase() { PurObj = X. EXEC(‘xcmd:XXX’). Save. TableName or SoftOneScript) then it executes the selected job.SYS. ObjectName. then you have to call the object using the parameter . custom form button).EXEC('button:Save').g. "Command" starts with the word“XCMD:”   If it is followed by an integer then it runs an internal command of the application or any other custom command (e. Example 1 Save entry function SaveEntry() { X.TRNDATE)') Example 2 EasterDate = X. New. Returned names are: Soft1Data: Soft1 Profile Directory UserData: User Profile Directory EXE: SoftOne Dir HTML: Soft1 Web Server Dir SDK: Soft1 SDK files Dir EVAL (Formula: string): Variant Calculates the "Formula" and returns the result. Next. View. } 2. Example 3 See  Case Study 3 EXEC (Command: string): variant Executes the SoftOne "Command" based on the following parameters: 1.FISCPRD+'))'). Used primarily for executing internal Softone functions. Prior.EXEC(“button:XXX”). Example 1 DateforSQLQuery = X.EXEC('button:Cancel'). DIR (Name: string): string Returns the "Name" directory. Delete. Toolbar Buttons are: Browse.EVAL('DateToStr(GetPasxaDate('+X.EVAL('SQLDATE(SALDOC. All the available internal commands can be found in ANNEX Tables If it is followed by a menu command (e. Copy. "Command" starts with the word "button:" The corresponding button of the toolbar is executed. Syntax is: X. Notice that if you choose to open an object and you need to close it after it is posted by the user.g.Chapter 9 – Form Scripts DOUBLE (StrNum: string): real Converts StrNum to a real number and returns the result.N (example 3). Print. 204 | P a g e . } Example 2 Cancel entry function CancelEntry() { X. Syntax is: X. Cancel. FINDTABLE (TableName: string): variant Returns the Dataset (IDispatch interface) of the table "TableName". ScriptName: myscript’) 3.TRDR” X. X.Chapter 9 – Form Scripts Example 1 Display open item window through a sales document X.EXEC ('XCMD: FormImport. X. } FORM: string Returns the name of the form of the current object FORMATFLOAT (Value: float.EXEC('XCMD:CUSTOMER') Example 3 Open new sales document from object Customers assigning the current value to field “SALDOC. X.EXEC('XCMD:1031') Example 2 Open customer X.N["SET FINDOC.TRDR='+CUSTOMER. Filter: string): real Returns the sum of the values of “FieldName” field from Dataset with entries that meet filter “Filter” Example function ON_LOCATE() { msg = X. tblFindoc=ObjSaldoc.GetDataset'.CreateObj('SALDOC'). Example 1 X. Example 1 X. 'CCCMYTABLE'). Functions can be found in the section Libraries of Chapter SBSL.FILTERSUM('ITELINES. Example 2 See  Case Study 4 FILTERSUM (FieldName.MODULE. "Command" starts with the word "code:" Runs the SoftOne callpublished function that follows it.EXEC('CODE:ModuleIntf. Example 1 ObjSaldoc=X.WARNING(msg).TRDR+'"]') Example 4 Run SoftOne script named “myscript”.EXEC('script:Myfunction') 4.FindTable('FINDOC').'MTRUNIT=1'). "Command" starts with the word "script:" Runs the script function that follows it.QTY1'. format: string): string Returns the float “Value” in alphanumeric format 205 | P a g e .EXEC('XCMD:SALDOC. 0) AS YPOL FROM MTRDATA WHERE MTRL='+ITEM.fromCharCode(39) + strDate + String.null).TRNDATE) For use in sql queries: strDate = String.MTRL'+ AND FISCPRD='+X.DBINSERT. myObj. Example 2 Return the balance of an item X. ''). AParams: Array list containing ASQL Parameters Example 1 Return the description of the login company ds=X.WARNING('New Customer's ID is:'+newid). FROMFILE (FileName: string): string Returns the data of the file “FileName” GETYEARPERIOD (ADate: TDateTime): Variant Returns the year and the period of date "Adate" GETLASTERROR: string Returns the last error message Example function InsertNewCustomer() { myObj = X.FISCPRD.FORMATDATE ('yyyymmdd'. } } GETSQLDATASET (ASQL: string.COMPANY.GETSQLDATASET('SELECT NAME FROM COMPANY WHERE COMPANY='+X.CODE = '12345'.NAME = 'TEST_CUSTOMER'.CREATEOBJ('CUSTOMER').Chapter 9 – Form Scripts FORMATDATE (Date: TDateTime.WARNING('Error: '+myObj.DBPOST. ASQL: The SQL statement to execute. 206 | P a g e . strDate = X. format: string): string Returns the “Date” in alphanumeric format Example Return of date in sales documents in TRNDATE sqldate format. CustTbl. try { CustTbl = myObj.SYS.fromCharCode(39).FINDTABLE('TRDR'). } catch (e) { X.GETLASTERROR). newid = myObj.SALDOC. CustTbl. X. AParams: Variant): TDataset Executes the "ASQL" statement and populates a Dataset with the results set.GETSQLDATASET('SELECT ISNULL(QTY1. code: string): integer Returns the primary key value of the main table in the object "ObjectName" having the value "Code" in the field Code. 0 = Normal Text) Examples See  Case Study 1 See  Case Study 4 ISVALIDCONTRACT: boolean Checks if serial number . Requires the existence of specific language files. Example Display a message on screen with the ID of customer with code '001'. '001')). DefaultValue: string): string Displays a dialog message that allows the user to enter text. Returns the text entered by the user when the user selects OK. INPUTQUERY (ACaption: string. LOGINDATE: TDateTime Returns the current date (same as X.WARNING(X.WARNING('LoginDate is ' + X. Returns blank when Cancel or Esc is pressed. vPassword:integer) : Variant Displays a dialog message that allows the user to enter text. //Returns: Login Date is: Sat Oct 5 00:00:00 UTC+0300 2013 207 | P a g e .contract is valid LIST: string Returns the name of the current browser LOCALE: integer Returns the Current Locale ID in language code (LCID) Example X.LOCALE). Value: Preselected value of the input field. X.CODE='001' INPUTBOX (Prompt: string.LOGINDATE).SYS.Chapter 9 – Form Scripts ID (TableName: string. ACaption: Title of the window.WARNING(X.ID('CUSTOMER'.COMPANY=1000 AND A.LOGINDATE) Example X. APrompt: string. Value:Variant. //The sql query executed is (login company = 1000): //SELECT TRDR FROM TRDR A WHERE A. APrompt: Internal window text (input field title).SODTYPE=13 AND A. vPassword: Displays the input text with asterisks (1 = Asterisk Text. // For Greek it returns 1032 LOCALESTRING (value: string): string Returns the login language of variable "value". TblLns.SERIES= 2001.TRDR = 123456. TblFin=PurObj. Example Create purchase document from items function CreatePurchaseDoc() { PurObj = X. Password: string): boolean Compares the not encrypted string "StringtoValidate" with an encrypted password field (e. USERS.Post.SHOWOBJFORM().NEWID.FindTable('FINDOC'). TblLns. } SPELL (Num: Real): string Returns the spelling of number Num Example X. var id=PurObj. Used in after post event. Example Return the ID of an entry of a sales document (whether new. X.Edit. It must always be combined with function CreateObjForm.DBINSERT.10)). Example X. //Returns: ONE THOUSAND ONE HUNDRED ONE AND TEN 208 | P a g e . SHOWOBJFORM: integer Opens an object.Chapter 9 – Form Scripts NEWID: integer Returns the ID of the entry saved.PRICE= 50.FINDOC. waits for the user to save it and then returns the id of the new record.g. or already posted) function ON_AFTERPOST() { if (SALDOC. PurObj. TblFin.FINDOC < 0) FINDOCID = X.WARNING(X.MTRL= ITEM. TblLns.QTY1= 100.mp3'). TblFin.CreateObjForm('PURDOC').SOPASSWORD) and returns TRUE if they match. } PASSWORDVALIDATE(stringtoValidate: string.MTRL. TblFin. TblLns. PLAY (SoundFileName: string): boolean Plays the sound file "SoundFileName" and returns True. else FINDOCID = SALDOC. TblLns=PurObj.SPELL(1101.FindTable('ITELINES').WARNING('New id is:' + id).Append. TblLns.PLAY('C:\\\\SOUND\\\\alarm. WARNING('The current time is : ' + X.) ASQL: SQL statement AParams: ASQL Parameters SUM (FieldName: string): real Returns the sum of the value of field “FieldName” located in a Dataset X. USERVALIDATE(UserName: string.NUM01').NUM01 TIME: string Returns the current time in hh: mm format Example X.Chapter 9 – Form Scripts SQL (ASQL: string. Password: string): boolean Returns TRUE if a user with credentials "UserName" and "Password" is found in the database.TIME).SUM('ITELINES. AParams: Variant): string Returns the values created by string ASQL separated by semicolons (. //Returns the total sum of the field ITELINES. 209 | P a g e . ITELINES.ENABLECONTROLS. } DISABLECONTROLS Disables Dataset Windows controls. Makes looping through an onscreen datagrid much faster.'200'). ITELINES. ITELINES. } DELETE Deletes the current record and puts the Dataset in dsBrowse state.POST..MTRL = X. Example Loop through document item lines datagrid by deactivating Window Controls function LoopDataset() { ITELINES.APPEND. ITELINES. Example Function that deletes a record in document item lines when the item code=100 function DeleteRecord() { if(ITELINES. } } finally { ITELINES. while(!ITELINES. try { ITELINES. empty record at the end of the dataset and makes the empty record the current one so that field values for the record can be entered either by a user or by code.Chapter 9 – Form Scripts C.FIRST. } } 210 | P a g e . Example Function that inserts a record in document item lines for the item with code=200 function AppendNewRecord() { ITELINES.QTY1 = 1.ID('ITEM'. Always use it in a try/finally block in order to avoid accidental disable of Dataset controls..LINEVAL = 100.100) == 1) ITELINES.EOF) { //code.NEXT.DISABLECONTROLS.LOCATE('X_CODE'.DELETE. The record that followed the deleted record becomes the current record. ITELINES. APPEND Opens a new. Dataset Methods This module demonstrates all the Dataset methods you can use in form scripts. .Chapter 9 – Form Scripts ENABLECONTROLS Activates the Window controls of a given Dataset Example Loop through document item lines datagrid by deactivating Window Controls function LoopDataset() { ITELINES. while(!ITELINES. } } finally { ITELINES.DISABLECONTROLS. } } 211 | P a g e .NUM01 = ITELINES. } } EDIT Puts the Dataset into dsEdit state if it is not already in dsEdit or dsInsert states Example myDataset. try { ITELINES.EDIT.ENABLECONTROLS. try { ITELINES. FIRST Moves to the first record of the Dataset Example Fill the field NUM01 in all document item lines datagrid with a specific value.NEXT.NEXT. function FillDatasetRecords() { ITELINES. } } finally { ITELINES.EOF) { ITELINES.EOF) { //code.DISABLECONTROLS. ITELINES.FIRST.ENABLECONTROLS.FIRST. while(!ITELINES..LINEVAL * SALDOC.LRATE. ITELINES. Example In document lines.DISC1PRC > 50) X.ID('ITEM'.EOF) { if (ITELINES. } } LAST Moves to the last record of the Dataset Example ITELINES. search for a record having item code=100 and if you find it then insert a new record before this line with item code=200. ITELINES. function FillDatasetRecords() { ITELINES.POST. search for item lines that have discount more than 50% and display a warning message. ITELINES.'200').DISABLECONTROLS.ENABLECONTROLS.INSERT. } } 212 | P a g e .WARNING(‘Discount is greater than 50% in item code: ’+ ITELINES. ITELINES.Chapter 9 – Form Scripts INSERT Opens a new.NEXT. while(!ITELINES.LINEVAL = 100. NEXT Moves to the next record of the Dataset Example In documents. X_CODE).FIRST.LAST.QTY1 = 1.MTRL = X. try { ITELINES. qty1=1.100) == 1) { ITELINES.LOCATE('X_CODE'. lineval=100. empty record before the current record. ITELINES. function InsertRecord() { if(ITELINES. ITELINES. } } finally { ITELINES. and makes the empty record the current one so that field values for the record can be entered either by a user or by code. Example Fill document item lines datagrid with the items of the login company that a specific field meets a certain condition (CCCMYFLAG = 1) function AppendNewRecord() { ds = X.MTRL = ds. the Dataset is put in dsBrowse state. the Dataset remains in its current state.SetDatasetLinks'.COMPANY.EXEC('CODE:ModuleIntf. X. X. dsLink.EXEC('CODE:ModuleIntf.g. This function provides the ability to send the queries once.SetDatasetLinks'. If successful. Value) SBSL function that is very useful in form scripts. 0). CUSTOMER.SETREADONLY('TRDCATEGORY'. ITELINES. SETREADONLY (FieldName: string.SETREADONLY('TRDCATEGORY'. then for every record added. } } PRIOR Moves to the previous record of the Dataset Example ITELINES.SYS. ITELINES. ITELINES. if unsuccessful.GETSQLDATASET (‘SELECT MTRL FROM MTRL WHERE CCCMYFLAG = 1 AND SODTYPE=51 AND COMPANY=’+X.POST. 213 | P a g e . DatasetHandle.MODULE. if (ds.Chapter 9 – Form Scripts POST Attempts to post the new or altered record. Example 1 dsHandle = X. When you populate a Dataset (e. Value: True/False) Sets the "FieldName" field in Read Only mode.PRIOR. a query runs for each of these fields in order to link them to the tables.NEXT. X. If you use it in a datagrid then it sets the whole column in read only mode. X.MTRL. 0 or 1). 1).TRDCATEGORY to read only. 'TRUE').null). 1= Enable links Syntax: X.MODULE.QTY1 = 1. ITELINES.GetDataset'. Values: 0= Disable links. Example Change the status of the field CUSTOMER.APPEND. //or CUSTOMER. virtual table) that has fields linked to tables. dsHandle). dsHandle.LINEVAL = 10.MODULE.RECORDCOUNT > 0) { ITELINES.EXEC('CODE:ModuleIntf. SETDATASETLINKS(ModuleHandle. ds. when all records are filled. .EOF) { //code.NEXT.FIELDCOUNT . if (myfield == 'Value') { //code. } FIELDS (index: integer): variant Returns the value of the index field 214 | P a g e .. } FIELDBYNAME (FieldName: string): variant Returns the value of field "FieldName" Example for(i = 1..3.i++) { myfield = SALDOC.i<CCCMYTABLE.FIELDCOUNT . } } FIELDCOUNT: integer Returns the number of fields in the Dataset Example for(i = 0.Chapter 9 – Form Scripts D.FIELDNAME(i).. } FIELDNAME (index: integer): string Returns the name of the index field Example Change all the fields of custom table CCCMYTABLE to read only mode for(i = 0..FIELDBYNAME('CCCMYFIELD'+i). EOF: boolean Returns TRUE or 1 if the Dataset is on the last record Example ITELINES. ACTIVE: boolean Returns TRUE or 1 when the data of a dataset can be read or edited.FIRST.1..i++) { //code.1. 1).SETREADONLY(CCCMYTABLE. Dataset Functions This module demonstrates all the object functions you can use in form scripts.i<SALDOC. ITELINES. while(!ITELINES.i++) { CCCMYTABLE. Chapter 9 – Form Scripts FILTER: string String used for filtering the Dataset Example 1 vFilter= '{ITELINES. ISNULL(B.TRDR WHERE A.NAME.WARNING( fldn+' IS NOT NULL!' ).fromCharCode(39)+'12345'+String.SODTYPE=13 ORDER BY 2 DESC'. ITELINES.Disables(0) filtering and returns the filtered status of the Dataset Example 1 vFilter= '{ITELINES. ITELINES.SYS. function Createbmpfile() { str = 'SELECT TOP 5 A.LBAL. ITELINES.TRDR=B. else X.fromCharCode(39). Example 2 See  Case Study 5 ISNULL (FieldName: string): boolean Returns True or 1 when field "FieldName" is null Example When saving a customer record check if a field (ZIP) is null and display a message function ON_POST() { CheckNull( 'ZIP').0) AS BAL FROM TRDR A INNER JOIN TRDFINDATA B ON A. Example 2 See  Case Study 5 FILTERED: boolean Enables(1) . ITELINES.COMPANY='+X.COMPANY+' AND A.FILTER= '('+vFilter+')'.MTRL_ITEM_CODE}= '+String.fromCharCode(39). CCCMYTABLE.MTRL_ITEM_CODE}= '+String. ValueFieldName: string): string Creates a Chart Image in bmp format and returns the full path and filename.WARNING( fldn+' IS NULL!' ).'').FILTERED= 1.FILTERED= 1.ISNULL( fldn ) == 1 ) X. //Creates the bmp file and returns the full path } 215 | P a g e .'BAL').REMARKS = ds. } GETGRAPH (LabelFieldName: string.FILTER= '('+vFilter+')'. } function CheckNull( fldn ) { if ( CUSTOMER. ds = X.GETGRAPH('NAME'. The chart is created with data from the field "LabelFieldName" and values from the field "ValueFieldName" Example Function that creates a bmp file and saves the path and filename in the REMARKS field of the located custom table (CCCMYTABLE) record.fromCharCode(39)+'12345'+String.GETSQLDATASET(str. 0" encoding="ISO-8859-7"? > <SODATA> <METADATA> <FIELDS> <FIELD fieldname="CODE" fieldtype="string" WIDTH="25" fieldcaption=""/> <FIELD fieldname="NAME" fieldtype="string" WIDTH="64" fieldcaption=""/> </FIELDS> <PARAMS PRIMARY_KEY=""/> </METADATA> <ROWDATA> <ROW CODE="09" NAME="Test Customer 1"/> </ROWDATA> </SODATA> } 216 | P a g e .Chapter 9 – Form Scripts GETHTML (FieldNames: string): string Returns the values of "FieldNames" fields in HTML format Example Function that returns the fields “Code” and “Name” of table TRDR (with ids 123 and 124) in html format. myxml = ds. NAME FROM TRDR WHERE TRDR='+SALDOC. NAME FROM TRDR WHERE TRDR IN (123. function GetXMLFormat(withmetadata) { ds = X.TRDR.GETXML(withmetadata). //Returns <table id="seltbl" width="10" count="1"> <tbody> <tr> <td>09</td> <td>Test Customer 1</td> </tr> <tr> <td>10</td> <td>Test Customer 2</td> </tr> </tbody> </table> GETXML (writemetadata: Boolean): string Returns the Dataset in XML format Example Function that returns the fields “Code” and “Name” of the selected customer in sales documents in xml format.GETSQLDATASET('SELECT CODE.124)'. } //0 (No MetaData) Returns <?xml version="1. function GETHTMLFormat() ds = X.'').NAME').0" encoding="ISO-8859-7"? > <SODATA> <ROWDATA><ROW CODE="09" NAME="Test Customer 1"/> </ROWDATA> </SODATA> //1 (With MetaData) Returns <?xml version="1. myhtml = ds.GETHTML('CODE.GETSQLDATASET('SELECT CODE.''). LOOKUP (KeyFields: string.RECORDCOUNT > 0) { //code.'). RECORDCOUNT: integer Returns the total number of records in the Dataset Example 1 if(ITELINES. 217 | P a g e . This is the default state of an open Dataset. A restricted set of data can be viewed. ResultFields: string): Variant. RECNO: integer Returns the current record number of the Dataset. Example In documents locate to the item line that the fields MTRL=12345 and QTY1=10 and then display a message.RECNO. 3=dsInsert Dataset open.WARNING('Located line. 1=dsBrowse Dataset open.10) == 1).12345.QTY1'. and no data can be changed. KeyValues: Variant. } Example 2 See  Case Study 2 STATE: integer Returns the State of the Dataset.Chapter 9 – Form Scripts LOCATE (FieldNames: string.. The current row can be modified. A new row is inserted or appended. if(ITELINES.. FieldValues: variant): boolean Returns TRUE and moves to the record in which the fields "FieldNames" have the values "FieldValues".. 6=dsFilter Dataset open. 2=dsEdit Dataset open. Data unavailable. Returns the values of fields “ResultFields” where fields “FieldNames” have values “FieldValues”.LOCATE('MTRL. but not changed.. Data can be viewed. The available values are summarized below: 0=dsInactive Dataset closed.WARNING('Record not found'). Indicates that a filter operation is under way. { X. //code… } else X. Example curRec = ITELINES. SETPROPERTY('PANEL'.SERIES == 7630) ) && (X.'FALSE'). to perform validation and to raise custom error messages. Example On a sales document display a message that prevents the user from inserting item lines with discount greater than 50%. Use it to raise custom messages or perform any other actions. ON_<DatasetName>_POST Occurs before changes to a Dataset record are posted.'). } 218 | P a g e . ON_<ObjectName>_<FieldName>_VALIDATE Occurs before the value for a field changes (Before Change) ON_<ObjectName>_<FieldName> Occurs after the value for a field changes (After Change) Example Change the visible property of the panel named “Panel14” in sales documents based on a selected series and user login function ON_SALDOC_SERIES() { if ( ( (SALDOC.'VISIBLE'.'VISIBLE'.'TRUE'). ON_<DatasetName>_NEW Occurs when a new record is added in the Dataset.'PANEL14'. Use it to set default values. ON_<DatasetName>_AFTERDELETE Occurs after a Dataset record is deleted.'PANEL14'. ON_<DatasetName>_AFTERPOST Occurs after changes to a Dataset record have been posted. Use it to perform validation and to raise custom error messages. function ON_ITELINES_POST() { if(ITELINES..Chapter 9 – Form Scripts E. } F.EXCEPTION('Discount can not be greater than 50%.SERIES == 7650) || (SALDOC. Dataset Events This module demonstrates all the Dataset events that occur in formscripts.USER == 111) ) X.SYS. ON_<DatasetName>_BEFOREDELETE Occurs before a Dataset record is deleted. else X. It is commonly used to change values.DISC1PRC > 50) X.SETPROPERTY('PANEL'. Use it to perform any actions that you want to occur before a Dataset record is posted. Field Events This module demonstrates all the field events that occur in formscripts. ON_CREATE Occurs when an object is created. For example when you double click on Customers object.g. Object Events This module demonstrates all the object events that occur in formscripts. ON_CANCEL Occurs before cancelling the changes of an object ON_LOCATE Occurs after locating a record of an object ON_POST Occurs before saving record data of an object ON_AFTERPOST Occurs after saving record data of an object ON_DELETE Occurs before deleting a record of an object ON_AFTERDELETE Occurs after deleting a record of an object ON_INSERT Occurs after inserting a new record in an object ON_DOCPRINT Occurs before printing an object printout form ON_OPENREPORT Occurs before the execution of a report EXECCOMMAND (cmd) Occurs when executing a command (e. ON_DESTROY Occurs on destroy of an object.Chapter 9 – Form Scripts G. button click) ON_RESTOREEVENTS Occurs when a record is created from conversion of another record ON_EDIT Occurs when user edits / changes any field inside a record of an object EXECCOMMAND(cmd) (cmd=-1) Occurs before a record is copied to another record (before copy from buffer) 219 | P a g e . Sub Form Events This module demonstrates all the subform events that occur in formscripts. ON_<Subform name>_ACCEPT Occurs when user clicks the “OK” button of a sub form. 220 | P a g e . ON_<Subform name>_SHOW Occurs on show of a sub form.Chapter 9 – Form Scripts EXECCOMMAND(cmd) (cmd=-2) Occurs after a record is copied to another record (after copy from buffer) H. ON_<Subform name>_CANCEL Occurs when user clicks the “CANCEL” button of a sub form. SETPARAM('STARTPAGEFIELD'. return true. i++) ds.FINCODE == 'Sum' ) MYACNTRN.EDIT. } return true.FPAGEL).'MYACNTRN.Chapter 9 – Form Scripts I.FIELDCOUNT. ON_BANDSTART (BandName) Start Band Print ON_BANDEND (BandName) End Band Print ON_BANDLINE (BandName) Line Band Print ON_BANDTRANSFER (BandName) Print Transfer Values Example function ON_OPENREPORT() { X. if ( MYACNTRN. } return true. Line Printing Events This module demonstrates all the line printing events that you can use in report objects. } 221 | P a g e . ds. return true. for (i=0.X1'.FINCODE = 'NewName'. ds. "CAPTIONFIELDNAME".P1'. ds=X.SETPRINTPARAM(BandName. i<ds. X. 2). } function ON_BANDEND(BandName) { if ( BandName=='MYACNTRN' ) { X.FIELDS(i)= i. } function ON_BANDTRANSFER(BandName) { X. } function ON_BANDLINE(BandName) { if ( BandName=='MYACNTRN' ) { MYACNTRN.APPEND.'MYACNTRN.SETTRANSFERVALUE(BandName.GETENDBANDDATASET('MYACNTRN'). ds. USR.POST.THECAPTION = "MyCaption".SETTRANSFERVALUE(BandName. 1). "THECAPTION"). 1 .PRINTFORM(100.FREE.GETLASTERROR). The default value is the quantity of the item line.0).WARNING(ObjItem. which allows the user to specify the number of copies to print. ObjItem = null. } } catch(e) { X. //Create Object Item try { ObjItem.''). function EXECCOMMAND(cmd) //Controls Commands { if(cmd == 100001) //Checks the ID of the button clicked { iCopies = X.ITELINES. if(iCopies!='') { var ObjItem. i = 1.DBLocate(ITELINES. //The above line displays a dialog box.'Number of copies: '.INPUTQUERY('Print item'.Item Printout Form 222 | P a g e .MTRL). //Locate ITEM using the selected item from document lines while(i <= iCopies) { ObjItem. The printing is executed using a button on the sales screen and displaying a question message asking for the number of copies to print. i++. ObjItem = X. } finally { ObjItem. Case Studies Case Study 1 Print specific form for a selected item in sales documents lines. } } } } Figure D1.Chapter 9 – Form Scripts J.Createobj('ITEM').'HP LaserJet 4100 Series PCL'.QTY1. 3 – Copies selection window.2 – Form button design Figure D1.Chapter 9 – Form Scripts Figure D1. after clicking button "Print Labels" 223 | P a g e . COMPANY+' AND FINDOCS=' + SALDOC.FIRST. //Delete record } finally { ObjConv. while(!ds. //Create Sales Object try { ObjConv.FINDOC).FINDOC. } ds.CreateObj('SALDOC'). clicking on a form button. //Locate record ObjConv.EOF()) //Loop and delete the documents found { ObjConv = X.null). { //SQL statement for searching converted documents based on the located strqry='SELECT DISTINCT FINDOC AS FINDOC FROM MTRLINES WHERE SOSOURCE=1351 ‘ + ‘AND COMPANY='+X.FREE. } } 224 | P a g e . ds=X. ObjConv =null.NEXT.DBDelete.DBLocate(ds.Chapter 9 – Form Scripts Case Study 2 Delete all converted documents of a sales document displayed on the screen.SYS.GETSQLDATASET(strqry. ds. function EXECCOMMAND(cmd) //Controls Commands { if(cmd == 100002) //Check the ID of the button clicked { DelConvertedDocs(). } } function DelConvertedDocs() //Finds and deletes converted documents. } Figure D3.SOVAL.2 .25 above) X.FPRMS.25)').GETSQLDATASET('SELECT SOVAL FROM FPRMS WHERE SOSOURCE=1351 ' +' AND COMPANY='+X.SQL statement that returns field SOVAL (Place of the field ACNMSK) 225 | P a g e .fromCharCode(39)+'.fromCharCode(39)+strSOVAL+String.Chapter 9 – Form Scripts Case Study 3 Open “compressed” field SOVAL (table FPRMS). sVal = X. find the value of the accounting field (ACNMSK) and display it in a message box. //Returns the value of the 1st line and 26th column (zero based) of the field SOVAL (Parameter 0.1 – FPRMS form – Account Field (CTRL + SHIFT + F12) Figure D3.''). strSOVAL = dsFPRMS.EVAL('GETQUERYVALUE('+String.COMPANY+' AND FPRMS='+SALDOC. function GetACNMSK() { dsFPRMS = X.0.WARNING('The account is : ' + sVal).SYS. WARNING('Job completed! '). function ChangePrices() { ObjIteCost = X.TOCODE = ITEM.2 . ObjIteCost.FindTable('MTRDIALOG').Edit. iSODOUBLE1 = X. //Saves current item record and relocates to display the calculation X. TblIteCost = ObjIteCost.BatchExecute.FROMCODE = ITEM.CreateObj('IteCalcMarkUp'). X.SODTYPE = 1.SODOUBLE1 = iSODOUBLE1. if(iSODOUBLE1!='') //Not Cancel { TblIteCost. } } finally { ObjIteCost. The percentage is given by the user through a dialog window.FREE. ObjIteCost = null. } } Figure D4.Javascript inside items form 226 | P a g e . TblIteCost. 'Percentage value'.INPUTQUERY('Modify sales prices'.DBInsert.0).1 . TblIteCost.CODE.Chapter 9 – Form Scripts Case Study 4 Execute the batch job "Modify sales prices" using a custom button in items form. try { ObjIteCost.0. TblIteCost.Design button (using virtual table field) Figure D4. The job runs for the located item.EXEC('button:Save').CODE. using as filter the option "Current prices and given percentage". //Calculation based on "Current prices and given percentage" TblIteCost. Results (The price is increased by 20%) 227 | P a g e .3 .4 .Chapter 9 – Form Scripts Figure D4.Items form – Button click – Display of dialog window Figure D4. //Deactivates all filters on ITELINES } else { ITELINES.V1).FILTERED = 1. //Deactivates all filters on ITELINES } Figure D5.MTRL_ITEM_NAME}='+String.V1=='') { ITELINES. //Runs filter } } function ON_POST() { ITELINES.FILTERED = 0.fromCharCode(39)+SALDOC. The filter field used is the local field (SALDOC.FILTER = '(' + vFilterString + ')'.V1+String.fromCharCode(39) if(SALDOC. //Filter value ITELINES.FILTERED = 0.FILTERED = 0. //Deactivates all filters on ITELINES } function ON_CANCEL() { ITELINES.Chapter 9 – Form Scripts Case Study 5 Filter item lines inside sales documents form based on the item's name.Documents screen with lines filter field 228 | P a g e . function ON_SALDOC_V1() { vFilterString='{ITELINES.1 . The local field must be placed in the sales documents form. 2 .The local field must be inserted in FINDOC 229 | P a g e .Chapter 9 – Form Scripts Figure D5.Lines display after using the filter Figure D5.3 . This table is displayed on double click on the item lines. } function GetItemPurdoc() //Last 20 Purchases for selected item { strqry='SELECT TOP 20 A2. A1. Figure D6.FINDOC.MTRLINES.PRICE. //Increment percentage function ON_MYPOPUPFORM_SHOW() { vIncrement = 40. A1.Sales View – Virtual table design In form script enter the following code that finds the latest purchases for the selected line item and displays them in a datagrid of a pop up window. User will have the option to calculate the final price based on item purchase price and a given percentage value. } function InsPRCtoMTRLINES(vTable) //Insert Price to Mtrlines { ITELINES.Virtual Table Fields In sales documents create a new panel containing a datagrid with fields from the virtual table you created. create a table that displays latest purchases per item line. Design Create a virtual table in database designer named CCCITEMPURDOC with fields as in Figure D6.2 . GetItemPurdoc(). var vIncrement.FIRST.1 . //Gets the purchases for the selected Item CCCVTITEMPUR. Figure D6.TRDR. Add also a new button (Figure D6.1.PRICE = vTable.2).' 230 | P a g e . Final price can be also inserted as sales price in the item lines.Chapter 9 – Form Scripts Case Study 6 In sales documents. ''). CCCVTITEMPUR.PRICESTART * CCCVTITEMPUR.3 .COMPANY='+X. while (!CCCVTITEMPUR.FINDOC AND A1.FINDOC.DELETE. X. A1.Increment /100).GetDataset'. } Double click on each line of the document to display the pop up window as shown in Figure D6.Sends at the end 1 query for all while (!ds. X.QTY1.APPEND. //Disables Links . dsLink.COMPANY +' AND A1.QTY1' +' FROM MTRLINES A1 INNER JOIN FINDOC A2 ON A1.GETSQLDATASET(strqry.COMPANY=A2.LINEVAL/case A1.MODULE.Chapter 9 – Form Scripts +' (A1. CCCVTITEMPUR.MTRL='+ITELINES.FINDOC=A2.EXEC('CODE:ModuleIntf.PRICE = CCCVTITEMPUR.FINDOC = ds.TRNDATE DESC'.MODULE.PRICESTART = ds.MTRLINES = ds.Pop up Window from double clicking on the item lines 231 | P a g e . } if (ds.SetDatasetLinks'.103) ' +' AND A1.TFPRMS IN(102.TRDR = ds.MTRLINES. 1). CCCVTITEMPUR.RECORDCOUNT>0) { try { dsLink = X.EOF()) { CCCVTITEMPUR.NEXT. CCCVTITEMPUR.INCREMENT = vIncrement.EXEC('CODE:ModuleIntf. CCCVTITEMPUR.TRDR.Sends at the end 1 query for all } } } function ON_CCCVTITEMPUR_INCREMENT() //On change of the increment percentage the final price will be updated { CCCVTITEMPUR.SOSOURCE=1251 ' +' AND A2.3 Figure D6.EXEC('CODE:ModuleIntf.LINEVAL.QTY1 end) AS LINEVAL.COMPANY' +' WHERE ' +' A2.MODULE. ds. //Enables Links .MTRL +' ORDER BY A2. CCCVTITEMPUR. X. CCCVTITEMPUR.SetDatasetLinks'. 'CCCVTITEMPUR').EOF()) { CCCVTITEMPUR. 0).QTY = ds. X.SYS. dsLink.POST. ds=X. } } finally { X. CCCVTITEMPUR.PRICESTART + (CCCVTITEMPUR.QTY1 when 0 then 1 else A1.FIRST. NUM01 «Distance(Km)» and SALDOC. Design Create a new form in sales documents and design panels with the following buttons and fields:  Button «Calc Ship Cost» (RUNB_700001=Calc Ship Cost) Virtual field that will be used to calculate the distance from Google Maps.NUM04).  Button «ShowMap» (RUNB_700003=ShowMap) Virtual field that will be used to open the google maps web page with the selected SoftOne values.1.  Button «Add to Expenses» (RUNB_700002=Add to Expenses) Virtual field that will be used to insert a new record in table expenses with the value of the field “Total Cost” (SALDOC. The form will look as in figure D7.NUM03 «Cost/Km» and SALDOC.. In the form script insert the code (Javascript) of the next pages.Chapter 9 – Form Scripts Case Study 7 Calculate the shipping cost in sales documents. Figure D7. The distance in km is calculated using the address and the postal code of the whouse inserted in the document combined with the shipment address and the shipment postal code inserted in the document.NUM04 «Total Cost» Fields that will be calculated by field Distance.  Fields SALDOC. using data from Google maps.NUM02 «Duration(min)» Fields that will be updated from Google Maps (button Calc Ship Cost).1 232 | P a g e .  Fields SALDOC. There is also a button “Show map” that displays the distance in Google maps web page. To address: Calculated from the fields shipping address (MTRDOC.XMLHTTP"). function distancematrix(from.10 if the km are below 50 or else with the value 0. this.onNoReply = function(){}. url.20.onSuccess = function(){}.send(). this. After the calculation the fields Distance(km) and Duration(min) are updated with data from Google Maps . to) { this.request.request.request = null. this.onSuccess(me.request.open('GET'.onreadystatechange= function() { if (me. this. } catch(e) { 233 | P a g e . this.execute = function() { from = encodeURIComponent(from).from = from || "".request.request.SHIPPINGADDS) and shipping postal code (MTRDOC. var me = this.request. Finally the field Total Cost is calculated from the fields Distance and Cost/km.onError = function(){}.to = to || "". The country is retrieved from the branch of the document. this. url = 'http://maps.status==200) me.responseText). Clicking on button «Add to Expenses» creates a new record in table expenes using the expense with code 101 and the value of the field Total Cost.Chapter 9 – Form Scripts How it works When user clicks on button "Calc Ship Cost" then distance will be calculated using: From address: Address and postal code are retrieved from the whouse selected in the document. url.com/maps/api/distancematrix/json?sensor=false&origins=' + from + '&destinations=' + to. this.readyState==4) { if (me.request = new ActiveXObject("MSXML2. true).onNoReply(). } } try { this. this.SHPZIP) from the sales document. else me. this. Also the field Cost/km is updated with the value 0. to = encodeURIComponent(to).googleapis. } function roundNumber(num. duration = roundNumber((data.pow(10.value / 60).execute(). } function EXECCOMMAND(cmd) { if (cmd=='700001') GetDirections().rows[0]. dec) { var result = Math. if (cmd=='700002') { X.dec))/Math. var from = ds.' + ds.pow(10.2). SALDOC.distance.COMPANY +' AND BRANCH='+SALDOC.2).null).onError(e).NUM01').duration. SALDOC. to = MTRDOC.value / 1000).NUM04 != '') { EXPANAL.SHIPPINGADDR + '. AddtoExpenses(). (SELECT NAME FROM COUNTRY ' +' WHERE COUNTRY=(SELECT COUNTRY FROM BRANCH ' +' WHERE COMPANY='+SALDOC. }.' + ds. dm.' + ds.elements[0].FOCUSFIELD('SALDOC.COUNTRY. var duration=0. 234 | P a g e . } if (cmd==700003) ShowMap().rows[0].COMPANY+' AND WHOUSE='+MTRDOC. } function AddtoExpenses() { if(SALDOC. return result.ZIP + '.NUM01 = distance.BRANCH+') ) AS COUNTRY' +' FROM WHOUSE WHERE COMPANY='+SALDOC.WHOUSE.to). str = ' SELECT ADDRESS. ds = X. if (data.status === 'OK') distance = roundNumber((data.elements[0]. ZIP. } } } function GetDirections() { var distance=0.SHPZIP + '.NUM02 = duration.GETSQLDATASET(str.onSuccess = function(reply) { eval('var data = ' + reply).dec).COUNTRY.' + MTRDOC.Chapter 9 – Form Scripts this. dm.APPEND.round(num*Math. dm = new distancematrix(from.ADDRESS + '. 235 | P a g e .NUM01 <= 50) { SALDOC.' + ds. ZIP' +' . from = from.NUM04. var from = ds.Shell").' + MTRDOC. var aCommand = 'iexplore http://maps.NUM04 = SALDOC.NUM01.ZIP + '.SHIPPINGADDR + '.NUM03 = 0.NUM03 * SALDOC.null).'+'). } SALDOC.GETSQLDATASET(str.ADDRESS + '. to = MTRDOC.COUNTRY.replace(' '.replace(' '. } else { SALDOC. } function ShowMap() { str = ' SELECT ADDRESS' +' .POST.' + ds.10.SHPZIP + '.COUNTRY.EXPN = 101.Run(aCommand. } function CalculateShipCost() { if(SALDOC. to = to.Chapter 9 – Form Scripts EXPANAL. } } function ON_SALDOC_NUM01() { CalculateShipCost().BRANCH+') ) AS COUNTRY' +' FROM WHOUSE WHERE COMPANY='+SALDOC. shellObj. EXPANAL.google.true).' + ds. var shellObj = new ActiveXObject("WSCript.COMPANY +' AND BRANCH='+SALDOC.EXPVAL = SALDOC. (SELECT NAME FROM COUNTRY ' +' WHERE COUNTRY=(SELECT COUNTRY FROM BRANCH ' +' WHERE COMPANY='+SALDOC.COMPANY+' AND WHOUSE='+MTRDOC.20.com/maps?saddr='+from+'&daddr='+to+'&hl=en'.WHOUSE.NUM03 = 0.'+'). EXPANAL. ds = X. Case Studies 236 | P a g e . Execute Data Flows from Screen Scripts E. Data Flow Scenarios D. Basics B. Data Flow Rules C.Chapter 10 – Data Flows CHAPTER 10 Data Flows A. which can be either executed through flow scenarios. The target table “Customers” (3) in which data will be imported. Figure A1 Figure A2 Figure A3 237 | P a g e . Results log of the jobs is stored in the database table named TRNFTRC. which is designed to create customers from draft entries. This very powerful tool allows you to create data transfer batch jobs without the knowledge and use of SBSL scripts. that are displayed as pop up menus in browsers. The source entity contains the object SODRAFT (1) and the target entity the object CUSTOMER (2). is set to retrieve data from the source table “Draft entries” (4). The job is created and displayed in the draft entries browser through a flow scenario (Figure A2). Overview Data flows is a process tool for transferring data between SoftOne modules.Chapter 10 – Data Flows A. Figure A1 displays an example of data flow rule design. or through form script commands. Figure A3 shows the pop up menu that appears upon right clicking on the draft entries browser. Datagrid displays the value assignments in the target fields. Apart from that.sales documents). This means that the default SoftOne business commands and validation will be executed. By selecting a specific form of the object. Fields from data source tables can be used to assign values to fields of the target tables. When the option “Use Object”is not enabled then the updates are executed through sql update statements directly to the database. If you enable the option "Use Object" then the fields will be updated by locating the record and posting it using the form you have defined in the “View” combobox. The “View” combobox lets you pick from the available views (forms) of the object. If no view is selected then the default one is used. Data Flow Rules Data flow rules is the tool where you define the jobs that will be executed when transferring data from one entity to another. SALDOC . including the custom ones are displayed in the datagrid of the tab “Data tables”. Figure B1 Grouping or filtering of the table entries is executed by selecting a data table and clicking the corresponding buttons (Figure B2). Inside the textbox "Name" type the name of the object or select it by clicking on the link. B. Figure B2 Inside the datagrid of the "Modifications" tab you can insert the fields of the source data tables that will be updated after the execution of the job (Figure B3).1 Source entity Inside the source entity you define the source object.g. which contains the data to be transferred (e. its tables. all the custom commands you may have written in form script will also run. The datagrid of the tab “Data tables” lists all the tables you can use as “Data source” for your target tables (Figure B1). Rules description is set through the “Description” textbox. 238 | P a g e .Chapter 10 – Data Flows B. g. PRDDOC . In column "Field" select the target fields. You can also use any internal function of the application (e.Chapter 10 – Data Flows Figure B3 B. Figure B4 Each table (Tab) of the target entity must have a data source table selected (combobox "Data source"). If you select a specific form from the combobox "View" then the new record will be created using this form.g. In "Tables" combobox select the tables that will be used for assigning values through the source tables. meaning that the custom script and commands of this form will occur.2 Target entity The target entity contains the data of the target object. RUNSQL etc)(Figure B5). which is the one that will be created (e. either manually or by selecting fields from the source entity.production documents). Inside the textbox "Name" type the name of the object or select it by clicking on the link. For every table selected. new tabs automatically open labeled with tables’ name (Figure B4). Figure B5 239 | P a g e . Inside the datagrid "Assign field value" you set the field values of every target table. IF. Inside the column "Expression" enter the values of the target fields. where values will be assigned when running the job. Greater than.Chapter 10 – Data Flows By clicking on the header of each row of the target entity datagrid. This can take place only if you have defined a source table that is grouped by certain values.t. Figure B6 The column "Aggregation" allows you to specify math operations (Sum.c) in the fields of the datagrid. For example. if you want to create a document from another document and apply packing of items (in item lines). e. you can zoom in the expressions (Figure B6). Figure B7 240 | P a g e . then you have to group the items (in source table mtrlines) and set their target quantity as the sum of the quantities per grouped item (Figure B7). If you do not apply the user credentials. The option "Display dialog" displays the dialog filters before running the job. as well as the branch and the credentials of the login user. the records created will be displayed on the screen and you can also define the dialog parameters. Enable the option "Display screen" when you wish to display the new records created on the screen and wait for the user to save them. Inside the datagrid "Other connections to apply" you can set the companies that the new records will be created. If the option is not enabled then when the job is completed.Chapter 10 – Data Flows B. Inside the column “Connection file XCO” you can define a connection to a different database. the new records created will be displayed in log text under the link “Results” of the dialog. The records of the datagrid indicate the filter fields and the columns define their properties. The dialog parameters are set through the datagrid "Dialog parameters" (Figure B8). These fields can be used either in the source entity for filtering the source tables or as values of the target table fields (Figure B9). Figure B8 Figure B9 241 | P a g e .3 Runtime Settings In the tab "Run" you set whether during running the job. then the entries will be created using the login user. as well as the connection properties. Enabling the option "Exclude login company" defines that the new records will not be created in the login company. A data flow scenario can run one or more data flow rules and SBSL scripts (Figure C3). Data flow scenarios can be exported from the Custom Administration tool. Figure C1 Figure C2 Figure C3 242 | P a g e . Inside the “Description” textbox you set the text that will be displayed in the right click pop up menu.Chapter 10 – Data Flows C. The “Entity” textbox holds the name of the object that this scenario will be applied (Figure C2). Figure C1 is an example of a data flow scenario created to run through the sales documents browser (Entity SALDOC). Note: Data flow rules are linked to data flow scenarions through their description. This means that if you change the description of a data flow rule then you have to link it again in the flow scenario. Data Flow Scenarios Inside data flow scenarios you can set the jobs (data flow rules or SBSL scripts) to be displayed and run when right clicking on the browsers of the specified objects. Inside the datagrid you set the data flow rules or SBSL scripts that will be executed when selecting the specific scenario from the pop up menu of the browser. where you can also set user rights. '+SODRAFT. where the scenario will be applied.SODRAFT+')').EVAL('SOTRANSFORM. } function Transfertocustomer() { if(SODRAFT.SODRAFT>0) A = X. separated by commas (. } Figure D1 Figure D2 243 | P a g e .) or question marks (?) Example Run the data flow rule with code 3118. separated by commas (. where the scenario will be applied. Execute Data Flows from Screen Scripts Data flows can be called through form scripts of the screens. IDs: string) CSTINFO: Data flow scenario ID IDs: IDs of the entries. function EXECCOMMAND(cmd) { if(cmd == 10001) Transfertocustomer(). IDs: string) CSTNAME: Data flow rule Name IDs: IDs of the entries where the rule will be applied. where the rule will be applied. separated by commas (.that converts a draft entry to a customer through the screen script of the draft entries object.EVAL.) or question marks (?) SOTRANSFORM.) or question marks (?) SOTRANSFORM. You can call either the flow rules or scenarios using the following commands: SOTRANSFORM. IDs: string) CSTNAME: Data flow scenario Name IDs: IDs of the entries.MODELBYID (CSTINFO: integer. IDs: string) CSTINFO: Data flow rule ID IDs: IDs of the entries.RULEBYID (CSTINFO: integer. separated by commas (. through function X.) or question marks (?) SOTRANSFORM.RULEBYNAME (CSTNAME: string.Chapter 10 – Data Flows D.RULEBYID(3118. The rule is executed after clicking a button (cmd = 10001) (Figure D1) and displays the dialog window set within the rule (Figure D2).MODELBYNAME (CSTNAME: string. Transactions and Item lines) and then for each table (Tab) select the source table from which fields values will be assigned.3 244 | P a g e .1. Figure E1. For each field. The last step is to create a data flow scenario using this data flow rule in order to display the job upon right-clicking in the sales documents browser. Case Studies Case Study 1 Batch job created with data flow rule that transfers sales documents to purchase documents with series and supplier selection in dialog filters.1.Chapter 10 – Data Flows E. Inside the datagrid select the fields and add their values in the “Expression” column (pick from source table fields or filter parameters) (Figure E. Select the target tables you wish to update (e. Display size. Figure E1.1. the data type. The “Data tables” tab displays the available data tables of this object (Figure E.2). Figure E1.g. thus the object of the target entity must be PURDOC. Create a new data flow rule and select the object SALDOC as source entity.3).1). enter the description. Editor and any other property required (Figure E.2 The data will be transferred to purchase documents.1 The dialog filters are created through the “Run” Tab. 3 245 | P a g e . Figure E2. clicking on the button “Grouping” and selecting the field "Customer" (FINDOC. The source entity is created as in the previous example using SALDOC.1 Customers (TRDR) and items (MTRL) have different ids in each company. This can be done by using the function “ID” that returns the id of a table for a given code (Figures E2. so the matching should be done by their “Code” field. Figure E2.2 and E2. Alternatively you can use a sql statement using the internal function RUNSQL. Of course. Grouping with customers table is executed by selecting the record (table) "Sales Transactions" in the datagrid of the “Data tables” tab. you have to make sure that in order for the data flow to work correctly you must have the same customer codes and item codes in both companies.Chapter 10 – Data Flows Case Study 2 Batch job created by data flow rule for transferring sales documents from the login company to sales documents of another company and branch.TRDR) of the sales documents (Figure E2.2 Figure E2.3). It also applies customers grouping.1). the results that indicate whether transfer was executed correctly will be displayed as in Figure E2.5.5 246 | P a g e .4 After running the data flow scenario by right clicking the browser of sales documents.4).Chapter 10 – Data Flows In the Run Tab. Figure E2. Figure E2. in the "Advanced connection properties" select to exclude the login company and then in the datagrid below add a new record with the target company and branch (Figure E2. 2 In the target entity enter the object PURDOC (purchase documents) and select "Transactions" and "Item lines" as target tables. In the source entity select the object ITEM. because the target supplier value must be updated from the items ordinary supplier.3. the supplier indicated in the dialog filters will be inserted. The purchases table will be updated by the items table.1). The assignment of field values is executed as in Figure E3.MTRSUP (Figure E3. Figure E3. If no purchase quantity is entered in items. line items shall have quantity 1. using the function “if” for the supplier field.Chapter 10 – Data Flows Case Study 3 Batch job created by data flow rule that will run through the inventory items browser and then create purchase documents with grouping based on the ordinary supplier of the items.3 247 | P a g e .2). Figure E3. For the items that don’t have an ordinary supplier. Figure E3. Grouping items per ordinary supplier is executed using the field MTRL.1 The dialog filters display the purchase series and the supplier that will be used only for items that do not have an ordinary supplier (Figure E3. So.7 248 | P a g e . you need to add again the item table by creating a new table in the source entity. thus it contains only the distinct supplier records.6.5). After running the job.4). there shall be creation of four new documents (the three of them are based on item suppliers and the one is based on the supplier provided from the dialog) (Figure E3. which will contain all the item records (Figure E3. nine items with three different suppliers are selected. Figure E3.7). because this particular table has been grouped per ordinary supplier.6 Figure E3.5 In the example of Figure E3.4 Figure E3. Figure E3. Then you can use it as the data source table for the item lines (Figure E3.Chapter 10 – Data Flows The item lines cannot be updated from the items table of the source entity. Figure E4. the results will appear as in Figure E4.1) Figure E4.2 Figure E4. The dialog filters will have the purchases series and the supplier (Figure E4.4.3).1 The assignment of the values of the final entity will be executed for tables "Transactions" and "Item lines". The items will be inserted based on the raw materials lines. In the item lines table enter the fields from the corresponding source table “Lines of Raw/Auxiliary materials” (Figure E4. Figure E4.4 249 | P a g e . The quantity will be entered through calculation of the lines quantity and waste. In the source entity select the object PRDDOC (production documents) and in the target entity the object PURDOC.2).3 After running the job from the production documents browser.Chapter 10 – Data Flows Case Study 4 Batch job created by data flow rule that creates purchase documents from production documents. In the transactions table enter the fields you want to be updated based on the source table of the production documents (Figure E4. 2) the entries in the Tasks will be created (Figure E5. Select the view with the default values in specific fields.3 250 | P a g e . The assignment of values for the fields in the Tasks table is done as shown in Figure E5. In the source entity select the object PRJC (sales opportunities) and in the target entity the object SOTASK. Figure E5. which will occur when running the data flow scenario and automatically complete the fields.1. Figure E5.3).1 After running the data flow scenario through the sales opportunities browser (Figure E5.Chapter 10 – Data Flows Case Study 5 Batch job created from data flow rule that creates Tasks from sales opportunities with a specific form that has default values for Tasks fields.2 Figure E5. Main Code E. SoftOne Libraries H. SBSL Script Execution F. Dialog screen design (Interface) D. SBSL Built-in Functions G.Chapter 11 . Syntax Basics C. Case Studies 251 | P a g e . Overview B.SBSL CHAPTER 11 SoftOne Batch Script Language (SBSL) A. SBSL A. Figure A1 252 | P a g e . One of the numerous advantages of SBSL compared to SQL scripts is that it follows the rules and logic of the application .something that can not be done directly with SQL statements.updates or deletes records in SoftOne tables. Oracle. With the use of SBSL scripts you can develop numerous batch jobs such as:      Import / modify data in any SoftOne object Export data from SoftOne objects to ASCII files Transfer data to external SQL. Access tables Create XXF file from any object of SoftOne General Batch job execution (eg cost price update) SBSL scripts can be executed using:    Right-click on selected browser records Menu jobs Functions in form screen scripts The following Figure shows an example of a batch job dialog screen. in the same way that a user could do through out the objects interface. Overview S1 Batch Script Language (SBSL) is a programming language developed initially by SoftOne for data import purposes from other applications. SBSL scripts can be incorporated inside the section “S1 scripts” or can be saved in files with “. Scripts in SBSL produce objects similar to batch jobs whose interface (dialog parameters) is designed by code. This language quickly proved to be a very powerful tool that can be used for process design through batch jobs.Chapter 11 .imp” extension. This means for example that it inserts . function myfunctionname(var1. variables and functions can be written using either small or capital letters.SBSL B. B. y. } The code inside functions will be executed when it is called from the SBSL script.6 Functions Functions are written as code blocks (inside curly {} brackets) preceded by the keyword “function”.2 Semicolons SBSL statements must be terminated with semicolons (.3 Comments Comments syntax is the same as in javascript and many other languages (using //).'.var2) { //testcode return var1*var2. 'ImpTable.'. This can be done by using the “return” statement. //assigns the value 50 to the x variable 253 | P a g e .''). Example: // my comments B. when used their type is recognized automatically.4 Variables Variable are declared with a var statement and their type is variant.). B. Examples include 'PILib'. B. x = PrintOnScreen('Complete job execution'). Functions can also return values back to where the call was made. } x = myfunctionname(10. include 'ModuleIntf'. Syntax Basics The following sections include information about the different elements that comprise the SBSL language.5 Libraries References References to built-in SoftOne libraries or to custom “code libraries” is made by using the keyword “include”. function PrintOnScreen(fMess) { x=SendResponse(ReplaceStr(fMess. Example: var x. B.vMess'). B. temp. include 'myscript'..1 Case Insensitive SBSL is case insensitive which means that all commands.5).Chapter 11 .. include 'SysRequest'. Chapter 11 .SBSL 254 | P a g e . 7 Error Messages Custom error messages can be created using the RaiseException function.SBSL B. B.9 Logical operators SBSL provides the following logical operators AND Conjuction OR Disjuction NOT Negation 255 | P a g e . x = RAISEEXCEPTION(‘Process Stopped!’).Chapter 11 .8 Comparison symbols Comparison is done using the following symbols = <> > >= < <= Equal Not equal Greater than Greater than or equal to Less than Less than or equal to B. . Editor.Chapter 11 . Require. 1=does not allow data modification Caption The Label of the field Editor Field editor (See module Editors) TblEdit Internal use only Forced Mandatory field value 256 | P a g e ...TableCaption.. 16=Memo DisplaySize Field width Require 0 = not required. TableName = . Forced. 1 = displayed ReadOnly 0 = allows data modification in the field. 11=DateTime. Dialog screen design (Interface) The first section of the SBSL script consists of the commands that design the dialog screen.1 Table / Dialog Fields The declaration of the fields inside the tables is done with the creation of sections for each TableName entered in Tables section... Form block may include the sections [TABLES].3. using the following syntax. 2=Smallint.0 CacheTable1 = ..MyCache.0 GridTable1 = .. 6=Float.1) [TABLES] HeaderTable1 = .3.0 Example (Ex C. TblEdit. [STRINGS] . tables. 3=Integer.. ReadOnly. 4=Word...MyGrid...SBSL C.1 Section TABLES Inside this section you define the virtual tables (Datasets) that will be used in the dialog window. 1 = required Visible 0 = not displayed. Default PROPERTY DESCRIPTION DataType Field type 1=String.1. Visible. [PANELS] and [STRINGS]. [CACHETABLES]. DisplaySize.MyHeader. FieldName = DataType. } C... tabs. Fields are imported using the following syntax. Fields.... [CACHETABLES] . Caption.3. The design primitives are the same as in screen forms..0 C.3. [PANELS] .. Form { [TABLES] . A table is defined by stating its name (which shall be used in order to refer to the table within the script) as well as its caption. panels and datagrids can be displayed in the dialog screen as long as they are inserted inside block Form. 25.1 2.40.0. 9.0.XCMD:CUSTOMER. Date field with default value the login date. 5.1.1.64000...R[WHOUSE]).1. [HeaderTable1] vImpOk=2..ITECATEGORY.. vButton=2. vMtrunit1=1.1.0.WHOUSE(W[EXISTS(SELECT 1 FROM BRANCH B WHERE B.1 of New code.SYS....UOM of initial code.25. vDate=11.Button.0..1..O. Returns file path.15.M. 8.256..MTRUNIT.Z. 10.7021 3. vFile=1.MTRUNIT(U[vMtrunit1=MTRUNIT@]).1.30. Small integer field displayed as Boolean control (Yes/No) with caption "Job confirmation" and default value “Yes”. Small integer field displayed as combobox control populated with MTRUNIT editor that auto updates (U) another dialog field (vMtrUnit1).h. 7.. String field displayed as text picker control populated with items (using editor) that returns the value of the field “code”.0.1.1. Small integer field displayed as combobox control populated with the commercial categories of items (using editor).R[CODE]).1.M..1.Job confirmation.COMPANY AND B. vItemCode=1.COMPANY= A.25. with default value “7021”.1. 257 | P a g e ...$Filename.15. vMtrunit1Init=1.WHOUSE AS VARCHAR)+:ImpTable.0.1.0..$Y.1.Chapter 11 . vSalSeries=2. 6..:ImpTable.40.W. String field displaying a file picker dialog box.vFilter+B.. Small integer field displayed as combobox control populated with warehouses (WHOUSE editor) and filtered from other dialog filters (vBranch and vFilter).Commercial category. vWhouse=1.BRANCH=:ImpTable.1.1.0.0.:X.WHOUSES+:ImpTable. Small integer field displayed as hyperlink button that can be used to execute a job. vImpMess=16.SBSL Default Default field value Examples 1.ITEM(M. The button of this particular example displays the object “CUSTOMER” when clicked.vBranch AND CHARINDEX(:ImpTable.1..LOGINDATE 4. Text field that can be used in memo textbox for displaying job log messages.vFilter)>0)].SERIES(F[SOSOURCE=1351])..vFilter..1..U... vItemCategory=2.. Small integer field displayed as combobox control populated with the sales series (using editor).0.1.15.0.1.Pick File.Sales series..0.Job messages.From insertion date.0.0.From item code.vFilter+CAST(A. 2 Browser Selected Records SBSL scripts executed through right click in browsers return the selected browser records using the command &SELRECS..1...1...&SELRECS } Connect Xplorer SoftoneCon { connect()..Records selected from Browser.FINCODE.&SELRECS.0. FROM FINDOC WHERE ($REMOVEQUOTES(:$ImpTable..0.0 [ImpTable] vWhere=16.Chapter 11 .vWhere) ) } 258 | P a g e . which must be used inside a field of the section [TABLES].1..Selection of documents from Browser.SBSL C.3.80000...2) Use of selected records from a documents browser in sql statement Form { [TABLES] ImpTable=... The command &SELRECS must be used in a text dialog variable and the syntax is as follows: vWhere=16.&SELRECS Example (Ex C.80000. sDoc = SELECT FINDOC. &SELRECS returns the primary keys of the selected records either whether they are header tables or lines analysis tables.0.0.&SELRECS. 0.1.1..5.0. [CACHETABLES] TblPAYMENT=SELECT PAYMENT. vPayment=2.......0..SYS....3..25.0.25..0..Chapter 11 .vPayment } Figure C1 259 | P a g e .TblPAYMENT(W[SODTYPE=:ImpTable.TblPAYMENT.. with a specific where clause.Type SODTYPE.50 [PANEL11] ImpTable.. Extra where is applied in the field vPayment..vSodtype ImpTable. Example (Ex C.$SODTYPE(W[12.2 Section CACHETABLES This section is usually used for initialization of other dialog filter fields..0 [ImpTable] vSodtype=2. Form { [TABLES] ImpTable=.NAME.0.1.1.COMPANY.SODTYPE AS SODTYPE FROM PAYMENT [PANELS] PANEL11=0. NAME=1..30.1.Payment..0.0.0.0 TblPAYMENT=.1.SBSL C.....5.3.3) Use of a cachetable as an editor in a field of dialog filters.0..13]).5.0. This is done through Datasets that are populated from sql statements that run during script initialization and can be used either as editors in fields or anywhere else in your SBSL script. SODTYPE=2.vSodtype AND COMPANY=:X.0. COMPANY=2. depending on the user’s selection of sodtype (field vSodtype).COMPANY]) .. [TblPAYMENT] PAYMENT=2.0.. 50.0.0.g.0.0. 50..'Area2'. Syntax is the following: Column width. The available controls are stated through the following syntax.4) Design a dialog interface with 3 tabs.H20 PANEL114 = 4. (e..SBSL C. Form { [TABLES] ImpTable=.&JOB vDate = 11.'AreaSplit 2'. N=Bottom Line..1.1.’Tab1.0.64000. 1=Tab.1...15.0.Date.0.4000.H100 PANEL13 = 1.15.0.F PANEL121 = 0.e.50.. G=Group.Messages..H70 PANEL12 = 1. N.Job.0. [PANELS] PANEL11 = 1.1.vImpOk ImpTable.0.'Memo'. panel inside tab) Info Control properties.vFile [PANEL113] ImpTable.0.vSeries [PANEL114] ImpTable. 0.1.:X.0.C:\MyFiles vIteCat = 2. Caption.3 Section PANELS This section contains all the information needed to design the interface of the dialog screen.0. vMess = 16.H100 PANEL1212 = 0.0..H10 PANEL113 = 0. Info PROPERTY DESCRIPTION Control Defines the control: 0=Panel.0.1.1..0 PANEL1211 = 0.vIteCat 260 | P a g e ...50.JOB.0.1..25.25.1.SERIES(F[SOSOURCE=1351]).'Grid'.Job confirmation.1. Used for nested controls (e..1.100.0.1. H20) When you use Panel or Page controls you must always add the character F.SYS.30.'AreaSplit'.g.50. 4=Memo textbox Caption Text that defines the caption of the control Level Number that defines the level of the control.2.0.ITECATEGORY.100.F’) Example (Ex C.0. H=Height (i.. 2=Datagrid. 50. [PANEL112] ImpTable.2.1.3. G10.0. 40.Commercial category.1.0.1. the 2nd tab will have one panel with 2 horizontal split panels (50-50) and the 3rd tab will have a datagrid.N.0.'Area1'..$Y.1..'AreaSplit 1'.'Page3-Grid'. The 1st tab will have 2 panels and a memo textbox.$Filename.LOGINDATE vFile = 1.1. vSeries = 3.0.Chapter 11 .'Page2-AreaSplit'.Master.0 [ImpTable] vImpOk = 2. 0.1.File. ControlName = Control..F PANEL112 = 0.0.0. PANEL11 = 1.7021 vJOB = 2.'Page1-Areas'.Sales series. Level.vMess [PANEL1211] ImpTable.F PANEL131 = 2.. Chapter 11 . the dialog window will be displayed as in Figures C2. Figure C2 Figure C3 Figure C4 261 | P a g e .SBSL [PANEL1212] ImpTable.vDate [STRINGS] JOB=JOB [JOB] 1=Items import 2=Documents import } When executing the above code. C3 and C4. 30..vMyString1 ImpTable.&MyString1 vJob = 2.LINENUM = Manufacturer = Initial order [PANELS] PANEL1 = 0.0.MTRL = MT.4 Section STRINGS In this section you define the string lists to be used and displayed as editors in combobox fields in the same way as you state them in database designer or form designer.1...SQLOrder.Chapter 11 .. sIteLines = SELECT ML.MTRMANFCTR ML.&Job vSQLOrder = 1. ML.30..0.3.15. Form { [TABLES] ImpTable = .StringList1.FINDOC = :$sDoc.5) Design a dialog window with 3 comboboxes populated from string lists.N. Syntax is the following: StringListName = StringListName Example (Ex C.15..1. It also uses the string lists as parameters for the execution of the batch job (&MyString1.vJob ImpTable.PRICE FROM MTRLINES ML.&SQLOrder [STRINGS] MyString1 = MyString1 Job = Job SQLOrder = SQLOrder [MyString1] 1=Display New Codes 2=Update Table 3=Create New Password 4=Create Composition Documents [Job] 1=Documents export (One time) 2=Repeat documents exports [SQLOrder] T.1. &Job. &SQLOrder).Master. ISNULL(ML. } 262 | P a g e .15.FINDOC AND ML. This particular example uses also a string list named SQLOrder within the main code for sorting a sql statement based on user selection..Job.1.'Area1'..MyString1.0.StringList2.0..0.1. MTRL MT WHERE ML.MTRL ORDER BY $REMOVEQUOTES(:$ImpTable.30.StringList3.QTY1.0).vSQLOrder } Connect Xplorer SoftoneCon { connect().MTRL.vSQLOrder).H100 [PANEL1] ImpTable.0 [ImpTable] vMyString1 = 2.SBSL C.1. 25.vItemCode 263 | P a g e .Job confirmation.G10 0.From item code.0... Note: In order to run the script.Series..0.#SERIES(W[SOSOURCE=1251 AND (TFPRMS=102 OR TFPRMS=103 OR TFPRMS=151 OR TFPRMS=152)])..SBSL Figure C5 C.100. such as filling a datagrid of the dialog filter or hiding panels..0. This means that if for example you have added a string list field in this section.10 .1.256.1.100.100..0. vJob = 2..Purchases series.0.0..vJob [PANELS] PANEL1 PANEL2 PANEL3 PANEL4 PANEL5 = = = = = 0.Item.. 3.G10 [PANEL1] ImpTable.0.Job confirmation.0.0. the “Run” button will be activated and the script will be executed.G10 0.0.$Filename.6) Design a dialog window that changes the visible property of panels and the caption of a field based on user selections..G10 0. 0 [ImpTable] vImpOk = 2.Job.$Y.0. vFile =1. [FIELDEXEC] ImpTable. Using the appropriate "if" statement inside your code you can enable different processed to be executed depending on the selected values. Example (Ex C.vSeries [PANEL3] ImpTable.. use the ClientImport execution method.vJob [PANEL2] ImpTable.0.1.0.0.1024.100.JOB.1.R[CODE]).1.Select file.100. vSeries = 1. Master.G10 0.Job..0. Form { [TABLES] ImpTable =.5 Section FIELDEXEC Fields added in this section trigger the execution of the main script code upon each value modification performed by the user.ITEM(M.Pick File.0. vItemCode =1. then when the user selects a value.15 .Chapter 11 . 'ImpTable. 'VISIBLE'. 'FALSE'). vJob. 'CAPTION'. 'TRUE'). 'ImpTable. 'PANEL'. 'USR_PANEL4'. 'PANEL'. vImpOk = GetFieldValue(vImpTable. } else if (vJob=2) { x=SetProperty(xModule. if (vJob=1) { x=SetProperty(xModule. 'VISIBLE'.'vJob').Chapter 11 . 'VISIBLE'. 'USR_PANEL4'. 'PANEL'. 'Import file').vImpOk [STRINGS] JOB=JOB [JOB] 1=Data import 2=Data Export } include 'ModuleIntf'. 'CAPTION'. vImpOk. // Panel visible x=SetProperty(xModule.vFile'. 'TRUE'). vImpTable = GetDataset(xModule. x=SetProperty(xModule. 'USR_PANEL2'. 'FIELD'. 'TRUE').vFile [PANEL5] ImpTable. 'USR_PANEL2'. 'FIELD'. 'FALSE'). 'TRUE'). Connect Xplorer Export { connect(). vImpTable. 'PANEL'. 'PANEL'.'ImpTable'). x=SetProperty(xModule. } { //Main code Var x. 'VISIBLE'. 'VISIBLE'. vJob = GetFieldValue(vImpTable.'vImpOk'). // Panel hidden x=SetProperty(xModule. x=SetProperty(xModule. } if (vImpOk=1) //The code below is executed only when the user clicks “Yes” in field “Job confirmation” { if (vJob=1) { //Code to run when vJob=1 } if (vJob=2) { //Code to run when vJob=2 } } } 264 | P a g e . 'USR_PANEL3'. 'VISIBLE'.vFile'. 'USR_PANEL3'. 'Export file').SBSL [PANEL4] ImpTable. x=SetProperty(xModule. 'PANEL'. SBSL The following figures show the different panels and field caption displayed according to the selection of the field “Job”.Chapter 11 . Figure C6 Figure C7 265 | P a g e . .Chapter 11 . 'COMPANY'. NAME). Examples 1. ReturnFieldName:String) Examples Converter that returns the company name based on company code given as parameter Converter GetCompanyName (COMPANY.SODTYPE=51. Converter that returns item id based on the company code and item code given as parameters Converter ConvItem (MTRL. 'function RUN() { X.sSalDoc.SBSL D.. 2. Function that displays a warning message function ShowMessage(fMess) { x = CallPublished('SysRequest.ExecuteXScript'. The syntax of Converters is the following: Converter funcname (TableName:String. Converter that returns customer id based on the company code and customer code given as parameters Converter ConvCustomer (TRDR. } //.}'. MTRL = ConvItem(:X. 'RUN'.SYS.'100-01'). Function that adds text message in a memo textbox field (vMess) function PrintOnScreen(fMess) { x = SendResponse(ReplaceStr(fMess.WARNING('+#39+VarToStr(fMess)+#39+').. 4)). } //. 'COMPANY.SYS...2 Functions Same as in converters you can define your own functions which can be called from anywhere inside the script and may be used to return values. TRDR). x = ShowMessage('This is a warning message').. 266 | P a g e . GetCompanyName(1). 1. you can add a Converter that runs a sql statement based on the parameters and when called returns the value of the return field defined.CODE'.'.1 Converters In any place of the code. D. x = PrintOnScreen('Completed!'+#13+#10). MTRL). VarArray(XModule.SODTYPE=13. 'COMPANY. 'ImpTable.CODE'. ‘ParameterVariables:String’.COMPANY.COMPANY.'.CUSTOMERCODE). TRDR = ConvCustomer(:X. Main Code D.'').vMess'). vLine = vLine + AddStrLine('23. 267 | P a g e . } //. :ImpTable.VATVAL3). ':1'. This string field can be later used used for the export of an ASCII delimited file.conName) { var sql. } //. } mystr = Copy(mystr.VAT3). 112)'.000'. newvMesDate = VarToStr(getSQLDate(:ImpTable.CreateText'.Len(mystr))). vLine = vLine + AddStrLine(''. 5). newd = FormatSqlText(conName. ''). vLine = vLine + AddStrLine(VarToStr(HEADER. return (mystr + Space(icount .WriteLine'. return x. icount).1). 3). x = CallPublished('PILib.Chapter 11 .v1). vLine = vLine + AddStrLine('VAT'. Function that returns the date in sql format function getSQLDate(v1.vMesDate. function AddStrLine(mystr..vPath3).SBSL 3. 4. x = GetQueryResults(conName. newd. vLine = vLine + AddStrLine('VAT'. icount) { if (mystr = null) { mystr = ''. Function that formats the output of a string field by adding spaces until it meets the specified length given as parameter. 3).'S1Con')). VarArray(vTextWrite. 5)..00'. vLine = vLine + AddStrLine(FormatFloat('0.x. '+newd+' . sql = 'Select convert(VARCHAR(8).HEADER. 2)). vLine = ''. vLine.1. vTextWrite = CallPublished('PILib. sql. 14)... Oracle and ODBC and the syntax is the following.bpl'. ds1 = select * from MYTABLE where WHOUSE=1. DBase. 'sa'.e.bpl'. '123456'. } 268 | P a g e . ServerDB. 'SERVER'.Persist Security Info=False. Notice though that you must always define a connection to SoftOne. DBase. 'srvn1'.3 Connection Types The connection types you can use inside SBSL scripts are: SQL Server. etc. SoftOne Connection to SoftOne login database (must always be defined) Syntax Connect Xplorer ConS1{ connect(). 'MSSQL'.Chapter 11 . Password. 'DBNAME'). dsfin = Select * from findoc where….) based on the connection string Syntax Connect DBDriver XlsData { connect( 'XADODrv. } ODBC Connection through ODBC (Excel. For each connection you must define a specific name (i. User. } SQL SERVER Connection to SQL Server database Syntax Connect DBDriver DocData { // Driver. ConS1). User.bpl'. DataBaseName connect ('XADODrv. 'CUSTOM'. which will be then used as a reference inside the script. ServerDB. .1. XlsMtrl = select * from [mtrl$]. 'Provider=MSDASQL. ' srvn1'. 'ORACLE'. } ORACLE Connection to ORACLE database Syntax Connect DBDriver SRSData { // Driver.SBSL D. DataBaseName connect( 'XADODrv. Access. 'SERVER\MYSRV'. Password.Data Source=XlsMtrl' ). ' srvn1' ). include 'ModuleIntf'. 269 | P a g e .Chapter 11 .e. D.4 Variables The script variables can be stated at any point of the code before being called. In order to create and use your own functions as libraries you have to add them in a SBSL script (i. UserResp. when used their type is recognized automatically. Example: include 'MyLib'. They are declared with a var statement and their type is variant. Examples include 'PILib'. include 'SysRequest'. In order to use libraries. Analysis of SoftOne libraries can be found in the following modules. vRow. x. vRowCancel. vLabelText.5 Use Libraries In the main script code you can call functions that exist either in internal SoftOne libraries. or in libraries that you have created by using SBSL scripts. var vTot.SBSL D. MyLib) and then call them from any other SBSL script by using the statement “include ScriptName”. you have to add the “include” statement. E. Another example of use of clientimport is when importing files from disk.Chapter 11 .SBSL E. this method does not differ in the mode of data transfer to the client (CLIENTIMPORT). document conversion including the display of the document screen before posting) then clientimport must be used. it simply changes the appearance of the dialog window (it does not display the first line in the dialog parameters).SCRIPTNAME:NameOfScript (Figure E1).1 Menu Execution SBSL scripts that are built to run as menu jobs must be created as follows: Job type: Batch Job Command (Server): FORMIMPORT. Figure E1 Figure E2 270 | P a g e . keyboard. SBSL Script Execution The scripts created using the SBSL can be executed from the menu using the following ways: FORMIMPORT : Run script on the server and transfer results to the client CLIENTIMPORT : Run script from the client The first method (run on server) is clearly faster than the second one (client / server environment). The call action using clientimport is used when the script must have access to local resources (screen.e.SCRIPTNAME:NameOfScript Command (Client): CLIENTIMPORT. If for example the user must interact with the screen displayed after running the script (i. If the script is stored in a file. disks and file system). then you enter the entire file path (Figure E2). A third method to run a script is to use CLIENTIMPORT2 command. Job title = CLIENTIMPORT. [OBJECTNAME_BRMENU] 1.CFG file If you choose this method then you need to create a file named OBJINFOS. using the following syntax.SCRIPTNAME:nameofscript 1. E.Job title = FORMIMPORT.2.1 Execute through OBJINFOS. are displayed in the bottom of the pop up menu appearing upon right clicking on browser records (Figure E4). The scripts called this way.CFG. either using the file OBJINFOS.2 Browser Execution Execution of SBSL scripts through right click from browsers can be performed in two ways. or the SoftOne tool Flow Scenarios.SCRIPTNAME:nameofscript Figure E3 Figure E4 – Sales documents pop up menu displaying custom job “File Transfer…” 271 | P a g e .Chapter 11 .SBSL E. Within the file OBJINFOS.CFG (Figure E3) you define the objects which will run the SBSL scripts and the titles of the jobs to be displayed on right click.CFG in the application folder of each client. The jobs are displayed and executed from a submenu of the right click menu.". Example (Ex E.. Figure E5 272 | P a g e . which is named “Flow scenarios” (Figure E6). Inside the datagrid insert a new line of "Import script" type and in description enter the run command for the SBSL script named "test1". which is: FORMIMPORT. indicate the title of the job that will appear upon right clicking.2 Execute through Flow Scenarios Execution of SBSL scripts through flow scenarios (Figure E5) gives you the ability to define user rights for the scenario (and thus for the SBSL script) using exactly the same way as the definition of rights in any application module. Another difference between calling SBSL script from a flow scenario and calling it from the file OBJINFOS.2.CFG is the location of the job displayed under pop up menus. SCRIPTNAME: test1 (Figure E5) Restart the application.Chapter 11 .1) Call a script named “test1” from a flow scenario and display it in the pop up menu of sales documents under the title "Files transfer. In "Entity" indicate the SoftOne object (SALDOC) where the script will be displayed and executed from.SBSL E. open the SoftOne object “Sales Documents”. In "Description" box. select any records and then by right click notice the new job you’ve created. Create a new flow scenario through "Data flow scenarios" menu in the Report Tools. under the submenu “Data flow scenarios” (Figure E6). ScriptName: NameOfScript’) Example (Ex E. Of course. The id of the specific item is retrieved through the dialog parameter vItemId.EXEC ('XCMD: FormImport.MTRL”.2) Execute the SBSL script named "UpdateItem" using a button in items view for the located item id. Create a new button (cmd = 100001) in items view. Add the form script as in Figure E7.3 Form Screen Execution SBSL jobs can be called through form screen scripts using the function EXEC with the following syntax.Chapter 11 . Figure E8 273 | P a g e . Figure E7 Create the SBSL script “UpdateIem” as in Figure E8. the specific field should not necessarily be visible in the job dialog filters.SBSL E. X. as long as you set its default value to be “:ITEM. Form { [TABLES] ImpTable=. [CACHETABLES] TblPAYMENT=SELECT PAYMENT.0.3) Run the script of the example “Ex. before a variable definition (e.3..COMPANY]) .g.0. FORMIMPORT..0 [ImpTable] vSodtype=2..TblPAYMENT.3.13]). Script calling with a specific parameter is performed by adding the parameter name and its value at the end of the execution call (e.COMPANY. SCRIPTNAME:myscript.0.3” (Section CACHETABLES) for a given SODTYPE.1.1. ScriptName:cache1.EXEC ('XCMD: FormImport.1.g. You must indicate a value (i. NAME=1.g. &JOB). COMPANY=2.5.. &..30.mySodtype:12 274 | P a g e .0..0.vSodtype ImpTable...0. 13) with the following syntax: X.4 Run Parameters SBSL provides the ability to set parameters within the code which can be activated when calling the script. SODTYPE=2..0...g..JOB:1).NAME. [TblPAYMENT] PAYMENT=2.0.SBSL E..e.TblPAYMENT(W[SODTYPE=:ImpTable...0.5.1.3 is inside the statement of the dialog parameter vSodtype.0.1. The only change that must be done in the script of example Ex C..0..SODTYPE AS SODTYPE FROM PAYMENT [PANELS] PANEL11=0.. 12) using the syntax: FormImport. &mySodtype) as the default value.&mySodtype vPayment=2.vPayment } By adding this parameter (&mySodtype) you can call the script through form screen using a specific Sodtype (e. Example (Ex E. ScriptName:cache1.1.25.$SODTYPE(W[12. C.0.0...mySodtype:13’) In the same way you can execute the SBSL script through a menu job for a specific SODTYPE(e. Parameters can be inserted using the ampersand symbol.. The name of the script is "cache1"..Payment..50 [PANEL11] ImpTable.Type SODTYPE....Chapter 11 .0 TblPAYMENT=.SYS.25.5. which is the parameter that has to be defined when calling the script.vSodtype AND COMPANY=:X.. SBSL Built-in Functions This section lists all the internal functions you can use in SBSL scripts. Abs(Number: numeric): numeric. x=AddMessage(vMess). See Case Study 1 2.vExcelFile+#39+'. Example TRNDATE = DateOfDateTime(sSalDoc.' + VarToStr(resultnum) + '> successfully!' + #10. Adds a text message to the text of the screen that appears when clicking on the “Results” hyperlink after the execution of a job.' + VarToStr(sDoc. Commit(Connectionstring:string). AddMessage(). Use it when you want to call functions from SoftOne Libraries. 2)). Returns the date for a specific “TDATETIME”. Returns the Source text from “Start” character. Start:integer. Example x = Commit('SoftOne').Chapter 11 . CharToOEM(vLine). Ends the transaction by commiting data from connentionstring.2)'. for the number of “Count” characters. Copy(Source:string. DateOfDateTime(DateTime:TDateTime). VarArray(vFileWrite. Example x = CallPublished('PILib. 275 | P a g e . 'ExcelImport('+#39+:ImpTable. Example Add a text message to the results hyperling of a job with redirection (hyperlink) to specific document records vObject='SALDOC'.1. Returns the absolute value of Number. 2)). CharToOem (var:string).WriteLine'. Params:VarArray).TRNDATE).Evaluate'.FINCODE + '$' + vObject + '.'+#39+'CCCIMPORTEXCEL'+#39+'. Only works on FORMIMPORT calls.FINDOC) + '> to document <' + vFincode + '$' + vObject + '. vMess='Document converted <' + sDoc. Executes the function named “FuntionName” with the parameters defined in “Params”. Converts string to OEM. x = CallPublished('SysRequest. Import Excel file in a SQL table named “CCCIMPORTEXCEL” (using the function Evaluate from SoftOne Library SysRequest and the function ExcelImport from built-in functions). Examples 1.SBSL F. Reupdate sales documents (based on a specific query) by changing the value of the field PAYMENT. CallPublished(FunctionName:string. Count:integer). VarArray(ImportModule('Imp'). Query:string. Pauses execution for the given time calculated in msec. Params:VarArray). ExecSQL(Connection:string. text:string.SBSL DayOfDate(DateTime:TDateTime): integer. ms:integer): TDateTime. Returns the day of the given date. DayOfWeek(): integer. ':1 '. x = ExecPrg('c:\windows\system32\cmd. Delay(Time:Integer). ExecPrg(File:string. Example Returns the vDateL date in SQL format FormatSqlText('SoftOne'. Example fTmp =: X. Example x = ExecSql('SoftOne'. 7=Saturday) DaysinMonth(DateTime:TDateTime): integer. sec:integer. seconds and milliseconds. Params:VarArray). EncodeTime(Hours:integer. if (DayOfDate(fTmp) < 10) fSystemDate = fSystemDate + '0'. Example Delay execution for 2 seconds x = Delay(2*1000). Params:string).SYSDATE. DeQuotedStr (text:string). Example See Case Study 1 FormatSQLText(Connection:string. 2=Monday.CUSTOMERCODE) .Chapter 11 . Executes the sql “Query” statement based on the “Connection” string. (1=Sunday.exe'. Fetch SQLCursorName Retrieves the rows of a SQL statement defined in “SQLCursorName”. Returns the number of days of the month of the given date.vDateL) 276 | P a g e .SYS. fSystemDate = fSystemDate + VarToStr(DayOfDate(fTmp)) + '_'. Null). Returns the “text” in SQL format according to the given parameters. :ImpTable. 'Update TEMP Set Updated = 1 Where CUSCODE=' + QuotedStr(sCustomer. Minutes:integer.…. minutes. Returns text without quotation marks. Returns “TDateTime” for specific Hours. Runs the file with given parameters Example vParams = '/c'. Returns the current day of the week in the form of an index. vParams). 'MyConnection'. Connection:string. Returns the hour in integer form for a specific DateTime. 277 | P a g e . fSystemDate = fSystemDate + VarToStr(GetTimeMin(Time)) + '_'. if (GetTimeHour(fTmp) < 10) fSystemDate = fSystemDate + '0'. Executes the sql “Query” statement and returns the result set. fSystemDate = fSystemDate + VarToStr(GetTimeSec(Time)). null). Query:string. Example fVat = GetQueryResults('SoftOne'. Params:VarArray).SYSDATE. 'SELECT FIELD1. GetTimeSec(DateTime:TDateTime): integer. Works only in CLIENTIMPORT calls.0). Returns minutes in integer form for a specific DateTime. if (GetTimeSec(fTmp) < 10) fSystemDate = fSystemDate + '0'.SYSDATE. Returns seconds in integer form for a specific DateTime. Returns the value of the index element of a zero-based array. GetQueryDataset(Datasetname:string.SYS. Query:string. Fields of the Dataset must be declared in the same order that they appear in the sql statemtn. null).SYS. Example fTmp =: X.SBSL GetIndexVar (Array:VarArray. Params:VarArray). GetTimeMin(DateTime:TDateTime): integer. 'SELECT TOP 1 VAT FROM VAT WHERE ISACTIVE=1'. datagrid in dialog window) with the data returned from the sql “Query” statement.g. Populates a Dataset (e. index:integer). Example if (VarArrayDimCount(fVar) > 0) fVar = GetIndexVar(fVar. GetTimeHour(DateTime:TDateTime): integer. Example x=GetQueryDataset('TblSID'. FIELD2 FROM CCCMYTABLE'.SYSDATE. GetTimems(DateTime:TDateTime): integer.Chapter 11 . Example fTmp =: X. Returns ms in integer form for a specific DateTime. GetQueryResults(Connection:string.SYS. if (GetTimeMin(fTmp) < 10) fSystemDate = fSystemDate + '0'. Example fTmp =: X. vExcelFile+#39+'.vSeries'. Returns the current date and time. Example FINCODE = GrConvert(Trim(sSalDoc. Returns the text converted to Greek characters. ImportModule(Module:string). Returns text in single quotes. Returns the month of the given date.'+#39+'CCCIMPORTEXCEL'+#39+'. ParamWhere:string.vDateL. 2)). Params:String).'SELECT COUNT(*) FROM TRDR WHERE COMPANY='+VarToStr(:X.1032. Pos(Source:string. text:string): integer.SBSL GetWhere(XModule. Now():TDateTime. Creates the sql where clause defined in “ParamWhere” string using and or where depending on Param3. Executes the “Soft1Command” with the given “Params” parameters.VarArray(vModule.2)'. 278 | P a g e . Returns an integer specifying the position of the first occurrence of “text” in “Source” string.3)). OEMToChar (oem:var).COMPANY)+' AND SODTYPE=13 AND CODE='+QuotedStr(VarToStr(fAdd)+VarToStr(fCounter)). ModuleCommand (Module.:ImpTable.1.SYS.1=where)). QuotedStr (text:string). MonthOfDate(DateTime:TDateTime): integer. Example x=CallPublished('ProgLibIntf. Soft1Command. Example vFilters = GetWhere(XModule.VartoStr(resultnum). Returns length of the text.vDateH' +#13+#10+ 'F.Evaluate'. Param3(0=and. Example x = GetQueryResults('SoftOne'. Example Import Excel file from the path defined in the variable vExcelFile in sql table named “CCIMPORTEXCEL” x=CallPublished('SysRequest.SERIES=#:ImpTable. Returns the pointer of the import Module. null).ModuleCommand'. VarArray(ImportModule('Imp'). 'F. Len(text:string): integer. 'ExcelImport('+#39+:ImpTable.Chapter 11 . GrConvert(text:string): string. 0).FINCODE)). Converts OEM key code to characters.TRNDATE=:ImpTable. Only works on FORMIMPORT calls. RollBack(Connectionstring:string). Example Display an exception message if variable vImpOK is not “Yes” if (:ImpTable. 'AND').Evaluate'. Example See Case Study 2 ReplaceStr (text:string. Moreover it updates the internal variable of ImportError system. Example Import Excel file from the path defined in the variable vExcelFile in sql table named “CCIMPORTEXCEL” x = SafeCallPublished('SysRequest. 'TRUNCATE TABLE SID'. VarArray(ImportModule('Imp'). Replaces text in “String1” with the “String2” text. Returns the id of the record that has already been posted.SBSL RaiseException(Message:string). RefreshMemoryTable(MemoryTable:string). SafeExecSQL(Connection:string. Example Ds = RefreshMemoryTable('SERIES'). Params:VarArray). Executes the sql “Query” statement. Null). the exception does not appear on the screen.Chapter 11 . In case of error it does not display the exception and continues the flow of the code.vImpOk=0) x = RaiseException('Run confirmation not selected!!!'). If an error is displayed. Executes the function “FunctionName” from the libraries of the application.2)'. Teminates the process of the script and displays an exception message on the screen. Example x = RollBack('SoftOne'). Params:VarArray). Example Deletes data of SID table from the base (whether created or not). String1:string. Resultnum.1. Example vWhere = ReplaceStr(vWhere. Query:string. //if table does not exist then no error is displayed 279 | P a g e . 'ExcelImport('+#39+:ImpTable.'+#39+'CCCIMPORTEXCEL'+#39+'. x = SafeExecSQL('Export'. 'AND AND'.vExcelFile+#39+'. String2:string). Rolls back data defined from connentionstring. 2)). Refreshes memory Table and returns the pointer. SafeCallPublished(FunctionName:string. SBSL SendResponse(Values. 'CREATE TABLE SID (FR INT. where the last element is the number of variants. Canceled(CanRec).Chapter 11 . Example x = StartTrans('SoftOne'). TableExists(Connection:string. StrToFloat (var:string). Checks if a table named “TableName” exists and returns True or False. n).RESULTS.RESULTS. vTot. Starts a new transaction for the given connectionstring. Example Update the following interface fields: Current(CurRec). Inserts the defined number of spaces. vLabelText. Only works on FORMIMPORT calls. Total(TotRec). vRowCancel.RESULTS.TRNDATE) + Space(1). Fields:string). FV INT)'. Messages(LabelText) x = SendResponse( vRow. Time():TDateTime. StartTrans(Connectionstring:string).TableName:string).CANREC. Converts string to integer. Converts float to string. Trim(text:string): string. VarArray(Var1. 280 | P a g e . StrToDate(text:string):TDateTime. Var2. Example vLine= VarToStr(Exp. Returns the current time. Converts string to Date format. Varn. Space (num:integer).TOTREC.CURREC. Example Check whether SID table exists and creation thereof in case it doesn't if (TableExists('Export'. 'SID') = 'False') x = ExecSQL('Export'. …. Updates the default interface dialog fields of the batch job. StrToInt (var:string). 'RESULTS. Removes spaces and returns the text. Null).LABELTEXT'). Declares an array of variants. 'Category' .3). 3). Returns the module pointer. } VarToStr(Param:Variant).SYSDATE. fSystemDate = VarToStr(YearOfDate(fTmp)). 3) while (i <= VarArrayHighBound(vCaptions.1).0).Chapter 11 . //Returns the 1 st VarArray vSQLCaptions = VarArray('cCODE'. 'cMTRCATEGORY'. '+QuotedStr(GetIndexVar(vCaptions.1)) //Compares i value to the number of the elements of vCaptions(3 elements) { vLang=vLang+'. YearOfDate(DateTime:TDateTime): integer..SYS. Returns the pointer to the Connection. Example vCaptions = VarArray(VarArray('Code'. vMess=vMess + 'Found ' + VarToStr(vRow) + ' files.' XModule(). Dim:integer). Example fTmp =: X. VarArray('Code'. i=i+1. vCaptions = GetIndexVar(vCaptions. 2). Returns the number of dimensions of the Array. VarArrayHighBound(Array:VarArray. Example vRow = 100. Returns the number of elements in the Array for dimension Dim..SBSL VarArrayDimCount (Array:VarArray).i). Example if (VarArrayDimCount(fVar)>0) fVar=GetIndexVar(fVar. XSupport(). 'Description'. 'Category'. 'Name'. 281 | P a g e . Converts Param to string.i))+' AS '+GetIndexVar(vSQLCaptions. 'cNAME'. Returns the year of the given date. COMPANY. ''. ''. ''. Company. fModule = CreateSupport (''.SBSL G. Example vData = GetTextValue('CheckImportData'). SoftOne Libraries In this module you will find an analysis of the SoftOne Libraries. 282 | P a g e .SYS. Example include ‘ModuleIntf’. 2)). Frees the connection created to Soft1 from “CreateSupport” function. fModuleName = ‘SALDOC’.Chapter 11 . 1000.SYS.SYS. SoftOne script) of the application. Opens or closes the sub form called SubFormName. :X. Password. CreateSupportModule(SupportHandle. SubFormName. The form always opens in modal mode. fCompany. fModuleName). VarArray(:X. G. Branch. including all methods and functions you can call from SBSL script. fDefaultBranch = CallPublished('ProgLibIntf.1 ModuleIntf CreateSupport(XCOfile.SYS. or directly after prior definition of the specific library using include command. Example x = DestroySupport(fSupport). 1000. If the first three parameters (XCOfile. UserName. DestroySupport(SupportHandle). Password) are omitted then the parameters from the login connection are used. Creates a new connection to a SoftOne database defined from the “XCOfile”. LoginDate). //Returns the data of the script “CheckImportData” in text format. OpenSubForm(ModuleHandle. GetTextValue(TextName).LOGINDATE). ModuleName).USER.LOGINDATE). fDefaultBranch. Example vSupport = CreateSupport (''.WARNINGS:OFF'). Creates an instance of a module (SoftOne object) for the Connection specified from “CreateSupport” function. OpenMode accepts the following values: 1 : Opens the sub form and fires the event “Before show form” -1: Closes the sub form and fires the “OK” event -2: Closes the sub form and fires the “Cancel” event CreateModule(ModuleName).g. OpenMode). UserName. Reads the Resources from the pre files (e. Example vModule = CreateModule('CUSTOMER.GetDefaultBranch'. Commands are called either by using the Callpublished function. fCompany. Creates an instance of module (SoftOne object) only for the current login connection. :X. fCompany=:X. fModule = CreateSupportModule(vSupport. ''. Chapter 11 . x = CallPublished('ModuleIntf. vTask. var x.vTask).PostModule'. x = CallPublished('ModuleIntf. Deletes a record of a module (ModuleHandle) that is previously located. Changes the status of a module (SoftOne object) to insert mode in order to accept data. fModule. Destroys the Module created with “CreateModule” or “CreateSupportModule” functions.'Inserted from SBSL script'. x = LocateModule(fModule.DatasetEdit'.VarArray(vTask.'SOACTION'. fModule). fModule = CallPublished('ModuleIntf. Example Insert a new task with series 1003 and comments ‘Inserted from SBSL script’ This specific example does not ‘include’the library ModuleInf but alternatively it uses the function CallPublished to execute the functions of the library. Locates a record of a module (ModuleHandle) based on the RecordID.SetFieldValue'.3)).'COMMENTS'. x = CallPublished('ModuleIntf.1003. x = LocateModule(fModule. x = CallPublished('ModuleIntf.InsertModule'.'SERIES'. 283 | P a g e . fModule). x = CallPublished('ModuleIntf. RecordID).SBSL DestroyModule(ModuleHandle). vTask = CallPublished('ModuleIntf. var x.vTask). Example Delete the customer with id = 11999.3)).GetDataset'.DatasetPost'. fModule).2)). Example x=DestroyModule(fModule).WARNINGS:OFF. fModule = CreateModule('CUSTOMER. fModule. include ‘ModuleIntf’.NOMESSAGES:1').'SOTASK. vCustomerID). InsertModule(ModuleHandle). vCustomerID = 11999. x = DeleteModule(fModule). x = CallPublished('ModuleIntf.WARNINGS:OFF').VarArray(vTask.CreateModule'. vCustomerID).WARNINGS:OFF'). vCustomerID = 11999. LocateModule(ModuleHandle. x = CallPublished('ModuleIntf. Example fModule = CreateModule('CUSTOMER. vCustomerID. DeleteModule(ModuleHandle).VarArray(fModule.DestroyModule'.SetFieldValue'. CODE x = SetFieldValue(vTableTRDR. fModule.’1000’). fModule = CreateModule('CUSTOMER. x = PostModule(fModule). x = DatasetEdit(vTableTRDR).'MyParameter'. Posts in the database the data of a module (SoftOne object). Name). Returns the ParentModule of the current Module GetChildModule(ModuleHandle.’2000’).'TRDR'). fModule.’TempCustomer’). 10). 'CODE'. //Sets name ’TempCustomer’to field TRDR. vTableTRDR = GetDataset(fModule.'TRDR').WARNINGS:OFF'). x = SetFieldValue(vTableTRDR. Returns the Dataset of the Module Example Insert new supplier with code ‘2000’ and name ‘TempSupplier’ include ‘ModuleIntf’. x = PostModule(fModule). GetParentModule(ModuleHandle). var x. Name). x = DestroyModule(fModule). fModule = CreateModule('CUSTOMER. x = DatasetEdit(vTableTRDR). 'NAME'. Example Insert new customer with code ‘1000’ and name ‘TempCustomer’ include ‘ModuleIntf’. PrmName. applying all SoftOne methods.SBSL PostModule(ModuleHandle). GetParamValue(ModuleHandle. PrmValue). 'NAME'.’ TempSupplier’). SetParamValue(ModuleHandle. //Sets name ’ TempSupplier’to field TRDR. x = InsertModule(fModule). PrmName). 'CODE'. vTableTRDR = GetDataset(fModule. x = InsertModule(fModule). //Sets code 2000 to field TRDR. vTableTRDR. Sets a new value in the parameter “PrmName” of the Module.NAME x = DatasetPost(vTableTRDR).’MyParameterName').WARNINGS:OFF'). //Sets code 1000 to field TRDR. Returns the value of PrmName Example vFile = GetParamValue(XModule.Chapter 11 . Returns the ChildModule of the current Module GetDataset(ModuleHandle.'SERIES'). vTableTRDR. x = SetFieldValue(fDataset. Example fDataset = GetDataset(vModule. x = DestroyModule(fModule). //Creates a new parameter (MyParameter) and sets its value to 10 284 | P a g e .NAME x = DatasetPost(vTableTRDR). var x.CODE x = SetFieldValue(vTableTRDR. x = SetFieldValue(vTableTRDR. Chapter 11 .2)). x = DatasetInsert (fIteLines).'FISCPRD')). vfindocID. ‘Comments from SBSL script’.SetFieldValue'. x = CallPublished('ModuleIntf. 285 | P a g e . DatasetInsert(DatasetHandle).'SALDOC').CreateModule'. fModule=CreateModule('SALDOC. fModule. dsFinDoc = CallPublished('ModuleIntf.VarArray(DsFinDoc.'ITELINES'). 3)). fIteLines = GetDataset(fModule. x = CallPublished('ModuleIntf. fModule. Returns True if a record is found in Dataset and then locates it.'SALDOC. Module ). 'COMMENTS'.DsFinDoc).VarArray(Module. dsFinDoc. vfindocID. This specific example uses the CallPublished function instead of include ‘ModuleIntf’ var x. Example Locate a record in Sales document (id=1000) and add comments ‘Comments from SBSL script’. fSalDoc. Opens a new. var x.DatasetEdit'. x = DatasetLocate(vFISCPRD. Puts the Dataset to Edit state.'FINDOC'. DatasetEdit(DatasetHandle). empty record before the current record. Creates a Dataset named “DatasetName” DatasetLocate(DatasetHandle. FieldNames. GetFieldValue(vQUESTIONS.GetDataset'.WARNINGS:OFF. DatasetName).LocateModule'.WARNINGS:OFF'). x = CallPublished('ModuleIntf. FieldValues). vfindocID = 1000. fSalDoc = GetDataset(fModule. 'FISCPRD'.PostModule'. fModule = CallPublished('ModuleIntf. fIteLines. x = CallPublished('ModuleIntf.NOMESSAGES:1'). and makes the empty record the current one so that field values for the record can be entered by code.2)).SBSL CreateDataset(ModuleHandle. Example include ‘ModuleIntf’. x = InsertModule(fModule). Example vFISCPRD = RefreshMemoryTable('FISCPRD').VarArray(Module. fModule = CreateModule('ITEM. } DatasetPrior(DatasetHandle).’101’).'QTY1'. var x. x = SetFieldValue(fDsMtrsubstitute. x=DatasetPrior(vMyTable).1). Moves to the last record of the Dataset Example x=DatasetLast(vMyTable). x = SetFieldValue(fDsMtrsubstitute. 'SELECT FINDOC FROM FINDOC WHERE…. DatasetFirst(DatasetHandle).Chapter 11 . x = DatasetAppend (fDsMtrsubstitute). fDsMtrsubstitute = GetDataset(fModule. Example Insert new substitute item(code 101) in table MTRSUBSTITUTE for the located item with id=1000.'MTRSUBSTITUTE').'NAME'.SBSL DatasetAppend(DatasetHandle). Moves to the previous record of the Dataset Example vMyTable = GetDataset(XModule. x = DestroyModule(fModule). x = SetFieldValue(fDsMtrsubstitute. x = DatasetNext(Ds). fModule. include ‘ModuleIntf’. DatasetEof(DatasetHandle). x = DatasetPost(fDsMtrsubstitute). Opens a new. DatasetLast(DatasetHandle). null) while (DatasetEof(Ds)=0) { .. vMTRLID)..'.'CCCMYTABLE'). Returns True if the Dataset is on the last record Example Ds=GetSQLDataset(0.NOMESSAGES:1'). 286 | P a g e .WARNINGS:OFF. Moves to the first record of the Dataset Example x=DatasetFirst(vMyTable)..'CODE'. fDsMtrsubstitute. x = PostModule(fModule). vMTRLID = 1000. vMTRLID. x = LocateModule(fModule. empty record at the end of the Dataset and makes the empty record the current one so that field values for the record can be entered by code.’SubItem101’). //Sets name ’ TempSupplier’to field PRJC. Returns the State of the Dataset. Applies “Filterstring” filter to Dataset 287 | P a g e .'PRJC'). 1=dsBrowse Dataset open. 3=dsInsert Dataset open. //SoftOne object is PRJC x = InsertModule(fModule). //Sets code 10 to field PRJC. Indicates that a filter operation is under way.’10’).SBSL DatasetNext(DatasetHandle). and no data can be changed. //Table is named PRJC x = DatasetEdit(vTablePRJC). A new row is inserted or appended. Data unavailable. x = DestroyModule(fModule). This is the default state of an open Dataset. but not changed. fModule = CreateModule('PRJC. A restricted set of data can be viewed. DatasetState(DatasetHandle). The available values are summarized below: 0=dsInactive Dataset closed. var x. Data can be viewed. Filterstring).CODE x = SetFieldValue(vTablePRJC.NAME x = DatasetPost(vTablePRJC). 'NAME'. 'CODE'. vTablePRJC = GetDataset(fModule. Posts the current record to the Dataset Example Insert new project with code ‘10’ and name ‘Project from SBSL script’ include ‘ModuleIntf’. DatasetSetFilter(DatasetHandle. fModule. vTablePRJC.Chapter 11 . Moves to the next record of the Dataset Example x=DatasetNext(vMyTable). Deletes the current record of the Dataset Example x=DatasetDelete(vMyTable). x = PostModule(fModule). x = SetFieldValue(vTablePRJC.WARNINGS:OFF'). 2=dsEdit Dataset open. DatasetDelete(DatasetHandle).’ Project from SBSL script’). DatasetPost(DatasetHandle). 6=dsFilter Dataset open. The current row can be modified. GetFieldType(DatasetHandle.'INST'). 0). Returns the field value for the located record of a dataset SetFieldValue(DatasetHandle.png) include ‘ModuleIntf’. This function provides the ability to send the queries once.vMTRLID. ‘C:\myimage. 11=DateTime.'ITEDOCDATA'). DatasetHandle. x = DestroyModule(fModule). vMTRLID = 100. FieldName. Saves data in a blob (image) field of a dataset. Value: 0= Disable links.SBSL SetDatasetLinks(ModuleHandle. x = InsertModule(fModule). x = SetValueFromFile(vIteDocData. DatasetRecordCount(DatasetHandle). FieldName). Returns a number that applies to the type of the field. Returns the number of records in the Dataset DatasetOpen(DatasetHandle). fDsInst = GetDataset(fModule. vMTRLID). fModule. vIteDocData = GetDataSet(Module. FieldName). Assigns a value in the field for the located record of a dataset SetValueFromFile(DatasetHandle.png’). fFieldType = GetFieldType(fDs. x = DataSetPost(vIteDocData). When you populate a Dataset that has fields linked to tables. when all records are filled. x = SetDatasetLinks(fModule.WARNINGS:OFF'). Values returned are: 1=String. 4=Word. FileName). FieldValue). x = LocateModule(fModule. fFieldsCounter). 1= Enable links Example fModule=CreateModule('INST.Chapter 11 . then for every record added. vIteDocData. 16=Memo Example fField = DatasetFieldName(fDs. var x. fDsInst. x = PostModule(fModule).'SODATA'. GetFieldValue(DatasetHandle. FieldName. Example Locate an item with id=100 and insert an image from file (C:\myimage. 3=Integer. Value). a query runs for each of these fields in order to link them to the tables. Sets Dataset in Open state DatasetClose(DatasetHandle). fField). 6=Float. Closes the Dataset 288 | P a g e . x = DataSetEdit(vIteDocData). fModule = CreateModule('ITEM'). 2=Smallint. Label). SQLStatement. FieldName). 9=Transfer GetBandXProperty(BandHandle. NAME FROM CCCMYTABLE ORDER BY CODE. 4=Visible. Returns the field name of a Dataset based on the index of the field GetSQLDataset(SupportHandle. PropertyValue). 2=Width. Returns the number of fields of a Dataset DatasetFieldName(DatasetHandle. FieldName.RecNo). Size. Params). Enables Windows Controls to the Dataset DatasetFieldCount(DatasetHandle). Adds a new column in the Band DeleteBandField(BandHandle. Returns the properties of a column of the Band AddBandField(BandHandle. Return the Module Band SetBandXProperty(BandHandle. Returns a Dataset based on the SQL statement. GetBand(ModuleHandle. Type. Sets the column properties of the Band Property Types: 1=Caption. NAME'. 8=DebitCredit. Returns the Dataset field AddFieldToDataset(DatasetHandle. Deletes a Band column GetField(DatasetHandle. FieldName). null). 'SELECT DISTINCT CODE. Example Ds=GetSQLDataset(0. FieldName). Disables Windows Controls to the Dataset DatasetEnableControls(DatasetHandle). PropertyType. PropIndex). FieldIndex). Adds a field to a Dataset 289 | P a g e . BandName). 7=HasSums.Decimals.SBSL DatasetRecNo(DatasetHandle). FieldName. Returns the location of a record in the Dataset DatasetSetRecNo(DatasetHandle.Chapter 11 . Sets the location of a record in the Dataset DatasetDisableControls(DatasetHandle). FieldName. Changes the Editor of a field ResolveEditors(ModuleHandle. Value). TableName). Text message is saved in the EventLog. Property.’TRUE’) DebugString(text:string) published 'ModuleIntf.3 (eg ‘PANEL’. 290 | P a g e . Sets the property defined to a Module with parameters 1. ControlName. Follows SetFieldEditor and activates new Editors on the table SetProperty(ModuleHandle. Editor. FieldName.DebugString'. ControlType. ClearOld).Chapter 11 .SBSL SetFieldEditor(ModuleHandle.’VISIBLE’.2.’PANELNAME’. 009'+#13+#10+ 'WHOUSE=079. Creates file “FileName” file. if (FileExists(FileName)='True') { //….003'+#13+#10+ 'FINCODE=067. Deletes file FileName.FieldsInfo). x= AsciiImport(vParamsInfo. Checks whether the file exists.'+#13+#10+ 'DECIMALSEPARATOR=. Decimals seperator.SBSL G.2 PiLib AsciiImport(ParamsInfo.039'+#13+#10+ 'TPRMS=063.txt'+#13+#10+ 'THOUSANDSEPARATOR=. Date format). ASCII file path. NewName:string). Renames the file “OldName” file to “NewName”.012'+#13+#10+ 'NAME=023. vFieldsInfo). RenameFile(OldName:string. vFieldsInfo = 'TRNDATE=1.Chapter 11 . Reads an ascii file with a specific layout and imports it in a table that is already created in the database. ParamInfo = Parameters (Table name.'+#13+#10+ 'FIRSTLINE=1'+#13+#10+ 'OEMCONVERT=1'+#13+#10+ 'DATEFORMAT='.012'+#13+#10+ 'COMMENTS=149. vParamsInfo = 'TABLENAME=test_table'+#13+#10+ 'ASCIINAME=C:\myDir\myfile. 291 | P a g e . Example include ‘PiLib’.8'+#13+#10+ 'CODE=010.005'+#13+#10+ 'QTY=098. FileExists(FileName:string). } DeleteFile(FileName:string).012'+#13+#10+ 'TRNVALUE1=137.039'. Convert chars to 437.\folder1 '+'Myname. FieldsInfo = Fields layout include ‘PiLib’. CreateText(FileName:string). Example vFileName='.log'.001'+#13+#10+ 'TRDCODE=082. Example vFileDel = DeleteFile(FileName). First line to insert. Example x=WriteLine(vFile. EOF(FileName:string). Writes text 'Text' in file “FileName”. Text:string).SBSL vFile=CreateText(vFileName).Chapter 11 . Closes file FileName.TXT'. Opens file “FileName” file for Read or Write. ' Start job'). ReadLine(FileName:string). Writes a line with 'Text' text in file FileName. } CloseText(FileName:string). 292 | P a g e . } WriteLine(FileName:string. Opens file FileName and reads all its contents. OpenText(FileName:string). Example while (Eof(vFile)=0) { vLine=ReadLine(vFile). Text:string). Example x = ReadFile(vFile). Example vFile=OpenText(:ImpTable. Example x = WriteTextToFile(vPath+'PL-'+VarToStr(sDoc. WriteTextToFile(FileName:string. Example x = ReadTextFromFile(vFile).vFile). vText). replacing any other text in the file. Checks if the “FileName” has reached the end of the file. Example x=CloseText(vFile). Example while (Eof(vFile)=0) { vLine=ReadLine(vFile). which was opened with “OpenText” function.FINDOC)+'. ReadFile(FileName:string). ReadTextFromFile(FileName:string). Read the current line of the file “FileName”. Opens file FileName and reads it in Stream. Converts text 'Text' from UTF8 to ANSI. faArchive = 32.*'. Sets value 'Value' in the record having the Name parameter in the string list. 63). Example x = AnsiToUtf8(vLine). Params:VarArray). Query:string. TStringsGetValue(TStringsHandle. Fields are separated with ‘|’ and entries with ‘|~’ FindFirst(FileName:string. Example x = FindClose(vFind). Example x = Utf8ToAnsi(vLine).SBSL AnsiToUTF8(Text:string). Value:Variant). Attr:integer).g. Returns the result of the Query of the Handle stated in compressed format. File Attributes: faReadOnly = 1. faSysFile = 4. FindClose (FileHandle:FindFirstResult). faVolumeID = 8. TStringsSetValue(TStringsHandle. Returns the value of the record of the string list on the basis of Name parameter. Searches for a file with specific name and attributes. Returns a value or an Array. TStringsClear(TStringsHandle). It is the same as the string lists of the application. CODE=Test1). Params:VarArray). Name:string). Clears the data of the string list. Name:string. TStringsCreate(). GetSupportQueryResults(Support:Handle. Example vFind = FindNext(vFind). FindNext(FileHandle:FindFirstResult). Creates a list of strings having the format Name = Value (e. faDirectory = 16. 293 | P a g e . GetSupportQueryData(Support:Handle. faAnyFile = 63 Example vFind = FindFirst ('C:\*. UTF8ToAnsi (Text:string). Frees the memory after using FindFirst or FindNext functions. Query:string. Converts text 'Text' from ANSI to UTF8.Chapter 11 . Searches for the next file with the specific name and attributes. Returns the value for the Query of the Handle stated. faHidden = 2. Chapter 11 - SBSL TStringsGetItem(TStringsHandle, Index:integer); Returns the value of the string list record based on record Index. TStringsSetItem(TStringsHandle, Index:integer, Value:Variant); Sets value 'Value' in the string list based on the record Index. TStringsAdd(TStringsHandle, DataStr:string); DataStr Structure: Value = Name Adds “DataStr” data to the next record in the string list. TStringsCount(TStringsHandle); Returns the number of records in the string list. GetXStrings(Name); Returns the data of the “Name” string list. 294 | P a g e Chapter 11 - SBSL G.3 SysRequest DestroyObject(ObjectHandle); Frees memory of the defined object. Example x = DestroyObject( fObject); DoSendMail2(TO, CC, BCC, Subject, BodyText, BodyHTMLText, Attachment, FromName); Sends email to the given recipient with the parameters defined. The email is sent using the settings you have defined for the outgoing email in SoftOne general settings window. You can omit the last parameter (FromName). Example strTO = ‘[email protected]’; strCC = ‘’; strBCC = ‘’; strSubject = ‘Email Subject’; strBodyPlain = 'Email plain text – no html'; strBodyHTML = ‘Dear Sir,<br>…' strFromName = 'Last Name First Name'; strAttachment = ‘C:\myfile.txt’; x=CallPublished('SysRequest.doSendMail2', VarArray(strTO, strCC, strBCC, strSubject, strBodyPlain, strBodyHTML, strAttachment, strFromName, 8)); Evaluate(Module, InternalFunction:string); Executes the internal function of the application. Example Get the id of a customer (Customer Code = 50) using the internal function ID. sExpr = 'ID(' + QuotedStr('CUSTOMER') + ',' + QuotedStr('50') +')'; id = CallPublished('SysRequest.Evaluate', VarArray(ImportModule(CUSTOMER'),sExpr, 2)); ExecuteXScript(Module, Language, ScriptName, Function); Runs the Function of the script named “ScriptName”. Use it when you want to create your own libraries and call functions from them. Language: 1 = Javascript, 2 = VBScript Examples 1.Create a function inside a text string and run it The function displays a message box in the screen.. x=ExecuteXScript(XModule, 1, 'function RUN() { X.WARNING('+#39+'TextMessage'+#39+');}', 'RUN'); 2. Call and execute a function from a script named “myfunctions”. vScript=GetQueryResults('SoftOne', 'SELECT SOIMPORT FROM SOIMPORT WHERE CODE =' +QuotedStr('myfunctions'), Null); x= ExecuteXScript(vModule, 1, vScript, 'Convert'); GetNewID(Module); Returns the id of the record that has already been posted to “Module”. GetTableFieldInfos(TableName); Returns text containing information for each field in the table. 295 | P a g e Chapter 11 - SBSL GetTableFieldNames(TableName); Returns the field names of table “TableName”. GetTableMoreInfo(TableName); Returns text with the table information. GetXplorerDataDir(Params); Returns the installation directory of SoftOne application. GetXplorerLogDir(Params); Returns the directory of log files. GetXplorerOffLineDir(Params); Returns the directory of offline files. GetXplorerTempDir(Params); Returns the directory of temp files. PrintForm(Module, Form, Printer, FileName); Prints the form defined by the 'Form' code for the given Module and Printer. In case of printing to a file, then FileName must be defined. Example Locate the record id=1000 in purchase documents and print it to ASCII file using the form with code=100. iFINDOC = 1000; vFile = 'C:\\Softone\\‘ + VarToStr(:X.SYS.COMPANY) + '_' + iFINDOC + '.TXT'; // ASCII File Name and Path vPURModule = CallPublished('ModuleIntf.CreateModule','PURDOC,WARNINGS:OFF'); x = CallPublished('ModuleIntf.LocateModule',VarArray(vPURModule,iFINDOC,2)); //Locate record x = CallPublished('SysRequest.PrintForm', VarArray(vPURModule,100,'928', vFile,4)); //Save to ASCII file RequestEdit(Command:string); Executes the command. It works only on a client. Example Execute the custom design report named “Myreport” filtered for TRDR = 1000. Dialog filter field linked to TRDR is “USRREPORTV1L”. var vTRDR, sObj, x; vTRDR = 1000; sObj = 'REPORT[LIST=EpistoliOikon,FORCEFILTERS=USRREPORTV1L='+VarToStr(vTRDR)+', AUTOEXEC=1]' ; x = CallPublished('SysRequest.RequestEdit', sObj); ShowHtmlMessageForm(TStringsHandle); Opens a Web form with the text set defined in the “TStringsHandle” string list.. Similar to the results screen of a SBSL script. Example fText = 'mytext'; fStrings = TStringsCreate; x = TStringsSetText(fStrings, fText); x = ShowHtmlMessageForm( fStrings); 296 | P a g e Chapter 11 - SBSL ShowInTheMap(Params1, Params2, Params3); Params1: Latitude, Params2: Longitude, Params3: Web Form to open. Returns in a web form the location defined by the coordinates. Example vDs=CallPublished('ModuleIntf.GetDataSet',VarArray(XModule,'GPNT',2)); vFld1=CallPublished('ModuleIntf.GetFieldValue',VarArray(vDs,'SOWIDTH',2)); vFld2=CallPublished('ModuleIntf.GetFieldValue',VarArray(vDs,'SOLENGTH',2)); vFld3=CallPublished('ModuleIntf.GetFieldValue',VarArray(vDs,'CODE',2)); Data=CallPublished('SysRequest.ShowInTheMap', VarArray(vFld1,vFld2,vFld3, 3)); ShowWebPage(URL:string); Opens the HTML page defined by the URL string. Example x = ShowWebPage('www.softone.gr') 297 | P a g e Chapter 11 - SBSL H. Case Studies Case Study 1 Reupdate sales documents (based on a specific query) by changing the value of the field PAYMENT. form { } connect Xplorer xData { connect(); findoc=select findoc, sosource, fincode, trndate, sumamnt from findoc where company=:$X.SYS.COMPANY and fiscprd=:$X.SYS.FISCPRD and sosource = 1351 and fprms in (7061,7062,7063,7064,7066,7067,7071,7072,7073,7076,7082,7127,7128) --and trndate = '20020110' order by 1 desc; } var x, Module, DsFinDoc, Dslines, vFieldVal, vFieldVal1, Count; { Module = CallPublished('ModuleIntf.CreateModule','SALDOC,WARNINGS:OFF,NOMESSAGES:1'); DsFinDoc = CallPublished('ModuleIntf.GetDataset',VarArray(Module,'FINDOC',2)); Count = 0; fetch finDoc { Count = Count + 1; } x = SendResponse(Count, 'RESULTS.TOTREC'); Count = 0; fetch findoc { x = CallPublished('ModuleIntf.LocateModule',VarArray(Module,findoc.findoc,2)); Count = Count + 1; x = SendResponse(Count, 'RESULTS.CURREC'); x = CallPublished('ModuleIntf.DatasetEdit',DsFinDoc); x = CallPublished('ModuleIntf.SetFieldValue',VarArray(DsFinDoc, 'PAYMENT', 1000, 3)); x = CallPublished('ModuleIntf.PostModule', Module ); } x=SendResponse(Count, 'RESULTS.CURREC'); } 298 | P a g e Chapter 11 - SBSL Case Study 2 Import customers from Excel file into a temp table of the database and then insert the records in the customers module. This specific script works with an excel file that has columns with specific headers (Line, Name, VAT, City, Address, Branch code). Form { [TABLES] ImpTable =;;;; Master; 3; 0 [ImpTable] vMess=16;64000;0;1;1;Transfer messages...;;;; vExcelFile=1;4000;1;1;0;Excel file;$Filename;;'C:\test1.xlsx'; vDBTable=1;64;1;0;0;TableName;;;;CCCEXCEL_CUST vDrop=2;15;1;0;0;Drop and Create Table;$Y;;1; vInsRec=2;15;1;0;0;Insert Records;$Y;;1; [PANELS] PANEL10=0;;0;50,G10,N PANEL13=4;Transfer messages...;0;100,G10,N,L3 [PANEL10] ImpTable.vExcelFile ImpTable.vDBTable ImpTable.vDrop ImpTable.vInsRec [PANEL13] ImpTable.vMess } Import ImpCUSTOMER(sCus,sCusBranch) into 'CUSTOMER,WARNINGS:OFF,NOMESSAGES:1' { CUSTOMER sCus { CODE = '*'; NAME = sCus.cNAME; AFM = sCus.cAFM; CITY = sCus.cCITY; ADDRESS = sCus.cADDRESS; } CUSBRANCH sCusBranch { CODE = sCusBranch.bCODE+'.01'; NAME = sCusBranch.bNAME; ISCENTER = sCusBranch.bISCENTER; ADDRESS = sCusBranch.bADDRESS; CITY = sCusBranch.bCITY; } } Connect Xplorer SoftOne { connect(); 299 | P a g e CUSTOMERS IMPORT.vDBTable+#39+'. Ds.RESULTS.Line .1.RESULTS.RESULTS. vRowCancel.RESULTS.[Address] AS cADDRESS FROM $REMOVEQUOTES(:$ImpTable. x = SendResponse( vMess.vDBTable). vModule. 0. vRow.[VAT] AS cAFM .SBSL sCus = SELECT [Line] AS Line . Null ). x = CallPublished('SysRequest. x = SendResponse( vTot. objExcel. newCusCode.[City] AS bCITY FROM $REMOVEQUOTES(:$ImpTable.. } var Jstr.2)'. { vError=0.1 AS bISCENTER . 'Start job. vMess.'. 0. ifin.vExcelFile+#39+'. x=SendResponse( vTot. 'ExcelImport('+#39+:ImpTable. vSalesman. vTask.'+#39+:ImpTable. vRowCancel.RESULTS.vInsRec = 1) { ImpCUSTOMER(sCus.[Name] AS cNAME .vDBTable. vRow. 'Customer Import.CURREC.'DROP TABLE ' + :ImpTable.Table initialization ======= if(:ImpTable. x.TOTREC. vMess = vMess + 'A. vMess=''. str1. '+#13+#10. if (vError=0) { vMess = '============== J O B S T A R T =============='+#13+#10+#13+#10.CANREC.sCusBranch). fetch sCus vTot = vTot + 1. 300 | P a g e . vTot.vMess').'SELECT CODE FROM TRDR WHERE TRDR='+VarToStr(resultnum). 'RESULTS.vMess.[Name] AS bNAME . 2)).NULL).vDBTable) WHERE [Line] = :$sCus. vTot = 0.Table Initialization ======= //>>>============ Insert CUSTOMER (Customers) ================ vCurRec = 0.RESULTS.CURREC. vMess. } //<<<======= Transfer Excel to SQL Table ..LABELTEXT' ). vMessErrors. fetch sCus { if(:ImpTable.TOTREC. vCurRec = vCurRec + 1. sCusBranch = SELECT [BranchCode] AS bCODE .Evaluate'.[City] AS cCITY .vDrop=1) { x = SafeExecSQL('SoftOne'. vscript. VarArray(ImportModule('ImpCUSTOMER'). if (ImportError = 0) { newCusCode = GETQUERYRESULTS('SoftOne'. vError. vRowCancel = 0..ImpTable. vMessTask. vCurRec.CANREC' ). //>>>======= Transfer Excel to SQL Table ..'.LABELTEXT.Chapter 11 ..[Address] AS bADDRESS . 'RESULTS.'ImpTable.. 'RESULTS.. } } 301 | P a g e . vRowCancel.ERROR .RESULTS. vMess.RESULTS..vMess' ).CUSTOMER IMPORT COMPLETION'+#13+#10+#13+#10.'.ImpTable.CURREC. x = SendResponse(vTot.TOTREC. x = SendResponse(vTot.CURREC.[Branch code]='+QUOTEDSTR('error')+' WHERE LINE='+VartoStr(vCurRec). x=SafeExecSQL('SoftOne'.cSalesman. Name: '+VartoStr(sCus. vCurRec.'UPDATE ' + :ImpTable.ImpTable. x=SendResponse(vCurRec. vRowCancel. Null ).'UPDATE ' + :ImpTable. vMess.vMess. Null ). vMess = vMess + ' ' + VartoStr(vCurRec) + '.ImpTable..CANREC.'+ ErrorMessage+#13+#10..TOTREC.RESULTS. } } vMess = vMess + '.LABELTEXT'). vRowCancel.[Branch code]='+QUOTEDSTR('01')+' WHERE LINE='+VartoStr(vCurRec).cName) +' .OK . vMess. Name: ' +VartoStr(sCus. //<<<============ Import CUSTOMER (Customers) ================ vMess = vMess +#13+#10+ '============== J O B E N D ================'+#13+#10. x=SafeExecSQL('SoftOne'. 'RESULTS.New Code: '+VartoStr(newCusCode)+#13+#10. 'RESULTS.vMess' ).vDBTable + ' SET [Customer code]='+QUOTEDSTR('error')+'.CURREC. vCurRec.CANREC. } vSalesman = sCus..SBSL vMess = vMess + ' ' + VartoStr(vCurRec) + '.cName)+ ' .Chapter 11 .RESULTS.RESULTS. } else { vRowCancel = vRowCancel+1. 'End of job.CANREC.vDBTable + ' SET [Customer code]='+VartoStr(newCusCode)+' ..RESULTS. vMess.COMPANY and fiscprd=:$X.7067.7073.7063.G10.SYS.SYS.0.7076.7064.7072. [PANELS] PANEL13=4.Transfer messages.7062.64000. LINEVAL = sDoc....TRDR. sosource. fincode. Master. } } connect Xplorer xData { connect(). COMMENTS = 'Import from Import Script'..sumamnt. } CashLines sDoc { SOPAYTYPE = 1. vRow.7082. vFieldVal... trdr.Transfer messages.vMess } Import ImpCFNCUSDOC(sDoc) into 'CFNCUSDOC.0. Module. TRNDATE = sDoc. DsFinDoc. { vTot = 0.. Dslines..N.FINDOC. } var x.7066.SBSL Case Study 3 Batch job that inserts customer collections for specific documents (based on sql query) Form { [TABLES] ImpTable =. 0 [ImpTable] vMess=16. vFieldVal1. trndate. FINDOCS = sDoc.Chapter 11 ..WARNINGS:OFF. TRDR = sDoc. fetch sDoc vTot = vTot + 1.100.L3 [PANEL13] ImpTable.. vTot.FISCPRD and sosource = 1351 and fprms in (7061. sumamnt from findoc where company=:$X. 3.7127.1.TRNDATE. sDoc = select findoc.7128) and trndate = '20030110' order by 1 desc..NOMESSAGES:1' { FinDoc sDoc { SERIES = 3800.7071. 302 | P a g e .1. Count.. vRowCancel. CANREC').TOTREC.'+#13+#10.CANREC.RESULTS. 'End of import of collection documents..ImpTable..vMess' ).'. x = SendResponse( vTot.Chapter 11 . 'RESULTS.'. } 303 | P a g e ..ImpTable. x=SendResponse(vRow.SBSL vMess = 'Start job. 'Import collection documents.vMess. vMess. fetch sDoc { ImpCFNCUSDOC(sDoc)..LABELTEXT.. vMess. vRowCancel.RESULTS. 0. } vMess=vMess+'End of transfer. if (ImportError = 0) vRow = vRow + 1.RESULTS.RESULTS. else vRowCancel = vRowCancel + 1.CURREC. 'RESULTS... 0.. x=SendResponse(vRow.LABELTEXT').CURREC.'+#13+#10.RESULTS.CURREC.RESULTS..CANREC. 'RESULTS.. vRowCancel. APPENDIX APPENDIX Common Parameters & Commands A. SoftOne Object Types (Sodtype) B. SoftOne Transaction Objects (SoSource C. System Parameters (X.SYS) D. Menu Jobs / System Tools (acCommands) E. Editor Commands F. Built-in Editors G. Transactions Source Types (Origin) H. Related Jobs / Commands I. Browser Job Commands 304 | P a g e APPENDIX A. Softone Object Types (SodType) The following table contains all the values of the sodtype internal string list. SODTYPE Table Code Module Code Module 10 Internal use only 51 Inventory 11 Company 52 Services 12 Suppliers 53 Credits/Debits 13 Customers 54 Fixed assets 14 Cash accounts 61 Revenue/Expense accounts 15 Debtors 70 Item sets 16 Creditors 71 Bills of materials 20 Company employees 72 Debits/Credits set 21 Contacts 73 Service sets 22 Draft Entry 81 Cheques 25 Resources 82 Costing 30 Salesmen 83 Gift vouchers 31 Collectors 89 General ledger 32 Buyers 90 Cost accounting 33 Technicians 91 ABCosting 40 Projects 95 Payroll 41 Installations 96 Actions 42 Special contracts 97 Call centers 43 Geographic points 44 Warranties 305 | P a g e APPENDIX B. Softone Transaction Objects (SoSource) The following table contains all the values of the sosource internal string list. SOSOURCE Table Code Module Code Module 1010…1019 Custom business documents 1352 Service folders 1054 Depreciation documents 1353 Special transactions ustomers 1089 G.L. entries 1361 Revenue documents 1090 C.A. entries 1381 Customer cash transactions 1097 Cash registers 1382 Exports costing 1098 Financial status report (Bulgaria) 1412 Supplier remittances 1099 KEPYO 1413 Customer remittances 1100 Accountants info documents 1414 Cash accounts remittances 1120 Time sheets 1415 Debtor remittances 11351 Retail 1416 Creditor remittances 1140 Building accounting codes 1453 Cash accounts special 1151 Inventory documents 1481 Cash account cash transactions 1154 Fixed asset documents 1553 Special from debtors 1171 Production orders 1581 Cash transactions from debtors 1181 Cheque documents 1653 Special from creditors 1212 Supplier reconciliation 1681 Cash transactions from creditors 1251 Purchase documents 1717 Suppliers reconciliation 1253 Special transactions - Suppliers 2021 Actions 1261 Expense documents 2052 Service calls 1281 Cash transactions - Suppliers 2095 Payroll results 1282 Imports costing 5151 Inventory composition 1312 Reconcile customer with suppliers 7151 Production documents 1313 Customers reconciliation 8100 Cheques 1351 Sales 9500 D.P.S. 306 | P a g e APPENDIX C. System Parameters (X.SYS) The values in the table below can apply to SoftOne tools such as browsers, reports, Java & VB script in custom forms, SBSL scripts and EDA (alerts). To use them just enter :X.SYS.CName, where CName is the name of each command (i.e. to display the company login code, the command is :X.SYS.COMPANY). System Parameters (:X.SYS.CName) Command (CName) Name Type ACNSCHEMA Model of the chart of accounts Small Int BRANCH Login branch Small Int CMPCURR Company currency code VarChar(5) COMPANY Login company Small Int COUNTRY Country Small Int FISCPRD Login fiscal period Small Int FISCPRDPAY Payroll year Small Int FOLDER Portfolio Small Int FPDATE First date of the login period Date FPERIOD First fiscal period of the login fiscal year Small Int FYDATE First date of the login fiscal year Date GROUPS Login user group code Small Int ISADMIN Returns if login user is administrator Small Int LANGEXT Login language VarChar(5) LOCKFISCPRD Locked fiscal period Small Int LOGINDATE Login date Date LPDATE Last date of the login period Date LPERIOD Last fiscal period of the login fiscal year Small Int LYDATE Last fiscal date of the login fiscal year Date NFISCPRD Next fiscal year Small Int PAYCPDATE Date for the calculation of payroll period Date PAYFPDATE First date of the payroll period Date PAYLPDATE Last date of the payroll period Date PAYPERIOD Payroll period Small Int PAYPRDTYPE Payroll period type Small Int PERIOD Login fiscal period Small Int PFISCPRD Previous fiscal period Small Int PFYDATE First date of the previous year Date 307 | P a g e APPENDIX PLYDATE Last date of the previous year Date SOCASH Cash Small Int SOCASHUSER Cash from user Small Int SOCURRENCY Currency Small Int SYSDATE System date Date USER Login user Small Int USERBRANCHES Login user branches VarChar(30) USERNAME Login user name VarChar(1024) WHOUSES Login warehouse VarChar(4000) WRKSTN Workstation Small Int 308 | P a g e APPENDIX D. Menu Jobs / System Tools (acCommands) The table below displays all the available commands that can be executed through the SoftOne menu using the job type "System Tools". The command syntax is: "ACMD:xxx" where xxx is the name of the Job. acCommands Table Command Job Name acAbout SoftOne identity window acBackup Backup database acBuildHtmlDoc Create accounting report model acBuildOfflineFile Create file for local synchronization acCalcErrors Calculation errors of local fields acChangePWD Change password acChat Support call acCheckCS Check client / server connection acCheckDB Update database window acCheckForUpdates Check for updates acComputerSoft1Address View computer soft1 address acConnections Connections administration acCreateDB Create database tables acCutCompanyData Export company data acDesktop SoftOne Desktop home page acEditAccess Define user access rights acEditUserMenu Design user menu acExpBarClose Hide menu panel acExport Export database tables acFavorites Favorite jobs acFullTextSearch Enable / Disable database full text search acHelpContents Help Contents and index acHistory Jobs history window acImpFromClipBoard Import XXF from Clipboard acImpFromFile Import XXF from file acImport Import database tables acKnowBase Program knowledge base acLicUse Activate product license acMainMenu2 Display main menu acMemory SoftOne Notes window 309 | P a g e 508 and newer) acProgramNews Program news acRelogin Relogin using different credentials acReminder Reminder window acRemoteCommands Scheduled commands acRemoteConfig Design remote commands acRemoteServer Remote Server acReportGen Custom reports designer acRestore Restore database acScheduler Scheduler acSDKFiles Custom SDK Files acSelectTop Select Top Entries per Object acSendCustomerMessage Send e-mail message to customer acSettings Settings acSetupOffline Off-Line installation parameters acSetupPrinters Printer settings acSQLMonitor SQL monitor acSrvAccess Define Server access rights acStandard Display old menu acStartupSQL Startup SQL queries acStatusBar Show / Hide status bar acSyncDB Update database window acSynchOffLine Sync offline (client) database acSynchOnline Sync online (server) database acTetris Game Tetris acToggleMnu Remove menu panel acUpgradeLicense Renew licence acUserMenu User menu acWebPage SoftOne site acZReportSignB Z Report of the type B electronic signature device 310 | P a g e . 3.12.APPENDIX acmMind Game Master mind acModifMenu Display group / user menu acMP3Player MP3 Player acMySoft1 My installation window acNewLicense New license acNewSynchOffline Sync offline (client) database (ver. VARCHAR01.exe.Link to Internet Browser Varchar $EMAIL Email Fields . Editor Commands The table below summarizes all the available editor commands and their use.APPENDIX E. Tables used are SOLIST and SOLISTLNS. EDITOR COMMANDS Command Operation ."/"+CUSEXTRA. Varchar 311 | P a g e . Varchar $XRUN Runs external program $XRUN(D[0.VARCHAR01]) The above example runs SoftOne application using the switch parameters added in field CUSEXTRA.Use Data Type $DT Date & Time in different fields Datetime $TIME Only Time (Returns the current Date) Datetime $PASSWORD Password (Displays text with asterisks) Varchar $Y Boolean Field (Displays checkbox control) Small Integer $YN Boolean Field in datagrids (Displays “Yes/No” combobox control) Small Integer $WEBPAGE Web Page Fields .Link to Email Program Varchar $PRINTERS Displays Printers Window Dialog Varchar $DATERANGE Date from to Datetime $TIMERANGE Time from to Datetime $COLOR Displays Softone Color Selection window Varchar $ONECOLOR Displays Windows Color Selection window = 256 ^ 2Red * 256 ^ 1Green * 256 ^ 0Blue Varchar $FILENAME Displays File Selection Window and returns its path Varchar $MASKEDIT Code Mask Creation Window Varchar $RECURRENCE Displays Softone Scheduler Window Varchar $MEMOEDIT Corrects word wrap in datagrid lines for memo textbox fields Varchar $LIST:OBJECT Lookup from preselection lists created from browsers.C:\Xplorer. PRSN AND PRSEXT.CSTFLDR=A.FINDOC AND CS.SODTYPE=:X.SYS.W[SOSOURCE IN (1282.H[ACNTGL]) @ACNMDL ACNMODEL(F[ACNSCHEMA=:X.COMPANY AND A.SYS.SYS.SODTYPE=:X.COMPANY=:X.ACNSCHEMA.PRSN=PRSEXT.F[ACNSCHEMA.SYS.R[CODE].SYS.R[CODE].89].F[ACNSCHEMA.:CSEL.SODTYPE=:X.FISCPRD]) @PERIODPAY PAYPRD(W[COMPANY = :X.ACNSCHEMA.COMPANY AND PRSEXT.SODTYPE=:X.SODTYPE=31 AND PRSEXT.2]) @IRSM IRSDATA(M.ISACTIVE=1)]) @COLM PRSNIN(M.ACNSCHEMA].SODTYPE]) @DSCPLC VCRDRULE(F[SODTYPE. 1382) AND EXISTS (SELECT 1 FROM CSTFLDR CS WHERE CS.CSTFLDR=A.R[CODE].PRSN=PRSEXT.SYS.H[ACNTGL]) @ACNGRP ACNGROUP(F[ACNSCHEMA.W[SOSOURCE=&SOSOURCE AND EXISTS (SELECT 1 FROM CSTFLDR CS WHERE CS.SODTYPE.:CSEL.ACNSCHEMA.SODTYPE=:X.SYS.SYS.SODTYPE]) @ACNAL ACNTAL(F[ACNSCHEMA.R[FINCODE].90].SODTYPE]) @CKAD KAD(W[EXISTS (SELECT 1 FROM COMPANYKAD WHERE COMPANY=:X.SODTYPE]) @ACNM ACNT(M.SODTYPE]) @MATEXP EXPN(F[USEBYITEM=1]) @MATOMD MTRGROUP(F[SODTYPE=:CSEL.CFOCLOSEOK<>1)]) @ARS AREAS(F[SODTYPE=:CSEL.R[FINCODE].KAD UNION SELECT 1 FROM COMPANY WHERE COMPANY=:X.CFOCLOSEOK<>1)]) @COL PRSNIN(W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A.ACNSCHEMA.FINDOC AND CS.89]) @ACNGLM ACNTGL(M.COMPANY AND FISCPRDPAY = :X.KAD)]) @CLSFLDR FINDOC(M.SODTYPE=31 AND PRSEXT.F[SOSOURCE=:CSEL.SYS.APPENDIX F.R[CODE].COMPANY=:X.SYS.SYS.R[NAME]) @JOB JOBTYPE(F[SODTYPE=:CSEL.SYS.SODTYPE]) @ACNGL ACNTGL(F[ACNSCHEMA.SYS.SODTYPE]) @ACNT ACNT(F[ACNSCHEMA=:X.R[NAME].COMPANY AND FISCPRD = :X.KAD=COMPANY.SODTYPE=:X.SYS.SODTYPE]) @PERIODACN PERIOD(W[COMPANY = :X.SYS.SODTYPE=:X.ACNSCHEMA.PRSN AND PRSEXT.ACNSCHEMA. Built-in Editors Command Editor @ACN ACNT(F[ACNSCHEMA.SODTYPE=:X.SOTYPE=:CSEL.ISACTIVE=1)]) @COMM COMMENTS(M.ACNSCHEMA. Built-in Editors The table below contains the analysis of the application internal editors.ACNSCHEMA]) @ACNSLG ACNISOLOG(F[ACNSCHEMA.SYS.F[ACNSCHEMA=:X.:CSEL.H[ACNTAL]) @ACNCTGR ACNCATEGORY(F[ACNSCHEMA.:CSEL.SYS.90]) @ACNALM ACNTAL(M.ACNSCHEMA]) @ALLCLSFLDR FINDOC(M.SOSOURCE]) @CRCNTRL CRCONTROL(F[SODTYPE=:CSEL.COMPANY AND PRSEXT.FISCPRDPAY]) 312 | P a g e .SODTYPE]) @PAYT PAYMENT(F[SODTYPE=:CSEL.ACNSCHEMA.KAD=COMPANYKAD.COMPANY AND A.SYS.SYS.W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A. :CSEL.MTRTYPE IN (2.ISACTIVE=1)]) @RPCPLC PRCPOLICY(F[SODTYPE.:CSEL.H[SXACNT]) @SXACNTSM SXACNT(W[A.SODTYPE=33 AND PRSEXT.M.1]) @TEMPLATESSX TEMPLATESSX(F[SOSOURCE.ISACTIVE=1)]) @TEMPLATESABC TEMPLATESABC(F[SOSOURCE.FISCPRD AND PERIOD>0 AND PERIOD<1000]) @PUR PRSNIN(W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A.ACNSCHEMA.PRSN AND PRSEXT.SODTYPE]) @TRDRS TRDR(W[SODTYPE IN (12.PRSN AND PRSEXT.R[CODE].SODTYPE]) @UT5 UTBL05(F[SODTYPE=:CSEL.4)].ISACTIVE=1)]) @SALM PRSNIN(M.SODTYPE]) @UAT3 UATBL03(F[ACNSCHEMA.SODTYPE]) @ZIPM VZIPADDRESS(M.R[CODE].ISACTIVE=1)]) @SXACNTM SXACNT(M.SODTYPE]) @UAT4 UATBL04(F[ACNSCHEMA.PRSN=PRSEXT.APPENDIX @PERIODMTR PERIOD(W[COMPANY = :X.SODTYPE]) @UAT5 UATBL05(F[ACNSCHEMA.SODTYPE=30 AND PRSEXT.R[CODE]) 313 | P a g e .SODTYPE=:CSEL.H[SXACNT]) @TEC PRSNIN(W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A.SOTYPE=:CSEL.COMPANY AND PRSEXT.SODTYPE=:CSEL.2]) @TEMPLATESGL TEMPLATESGL(F[SOSOURCE.:CSEL.PRSN=PRSEXT.H[SXACNT]) @SXACNTXM SXACNT(W[A.SODTYPE]) @UAT2 UATBL02(F[ACNSCHEMA.16)]) @UAT1 UATBL01(F[ACNSCHEMA.SODTYPE=:CSEL.ACNSCHEMA.SYS.TRDR]) @TRDBSN TRDBUSINESS(F[SODTYPE=:CSEL.15.FISCPRD AND PERIOD<1000]) @PERIODTRD PERIOD(W[COMPANY = :X.SOSOURCE]) @TRDBRN TRDBRANCH(F[TRDR=:CSEL.COMPANY=:X.M.ACNSCHEMA.SYS.R[CODE].:CSEL.SODTYPE]) @UT1 UTBL01(F[SODTYPE=:CSEL.SODTYPE]) @UT4 UTBL04(F[SODTYPE=:CSEL.PRSN AND PRSEXT.W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A.SYS.COMPANY=:X.PRSN AND PRSEXT.SODTYPE]) @UT2 UTBL02(F[SODTYPE=:CSEL.R[CODE].GLTEMPLATESMD=:SOSOURCE.PRSN=PRSEXT.SODTYPE=:CSEL.SODTYPE=32 AND PRSEXT.ACNSCHEMA.SYS.3]) @TFPRMS TFPRMS(F[SOSOURCE=:CSEL.SYS.SODTYPE=:CSEL.SODTYPE.SYS.3)].SODTYPE=32 AND PRSEXT.MTRTYPE IN (1.COMPANY=:X.GLTEMPLATESMD=:SOSOURCE.PRSN AND PRSEXT.1]) @SAL PRSNIN(W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A.:CSEL.COMPANY AND PRSEXT.SODTYPE=30 AND PRSEXT.COMPANY AND FISCPRD = :X.13.PRSN=PRSEXT.W[ EXISTS (SELECT 1 FROM PRSEXT WHERE A.GLTEMPLATESMD=:SOSOURCE.R[CODE].ACNSCHEMA.SYS.SODTYPE]) @TRDCTGR TRDCATEGORY(F[SODTYPE=:CSEL.SODTYPE]) @UT3 UTBL03(F[SODTYPE=:CSEL.PRSN=PRSEXT.COMPANY AND PRSEXT.ISACTIVE=1)]) @PURM PRSNIN(M.COMPANY AND FISCPRD = :X. movement (from production) 8 From receiving note (Service) 28 Counter-balance account based costing 9 From folder (Service) 29 Card installment payment document 10 Initialize fixed assets 30 Forecast / Reversing document 11 From call (Service) 31 Fixed assets revaluation 12 Update physical stock taking documents 32 Opportunity interest 14 Production documents from orderprod. from sale/purchase/inventory 34 Production slips from orders 16 Revenue/Expenses 35 Bonus points from bonus cards 17 Credit notes due to turnover 18 Production orders from sales order 19 Semi-finished products production doc. 20 Production document from work slips 314 | P a g e .orders 33 Contract document 15 Composition doc. Transactions Source Types (Origin) The table below contains all the values of the ORIGIN field of the FINDOC table. ORIGIN Table Code Transaction source Code Transaction source 1 Normal 21 From import 2 Imports costing 22 Production documents from subcontract 3 Exports costing 23 From cash register 4 Integrated financial & cost accounts 24 Exchange rate gains and losses (evaluation) 5 Automatic pay-off 25 Exchange rate gains and losses (openitem) 6 Reversal transactions 26 Previous fiscal years revenue 7 Physical stock taking 27 Inter-co.APPENDIX G. APPENDIX H.EKSOFL:1.EKSOFL:1.FINDOC XCMD:10110 XCMD:XTRDOCDATA.S 315 | P a g e .FINDOC. Transaction Related Jobs – Table FINDOC Related Job Payment terms Open-item Pay-off Pay-off Costing folder Reference Modules SoftOne command Sales – Purchases – Collections – Remittances Sales – Purchases – Collections – Remittances Sales Purchases Sales – Purchases – Collections – Remittances Sales – Purchases – Retail – Collections – Remittances Sales – Purchases – Collections – Remittances .FINDOC.S XCMD:CSTFINLNS.S[ABCTABLE=FIN DOC].FINDOC Purchases XCMD:10107 Retail XCMD:SFADVANCE Retail XCMD:908 Special Transactions XCMD:CSTPRDLNS.FINDOC.Item Docs – Production Docs – Service Folders Sales – Purchases – Collections – Remittances – Service Folders Sales – Purchases – Item Docs – Collections – Remittances Sales – Purchases – Retail – Collections – Remittances – Service Folders Sales – Purchases – Collections – Remittances Sales – Purchases – Retail – Collections – Remittances Sales – Purchases – Retail Collections – Remittances – Item Docs Sales – Purchases – Retail – Collections – Remittances – Item Docs Sales – Purchases – Retail –Collections – Remittances – Item Docs – Production Docs Sales – Purchases – Retail – Collections – Remittances – Item Docs – Production Docs – Service Folders / Calls XCMD:SFPAYTERMS XCMD:1031 XCMD:CFNCUSDOC. Related Jobs / Commands The table below contains all the commands that are used to access related jobs per module.S.FINDOC Pay-off Special Transactions XCMD:&EKSOFL Settlement Revenues – Expenses XCMD:&CMDOBJ Related documents Service Calls (APPMNT) XCMD:SFFINTO Conversion history Sales – Purchases – Item Docs XCMD:10114 Record printouts Sales – Purchases XCMD:10115 Recalculation Originated from Converted into Lots proposal Agreement on total Select contract Select agreement Match with revenue/expenses Activity Based Costing Analysis Entry Related files Update sales prices Advance payment / Order Credit card installments Production cost (subcontracted) XCMD:10006 XCMD:SFFINFROM XCMD:SFFINTO XCMD:10112 XCMD:SFFINPRCRULE XCMD:SFCNTR XCMD:SFPRCPOLICY XCMD:10113 XCMD:ABCTRNLINES.S.S XCMD:CFNSUPDOC. s.APPENDIX Customer / Supplier Related Jobs – Table TRDR Relative Job Reference Modules SoftOne command Balance per company Customers – Suppliers – Debtors – Creditors XCMD:SFCMPREM Register of non-natural persons Customers XCMD:GsisCmpAfmData Item Related Jobs – Table MTRL Relative Job Balance per company Reference Modules Items SoftOne command XCMD:SFCMPREM Accounting Related Jobs – Table ACNT Relative Job Reference Modules SoftOne command Entry model Accounting Entries XCMD:10009 Related files Accounting Entries XCMD:XTRDOCDATA.BUDGET.BUDGET.BUDGET Copy data Budget XCMD:COPYBUDGETDATA.BUDGET.BUDGET.BUDGET 316 | P a g e .S Contract Related Jobs – Table SRVC Relative Job Related document Reference Modules Contracts SoftOne command XCMD:1001 Budget Related Jobs – Table BUDGET Relative Job Reference Modules SoftOne command Update initial data Budget – Budget data XCMD:InitBudgetData.BUDGET Delete data Budget – Budget data XCMD:DELETEBUDGETDATA.BUDGET Update actual data Budget – Budget data XCMD:CalcBadgetData. APPENDIX File / Document Related Jobs – Table XDOCS Relative Job Reference Modules SoftOne command Open file Documents file XCMD:10003 Save to file Documents file XCMD:10004 Save file to DB Documents file XCMD:10011 Delete file from DB Documents file XCMD:10012 Upload file to Azure Documents file XCMD:11011 Delete file from Azure Documents file XCMD:11012 Download from URL Documents file XCMD:11013 CRM Related Jobs – Table SOACTION Relative Job Reference Modules SoftOne command Next step Actions – Calls – Meetings – Tasks – e-mails XCMD:FOLLOWUPDLG Action history Actions – Calls – Meetings – Tasks – e-mails XCMD:ACTHISTDLG Repeat action Actions – Calls – Meetings – Tasks – e-mails XCMD:ACTREPEATDLG Sales opportunity Actions – Calls – Meetings – Tasks – e-mails XCMD:1002 Previous step Actions – Calls – Meetings – Tasks – e-mails XCMD:SFPREVSTEP Related files Actions – Calls – Meetings – Tasks – e-mails – Draft entries XCMD:XTRDOCDATA.S Attachments e-mails XCMD:1001 Send e-mails XCMD:1000 Reply e-mails XCMD:1003 Reply to all e-mails XCMD:1004 Forward e-mails XCMD:1005 Templates e-mails XCMD:1006 Convert draft entry Draft entries XCMD:1001 Register of nonnatural persons Draft entries XCMD:GsisCmpAfmData Reports recording Actions – Calls – Meetings – Tasks – e-mails – Draft entries XCMD:10115 Follow up Actions – Calls – Meetings – Tasks – e-mails – Draft entries XCMD:1200 Data Actions – Calls – Meetings – Tasks – e-mails – Draft entries XCMD:SFLEAD Attachment e-mails XCMD:10006 Send and Save e-mails XCMD:1007 317 | P a g e . N.CNV:100 Cancel by reversal Purchases XCMD:PURDOC.Item docs – Fixed assets – Remittances – Collections – Special transactions XCMD:1001 Cancel by reversal Sales XCMD:SALDOC.N.SOSOURCE:1351 Conversion Item Docs XCMD:CONVERTDLG.CNV:100 Cancel by reversal Item Docs XCMD:ITEDOC.CNV:1 Convert lines Sales – Purchases XCMD: CONVERTDLG.CNV:3 Copy document Fixed assets docs XCMD:ASSDOC.CNV:100 Cancel by reversal Collections – Special Transactions XCMD:1003 318 | P a g e .CNV:3 Copy document Purchases XCMD:PURDOC.CNV:3 Cancel transactions Sales – Purchases – Retail .N.SOSOURCE:1251 Copy document Sales XCMD:SALDOC. Browser Job Commands The table below contains the commands that can be found in the right click context menu of object browsers.N.LN:1 Documents processing Sales XCMD:PROCESSDLG. Document Browser Jobs – Table FINDOC Relative Job Reference Modules SoftOne command Conversion Sales XCMD:CONVERTDLG.APPENDIX I.SOSOURCE:1151 Documents processing Purchases XCMD:PROCESSDLG. XCMD:REMOVERESTMODE Restore pending Sales – Purchases – Retail – Item Docs. XCMD:UNDOREMOVEREST.LN:1 Restore line pending Sales – Purchases – Retail – Item Docs.N. XCMD:REMOVERESTMODE.CNV:3 Copy document Retail XCMD:RETAILDOC. XCMD:UNDOREMOVEREST Remove pending (lines) Sales – Purchases – Retail – Item Docs.N.SOSOURCE:1351 Documents processing Item Docs XCMD:PROCESSDLG.SOSOURCE:1251 Convert document Fixed assets docs XCMD:ASSDOC.SOSOURCE:1351.CNV:3 Copy document Item Docs XCMD:ITEDOC.SOSOURCE:1151 Conversion Purchases XCMD:CONVERTDLG.N.LN:1 Remove pending Sales – Purchases – Retail – Item Docs.N.N. APPENDIX Re-issue by cancelling with reversal Sales – Retail XCMD:10016 Discount amount (forecast) Invoice discounting documents XCMD:Docspmcash Discount amount (disbursement) Invoice discounting documents XCMD:Docsmcash Balance disbursement Invoice discounting documents XCMD:Docsrcash Discount expediture Invoice discounting documents XCMD:DocsPayExpences Management expediture Invoice discounting documents XCMD:DocsExpences Create credit notes Credit notes results XCMD:CreditDoc Order planning Sales XCMD:IteOrdersServ Transfer to purchase documents Sales XCMD:CRTPURORDS Transfer to production documents Sales XCMD:CRTPRDDOCS Transfer to production orders Sales XCMD:CRTPRDORDDOCS Recalculate Sales XCMD:PRCRECALCDLG Discount credit notes calculation Sales XCMD:CULCTMPCREDIT Customers / Projects Browser Jobs – Tables TRDR / PRJC Relative Job Reference Modules SoftOne command Save actions Customers – Suppliers – Debtors – Creditors – Projects XCMD:CRTACTIONDLG Send email Customers – Suppliers – Debtors – Creditors XCMD:SENDEMAILDLG Insert file Customers – Suppliers – Debtors – Creditors – Projects XCMD:CreateXDoc Contacts Browser Jobs – Table PRSN Relative Job Reference Modules SoftOne command Save actions Contacts XCMD:CRTACTIONDLG Send email Contacts XCMD:SENDEMAILDLG Export to Outlook Contacts XCMD:EXPOUTCONTACTS Export to Google Contacts XCMD:EXPGCONTACTS Insert file Contacts XCMD:CreateXDoc Calendar Contacts XCMD:102 319 | P a g e . FROMSRVCARD:2 Service – spare parts document Service folders XCMD:SALDOC.Services XCMD:CreateXDoc Tranfer to “Web items” file Items XCMD:IteToWeb Transfer to “Touch items” file Items XCMD:IteToRetail Accounting Browser Jobs – Table ACNT Relative Job Reference Modules SoftOne command Cancel entry General ledger entries XCMD:1001 Cancel by reversal General ledger entries XCMD:ACCGLHEADER.N.N.CNV:100 Cancel entry Cost accounting entries XCMD:1001 Cancel by reversal Cost accounting entries XCMD:ACCALHEADER.APPENDIX Item Browser Jobs – Table MTRL Relative Job Reference Modules SoftOne command Mass price modification Items XCMD:IteCalcMarkUp Transfer among W/h Items XCMD:IteWhouseRest Order planning Items XCMD:IteOrdersServ Insert file Items – Fixed assets .N.CNV:100 Cheque Browser Jobs – Table CHEQUE Relative Job Reference Modules SoftOne command Cash transaction Cheques XCMD:ChqCfnDoc Insert file Cheques XCMD:CreateXDoc Services Browser Jobs – Table SRVC Relative Job Reference Modules SoftOne command Related documents Service calls XCMD:100001 Cancel call Service calls XCMD:100002 Cancel transactions Service folders XCMD:1001 Revoke pending status Service folders XCMD:1002 Spare parts documents Service folders XCMD:SALDOC.FROMSRVCARD:0 320 | P a g e .N.N.FROMSRVCARD:1 Service documents Service folders XCMD:SALDOC. N.SENDSRVCARD:1 Installations Browser Jobs – Table INST Relative Job Insert file Reference Modules Installations SoftOne command XCMD:CreateXDoc Warranties Browser Jobs – Table Guaranty Relative Job Save file Reference Modules Warranties SoftOne command XCMD:CreateXDoc File Documents Browser Jobs – Table XDOC Relative Job Reference Modules SoftOne command Open document Documents file XCMD:10003 Export file Documents file XCMD:10004 Send by e-mail Documents file XCMD:SendDocWithMail CRM Browser Jobs – Table SOACTION Relative Job Reference Modules SoftOne command Next step General actions – Calls – Meeteings – Tasks – e-mails – CRM action statistics XCMD:FOLLOWUPDLG.APPENDIX Shipment to customer Service folders XCMD:SALDOC.BROWSER:1 Repeat action General actions – Calls – Meeteings – Tasks – e-mails – CRM action statistics XCMD:ACTREPEATDLG.BROWSER:1 Save action CRM action statistics XCMD:1100 Insert action Draft entries XCMD:CRTACTIONDLG Send email Draft Entries XCMD:SENDEMAILDLG Export to Google Draft Entries XCMD: GLCONTACTS 321 | P a g e .BROWSER:1 Action history General actions – Calls – Meeteings – Tasks – e-mails – CRM action statistics XCMD:ACTHISTDLG.
Copyright © 2024 DOKUMEN.SITE Inc.