User Tools

Site Tools


snc_table_maps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
snc_table_maps [2019/01/17 17:17]
alvin.tan [Embedded Table Maps]
snc_table_maps [2019/02/05 13:31] (current)
javier.valerio
Line 188: Line 188:
   * **psp_attachment** - The name of the other table map to use   * **psp_attachment** - The name of the other table map to use
   * **table_sys_id=$[GR:​sys_id]** - An optional query to limit the records returned where the query is based on fields of the other table map.  In this case, we are using the the sys_id of the current GlideRecord (incident) being table mapped so that we only get its attachments in the psp_attachment table map. Since the sys_attachment table is being used in the psp_attachment table map as the source table, we do so by looking for records in sys_attachment with a table_sys_id of the incident record'​s sys_id.   * **table_sys_id=$[GR:​sys_id]** - An optional query to limit the records returned where the query is based on fields of the other table map.  In this case, we are using the the sys_id of the current GlideRecord (incident) being table mapped so that we only get its attachments in the psp_attachment table map. Since the sys_attachment table is being used in the psp_attachment table map as the source table, we do so by looking for records in sys_attachment with a table_sys_id of the incident record'​s sys_id.
 +  * **limit n** (optional) - Limits to sending only n attachments per message (such as limit 1). Refer to "//​Setting Individual Attachments Replication//"​ below.
  
 The psp_attachment table map then looks as follows: The psp_attachment table map then looks as follows:
Line 215: Line 216:
  
 So in the above example, if the psp_attachment table map was greater than the outbound bytes properties or 16MB, no value would be added for <​attachments>​ into the <​common_incident>​ table map. So in the above example, if the psp_attachment table map was greater than the outbound bytes properties or 16MB, no value would be added for <​attachments>​ into the <​common_incident>​ table map.
 +
 +==== Setting Individual Attachments Replication ====
 +
 +In cases where only one attachment is to be sent per outbound message, the "limit n" parameter in the embedded table map helps us achieve this. The following steps describe what needs to be set up:
 +
 +  - Add the "limit 1" parameter to the psp_attachment embedded table map as follows: ${TM:​psp_attachment;​table_sys_id=$[GR:​sys_id];​siam_sent;​limit 1}
 +  - Verify that the //​siam_sent//​ tag exists in your system. Tags is what prevents attachments from being sent every time. Go to the Tags table (label.list) and create a tag with name //​siam_sent//​ if it does not exist.
 +  - In your Before Share Script of your dynamic share, we will make a function call to send them individually:​
 +
 +    <code javascript>​
 +    ...
 +    // sending attachments added before submitting ticket for the first time
 +    if(!ignore && current.operation() == "​insert"​) {
 +        var tableMap = share_gr.u_table_map;​
 +        new PerspectiumAttachment().sendIndividualAttachments(current,​ "​deferred",​ "​siam_sent",​ share_gr, '',​ tableMap);
 +    }
 +    </​code>​
 +
  
 ===== Further Examples ===== ===== Further Examples =====
snc_table_maps.txt ยท Last modified: 2019/02/05 13:31 by javier.valerio