Agile-Developer
Fill on post genmap
 
Notifications
Clear all

Fill on post genmap

1 Posts
1 Users
0 Likes
1,082 Views
Posts: 85
Admin
Topic starter
(@akshatha)
Reputable Member
Joined: 2 years ago
Using this both grid or non-grid data can be filled in the target tstruct on posting through Genmap. 
  1. While filling from SQL, SQL node is mandatory in XML, and SQL field name and tstruct fieldname(to be filled) should be the same.
  2. While filling from another grid source frame and map is mandatory.
    1. For filling from another grid, first, the target dc should be filled from sql and then from the grid.
    2. Filling from another grid will not fill all rows from source dc. It will check whether the value of the key field exists in the target dc, if it does not exist that row will be added to the target dc.                                       
Following is the sample script to fill a single field in the target tstruct.
s1:={<root><s1><sql><l1>select product_name from testproduct</l1></sql><key>product_name</key></s1></root>}
fill(s1)
 
 
XML should be as follows
<root>
  <s1 fillon="new/modify">
     <sql>
         <l1>SELECT  A.PRODCODE AS PCODE,B.RATE AS PRATE FROM PRODMAST A, POB B WHERE A.PRODMASTID = B.PRODCODE AND </l1>              <l2>A.PRODCODE LIKE 'SANDALS -%' ORDER BY A.PRODCODE</l2>
     </sql>
     <key>pcode</key>
     <new>add/first time/none</new> (default add)
     <del>
        <cond>iif condition(Expression)</cond>   
        <action>delrow/ignore</action>  (default ignore)
     </del>
     <change> (default apply)
         <apply>*</apply> (* means all, fields list should be given in comma separated format)
         <ignore>*</ignore> (* means all,fields list should be given in comma separated format)
     </change>
  </s1>
  <s3>
     <sourceframe>dc2</sourceframe>
     <map>pcode=prodcode,prate=rate</map>
     <key>pcode</key>
     <new>add</new>
     <del>
        <action>delrow</action>  
     </del>
     <change>
         <ignore>*</ignore>
     </change>
  </s3>
</root>
Share: