One of the things I don't get is the difference between with_args and to_get. Given the documentation http://docs.lansa.com/14/en/LANSA015/Co ... .htm#USE_P it should be as simple as with_args are what you are passing to the function and to_get is what you expect out of the function. However this seems to not always be the case.
These examples are based on the PDFDocumentService.
Here is one example in the documentation http://docs.lansa.com/14/EN/lansa093/in ... 7_0835.htm that appears to passing a working list in the TO_GET.
Code: Select all
CHANGE FIELD(#JSMCMD) TO('ADD CONTENT(TABLE) SERVICE_LIST(ID,FNAME,SNAME)')
USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #TBLLST)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
For example, this works as expected, the list is passed to the template and the data shows up the pdf.
Code: Select all
#JSMXCMD := ('ADD CONTENT(OFFICE)')
use builtin(JSMX_COMMAND) with_args(#JSMXHDLE #JSMXCMD #CurrentOfficeList) to_get(#JSMXSTS #JSMXMSG)
if (#COM_OWNER.CheckStatus( #JSMXSTS #JSMXMSG ))
return
endif
Code: Select all
* Add Client List Content
#JSMXCMD := ('ADD CONTENT(CLIENT)')
use builtin(JSMX_COMMAND) with_args(#JSMXHDLE #JSMXCMD #DetailList) to_get(#JSMXSTS #JSMXMSG)
if (#COM_OWNER.CheckStatus( #JSMXSTS #JSMXMSG ))
return
endif
Code: Select all
#JSMXCMD := ('ADD CONTENT(CLIENT)')
use builtin(JSMX_COMMAND) with_args(#JSMXHDLE #JSMXCMD) to_get(#JSMXSTS #JSMXMSG #DetailList)
if (#COM_OWNER.CheckStatus( #JSMXSTS #JSMXMSG ))
return
endif
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<document page-size="A4" orientation = "portrait" background="white" border="false" author="Express Professionals" title="Sales Analysis" subject="Sales Analysis" keywords="Sales, Analysis" creator="JRYOUNG" hide-toolbar="" hide-menubar="" hide-windowui="" allow-printing="true" allow-copy="false" allow-modify-contents="false" allow-modify-annotations="false" allow-fillin="false" allow-screenreader="false" allow-assembly="false" allow-degraded-printing="false">
<content name="office">
<text-align y1="800" align="center" value="{STD_STRNG}" />
<text-align y1="780" align="center" value="Sales Analysis" />
<text-align y1="760" align="center" value="{wk_StartDate}" />
</content>
<content name="client">
<table x1="10" y1="740" width="400" style="normal" alternate="false">
<column field="STD_STRNG" width-percentage="20" title="Name"/>
</table>
<page />>
</content>
</document>