Request Samples
In one WEP Forms request multiple functions can be combined. For example you can add files to each generated document(s), then you can merge them all and store in another table record. Or you can cre…
In one WEP Forms request multiple functions can be combined. For example you can add files to each generated document(s), then you can merge them all and store in another table record. Or you can create a record in another table and store this merged(completed) document in that new record.
Generate Document, create a record in another table and store document in that new record.
- & "&app="&AppID()
& "&db="&Dbid()
& "&rid="&[Record ID#]
& "&weprid=1"
& "&name=My_Document" // File name
& "&pf=add|bzzzzzzz|11:~3~.12:~6~.13:~7~.14:"&URLEncode("New Record")&"|15|16"
& "&weptoken="&URLEncode([WEP Forms Token]) - Highlighted line above: Adds record to table(table id is bzzzzzzz). In this new record fields will have values as below.
Field ID in New Record
Field Value in New Record
11
Value of field(Field ID =3) from master record.
12
Value of field(Field ID =6) from master record.
13
Value of field(Field ID =7) from master record.
14
Value of "New Record"
- Generated document will be stored in file attachment field that has field id=15. Date/Time when document was generated will be stored in Date/Time field that has field id=16
Generate document with appending additional pages in front and back.
- & "&app="&AppID()
& "&db="&Dbid()
& "&rid="&[Record ID#]
& "&weprid=1"
& "&name=My_Document" // File name
& "&pf=10" // PDF file attachment field id
& "&docdt=11" // Date/Time field id - When document was generated
& "&addbefore=baaaaaa|{'6'.EX.'Before1'}|3|6:bbbbbbb|{'6'.EX.'Before2'}|4|7"
& "&addafter=bccccccc|{'6'.EX.'After1'}|5|8:bddddddd|{'6'.EX.'After2'}|6|9"
& "&weptoken="&URLEncode([WEP Forms Token]) - Yellow highlighted line above get files:
- First from table(Table ID = baaaaaaa) in file attachment(Field ID=6). Files will be added in front of generated document. It will get files by query="{'6'.EX.'Before1'}" and they will be sorted ascending by field id=3.
- Then from table(Table ID =bbbbbbb) in file attachment(Field ID=7). Files will be added in front of generated document. It will get files by query="{'6'.EX.'Before2'}" and they will be sorted ascending by field id=4.
- Blue highlighted line above get files:
- First from table(Table ID = bcccccc) in file attachment(Field ID=8). Files will be added in front of generated document. It will get files by query="{'6'.EX.'After1'}" and they will be sorted ascending by field id=5.
- Then from table(Table ID =bddddddd) in file attachment(Field ID=9). Files will be added in front of generated document. It will get files by query="{'6'.EX.'After2'}" and they will be sorted ascending by field id=6.
- Completed document will be stored in file attachment field(field ID=10) and Date/Time field(Field ID=11) will show when document was generated.
Generate documents for multiple records at once, store each one in individual records then merge them all at the end to store in another file attachment field.
Example below generate each invoice as MS Word document and merge all generated documents and creates a package document in MS WORD format. Same functionality can be used for PDF documents.
- & "&app="&AppID()
& "&db=baaaaaa" //Invoice Table dbid
& "&query={'6'.EX.'"&[Record ID#]&"'}"
& "&name=Invoice "&[Invoice #] // File Name
& "&weprid=2"
& "&wf=16" // Word file attachment field id
& "&docdt=17"
& "&:mrg="&Dbid()&"|"&[Record ID#]&"|19|word|Completed Package(WORD)|128"
& "&stsfid="&Dbid()&"."&[Record ID#]&".51" - Yellow highlighted line; merges all invoices and stores in master table in file attachment field(Field ID=19) in word format. It also updated date/time field(Field ID=128) to show when "Completed Package"(merge file name) was created.
- Blue highlighted line; updates status field(Field ID=51) in master record. It will show completed message or error details if there is any.
Merge files from different tables and records and build a package.
You can merge either MS Word documents or PDF documents. This functionality is available only through the WEP Form API. You can use either "addbefore" alone or both "addbefore" and "addafter" together. The example below demonstrates merging MS Word documents.
- & "&Parameters:mrg="&Dbid()&"|"&[Record ID#]&"|10|word|Completed Package|11"
& "&addbefore=baaaaaa|{'6'.EX.'Before1'}|3|6:bbbbbbb|{'6'.EX.'Before2'}|4|7"
& "&addafter=bccccccc|{'6'.EX.'After1'}|5|8:bddddddd|{'6'.EX.'After2'}|6|9"
& "&stsfid="&Dbid()&"."&[Record ID#]&".15" - First line is for where and how merged document will be stored: Table ID|Record ID#|File attachment Field ID|Merged File Type|Merged Filename|Merged Document date
- Yellow highlighted line above get files:
- First from table(Table ID = baaaaaaa) in file attachment(Field ID=6). Files will be added in front of generated document. It will get files by query="{'6'.EX.'Before1'}" and they will be sorted ascending by field id=3.
- Then from table(Table ID =bbbbbbb) in file attachment(Field ID=7). Files will be added in front of generated document. It will get files by query="{'6'.EX.'Before2'}" and they will be sorted ascending by field id=4.
- Blue highlighted line above get files:
- First from table(Table ID = bcccccc) in file attachment(Field ID=8). Files will be added in front of generated document. It will get files by query="{'6'.EX.'After1'}" and they will be sorted ascending by field id=5.
- Then from table(Table ID =bddddddd) in file attachment(Field ID=9). Files will be added in front of generated document. It will get files by query="{'6'.EX.'After2'}" and they will be sorted ascending by field id=6.
- Then WEP Forms merges all of these files with the order explained above. Completed document will be stored in file attachment field(field ID=10) in word format and Date/Time field(Field ID=11) will show when document was generated.
- WEP Forms updates status field(Field ID=15) in master record. It will show completed message or error details if there is any.
How did we do?
Parameters