icReference | input | character | - <classname> for receiving business field information of a business class - <classname>.<methodname> for receiving business field information of a browse or report |
tBusinessFields | output | temp-table | |
tCustomRelation | output | temp-table | |
oiReturnStatus | output | integer | Return status of the method. |
<ANCESTOR-CODE> empty temp-table tBusinessFields. /* Customer list */ create tBusinessFields. assign tBusinessFields.tcSideLabel = #T-78'Customer':40(4290)T-78# tBusinessFields.tcFcDescription = #T-80'Customer':40(4290)T-80# tBusinessFields.tcFcFieldName = "Customer_CANDO":U tBusinessFields.tcDataType = "c":U tBusinessFields.tcControlType = "TextBox":U tBusinessFields.tcDisplayFormat = "x(20)":U tBusinessFields.tcFcFieldType = "F":U tBusinessFields.tcLookupQuery = "BDebtorSAO.SelectDebtor":U tBusinessFields.tcLookupReturnField = "tqSelectDebtor.tcDebtorCode":U tBusinessFields.tcLookupFilterField = "tDebtor.DebtorCode":U tBusinessFields.tiSequence = 2. /* Bill Collector */ create tBusinessFields. assign tBusinessFields.tcSideLabel = trim(#T-90'Bill Collector':20(347023082)T-90#) tBusinessFields.tcFcDescription = trim(#T-27'Bill Collector':20(347023082)T-27#) tBusinessFields.tcFcFieldName = "EmployeeCode":U tBusinessFields.tcDataType = "c":U tBusinessFields.tcControlType = "TextBox":U tBusinessFields.tcDisplayFormat = "x(20)":U tBusinessFields.tcFcFieldType = "F":U tBusinessFields.tcLookupQuery = "BEmployeeSAO.SelectEmployee":U tBusinessFields.tcLookupReturnField = "tqSelectEmployee.tcEmployeeCode":U tBusinessFields.tcFilterOperators = "=":U tBusinessFields.tcLookupFilterField = "tEmployee.EmployeeCode":U tBusinessFields.tiSequence = 6. /* Bill Year */ create tBusinessFields. assign tBusinessFields.tcSideLabel = trim(#T-96'Bill Year':20(339337492)T-96#) tBusinessFields.tcFcDescription = trim(#T-12'Bill Year':20(339337492)T-12#) tBusinessFields.tcFcFieldName = "Year":U tBusinessFields.tcDataType = "i":U tBusinessFields.tcControlType = "NumericInt":U tBusinessFields.tcDisplayFormat = "9999":U tBusinessFields.tcFcFieldType = "F":U tBusinessFields.tiSequence = 3. /* Bill Number from-to */ create tBusinessFields. assign tBusinessFields.tcSideLabel = trim(#T-66'Bill Number':20(484798895)T-66#) tBusinessFields.tcFcDescription = trim(#T-10'From-To Number':100(938)T-10#) tBusinessFields.tcFcFieldName = "Number_RANGE":U tBusinessFields.tcDataType = "i":U tBusinessFields.tcControlType = "NumericInt":U tBusinessFields.tcDisplayFormat = "999999999":U tBusinessFields.tcFcFieldType = "F":U tBusinessFields.tiSequence = 4. /* Bill Date from-to */ create tBusinessFields. assign tBusinessFields.tcSideLabel = trim(#T-58'Bill Date':20(137013673)T-58#) tBusinessFields.tcFcDescription = trim(#T-68'From-To Bill Date':20(81452930)T-68#) tBusinessFields.tcFcFieldName = "BillDate_RANGE":U tBusinessFields.tcDataType = "t":U tBusinessFields.tcControlType = "DateTime":U tBusinessFields.tcDisplayFormat = "99/99/9999":U tBusinessFields.tcFcFieldType = "F":U tBusinessFields.tiSequence = 5. /* Print Type */ create tBusinessFields. assign tBusinessFields.tcSideLabel = trim(#T-9'Print Type':11(65750)T-9#) tBusinessFields.tcFcDescription = trim(#T-2'Print Type':11(65750)T-2#) tBusinessFields.tcFcFieldName = "PrintType":U tBusinessFields.tcValueList = {&BILLREPORTTYPES} tBusinessFields.tcControlType = "ComboBoxM":U tBusinessFields.tcDataType = "c":U tBusinessFields.tcDisplayFormat = "x(20)":U tBusinessFields.tcFcFieldType = "F":U tBusinessFields.tiSequence = 1.
define temp-table ttContext no-undo field propertyQualifier as character field propertyName as character field propertyValue as character index entityContext is primary unique propertyQualifier propertyName index propertyQualifier propertyQualifier. define dataset dsContext for ttContext. define variable vhContextDS as handle no-undo. define variable vhExceptionDS as handle no-undo. define variable vhServer as handle no-undo. define variable vhInputDS as handle no-undo. define variable vhInputOutputDS as handle no-undo. define variable vhOutputDS as handle no-undo. define variable vhParameter as handle no-undo. /* Create context */ create ttContext. assign ttContext.propertyName = "programName" ttContext.propertyValue = "BBillReport". create ttContext. assign ttContext.propertyName = "methodName" ttContext.propertyValue = "GetBusinessFields". create ttContext. assign ttContext.propertyName = "applicationId" ttContext.propertyValue = "fin". create ttContext. assign ttContext.propertyName = "entity" ttContext.propertyValue = "1000". create ttContext. assign ttContext.propertyName = "userName" ttContext.propertyValue = "mfg". create ttContext. assign ttContext.propertyName = "password" ttContext.propertyValue = "". /* Connect the AppServer */ create server vhServer. vhServer:connect("-URL <appserver-url>"). if not vhServer:connected() then do: message "Could not connect AppServer" view-as alert-box error title "Error". return. end. /* Run */ assign vhContextDS = dataset dsContext:handle. run program/rpcrequestservice.p on vhServer (input-output dataset-handle vhContextDS by-reference, output dataset-handle vhExceptionDS, input dataset-handle vhInputDS by-reference, input-output dataset-handle vhInputOutputDS by-reference, output dataset-handle vhOutputDS). /* Handle output however you want, in this example, we dump it to xml */ if valid-handle(vhExceptionDS) then vhExceptionDS:write-xml("file", "Exceptions.xml", true). if valid-handle(vhOutputDS) then vhOutputDS:write-xml("file", "Output.xml", true). /* Cleanup */ vhServer:disconnect(). assign vhServer = ?. if valid-handle(vhInputDS) then delete object vhInputDS. if valid-handle(vhOutputDS) then delete object vhOutputDS. if valid-handle(vhExceptionDS) then delete object vhExceptionDS.