XERO files: Difference between revisions

From Data Islands
mNo edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 7: Line 7:
Example 2 - using jscript to build the where clause
Example 2 - using jscript to build the where clause


jscript "var today = new Date(); var myDate = new Date(); myDate.setDate(myDate.getDate() - 10); var somestring = '(UpdatedDateUTC >= DateTime(' + myDate.getFullYear() + ', ' + (myDate.getMonth() + 1) + ',' + myDate.getDate() + ') AND UpdatedDateUTC <= DateTime(' + today.getFullYear() + ',' + (today.getMonth() + 1) + ', ' + today.getDate() + ')) or UpdatedDateUTC = null';  return somestring;"
jscript "var today = new Date(); var myDate = new Date(); myDate.setDate(myDate.getDate() - 3); var somestring = 'Type==\'ACCREC\' and (UpdatedDateUTC >= DateTime(' + myDate.getFullYear() + ', ' + (myDate.getMonth() + 1) + ',' + myDate.getDate() + ') AND UpdatedDateUTC <= DateTime(' + today.getFullYear() + ',' + (today.getMonth() + 1) + ', ' + today.getDate() + ')) or UpdatedDateUTC = null';  return somestring;"


querydb invoices jscriptoutput
Note: we filter on Type=ACCREC also here
 
>querydb invoices jscriptoutput FILES
 
So next we need to push/export these files up into a data island.
 
>push tmpxerofiles
 
 
Now we switch to a "FILES" server (or add a files server)
 
>addserver files "c:\files\"
 
 
 
Then we pull/import the data island
 
>pull tmpxerofiles "tmpxerofiles"
 
With this structure the folder "c:\files\tmpxerofiles" will be created (you may need to run the data islands console as an administrator for this to work)
 
If you just call
 
>pull tmpxerofiles
 
the server default location will be used

Latest revision as of 12:25, 14 September 2023

Experimental feature that will get the invoice PDF files

Example

>querydb invoices UpdatedDateUTC>= DateTime(2022, 01, 01) AND UpdatedDateUTC<= DateTime(2022, 01, 31) FILES

Example 2 - using jscript to build the where clause

jscript "var today = new Date(); var myDate = new Date(); myDate.setDate(myDate.getDate() - 3); var somestring = 'Type==\'ACCREC\' and (UpdatedDateUTC >= DateTime(' + myDate.getFullYear() + ', ' + (myDate.getMonth() + 1) + ',' + myDate.getDate() + ') AND UpdatedDateUTC <= DateTime(' + today.getFullYear() + ',' + (today.getMonth() + 1) + ', ' + today.getDate() + ')) or UpdatedDateUTC = null';  return somestring;"

Note: we filter on Type=ACCREC also here

>querydb invoices jscriptoutput FILES

So next we need to push/export these files up into a data island.

>push tmpxerofiles


Now we switch to a "FILES" server (or add a files server)

>addserver files "c:\files\"


Then we pull/import the data island

>pull tmpxerofiles "tmpxerofiles"

With this structure the folder "c:\files\tmpxerofiles" will be created (you may need to run the data islands console as an administrator for this to work)

If you just call

>pull tmpxerofiles

the server default location will be used