Return an XML containing the documents for a given customer
*/ Instantiate end set the database location.
oBiz = createobject("bizinfo.application")
oBiz.cDatabasePath = "C:\WinBIZ Data"
oBiz.nCompany = 1000
oBiz.nYear = 2017
EOL = chr(10) + chr(13)
*/ Open the Documents table.
oBiz.cScript = oBiz.cScript + [ oSession.TableOpen("Document", "Documents") ] + EOL
*/ Extract the Documents whose customer ID (do_adr1, ad_numero) is 100.
oBiz.cScript = oBiz.cScript + [ select do_date1, do_nodoc, do_type, do_montant, do_paye, do_pmt from documents where do_adr1 = 100 order by do_nodoc into cursor cQuery ] + EOL
*/ Create the XML from the results of the previous command, and put the results in the lcXml variable.
oBiz.cScript = oBiz.cScript + [ cursortoxml(alias(), 'lcXml', 1, 0, 0, "1", '', '') ] + EOL
oBiz.cScript = oBiz.cScript + [ return lcXml ] + EOL
*/ Execute the script. The value returned is an XML.
lcXml = oBiz.ScriptExecute()