Skip to main content

Hi,

I have a button to run an in-Line snippet to compose a conga composer url and then launch the url, is working without problems:4a83aaf6181e14f27cd73d6c32583c2d21be921b.png

This is before the merge:


https://composer.congamerge.com?sessionId={{$Api.Session_Id}}&serverUrl={{$Api.Partner_Server_Url}}&id={{Id}}&ReportVar={{Id}} &QVar0Id=a0C17000000Et3N?pv0={{Id}} &QVar1Id=a0C17000000Et3I?pv0={{Id}} &QueryId=[OPPOwner]a0C17000000EwWW?pv0={{OpportunityID__c}}, [Site]a0Cb0000006CSH3?pv0={{{Site__r.Id}}}, [FirstOrderContact]a0C170000009Ty9?pv0={{Id}}, [OrderContact]a0Cb0000006CSGt?pv0={{Id}}, [TechContact]a0Cb0000006CSHD?pv0={{Id}}, [AdminContact]a0Cb0000006CSGj?pv0={{Id}}, [BillingContact]a0Cb0000006CSHI?pv0={{{Billing_Account__r.Id}}}, [BillingAccount]a0Cb0000006CSGo?pv0={{{Billing_Account__r.Id}}}, [Account]a0Cb0000006CSGe?pv0={{AccountID__c}}& TemplateId=015b0000000mYRt&OFN=Service+Order+Form+{{Order_ID_show__c}} &EmailToId={QVar0} &EmailAdditionalTo={QVar1} &CongaEmailTemplateID=a0A17000000DSfq &EmailRelatedToId={{Id}} &MFTS0=Stage__c &MFTSValue0=Order+form+sent &LG1=Order+Form+Sent &LG3=1&LG4=2&DS7=2

This is after the merge:


https://composer.congamerge.com?sessionId=[...]&serverUrl=[...]&id=a04b000000CaWygAAF &ReportVar=a04b000000CaWygAAF &QVar0Id=a0C17000000Et3N?pv0=a04b000000CaWygAAF &QVar1Id=a0C17000000Et3I?pv0=a04b000000CaWygAAF &QueryId=[OPPOwner]a0C17000000EwWW?pv0=006b0000007nYDk, [Site]a0Cb0000006CSH3?pv0=a0Fb0000007ikZcEAI, [FirstOrderContact]a0C170000009Ty9?pv0=a04b000000CaWygAAF, [OrderContact]a0Cb0000006CSGt?pv0=a04b000000CaWygAAF, [TechContact]a0Cb0000006CSHD?pv0=a04b000000CaWygAAF, [AdminContact]a0Cb0000006CSGj?pv0=a04b000000CaWygAAF, [BillingContact]a0Cb0000006CSHI?pv0=00117000001vAA0AAM, [BillingAccount]a0Cb0000006CSGo?pv0=00117000001vAA0AAM, [Account]a0Cb0000006CSGe?pv0=001b000000RxhHX &TemplateId=015b0000000mYRt &OFN=Service+Order+Form+OR-019292 &EmailToId={QVar0} &EmailAdditionalTo={QVar1} &CongaEmailTemplateID=a0A17000000DSfq& EmailRelatedToId=a04b000000CaWygAAF &MFTS0=Stage__c &MFTSValue0=Order+form+sent &LG1=Order+Form+Sent &LG3=1&LG4=2&DS7=2 

All the {{ fields }} are merged with the values.

But, If I change the action of the button to ‘Run Multiple Actions’ and one of the actions is to run the snippet the merge fails (bolded the missing merges):


https://composer.congamerge.com?sessionId=i...]&amp;serverUrl=e...] &amp;id=a0h17000001AzH2AAK &amp;ReportVar=a0h17000001AzH2AAK &amp;QVar0Id=a0C17000000Et3N?pv0=a0h17000001AzH2AAK &amp;QVar1Id=a0C17000000Et3I?pv0=a0h17000001AzH2AAK &amp;QueryId=eOPPOwner]a0C17000000EwWW?pv0=, <b>&lt;&lt;&lt;---{{OpportunityID__c}}</b>

sSite]a0Cb0000006CSH3?pv0=, <b>&lt;&lt;&lt;---{{{Site__r.Id}}}</b>

sFirstOrderContact]a0C170000009Ty9?pv0=a0h17000001AzH2AAK, 2OrderContact]a0Cb0000006CSGt?pv0=a0h17000001AzH2AAK, 2TechContact]a0Cb0000006CSHD?pv0=a0h17000001AzH2AAK, 2AdminContact]a0Cb0000006CSGj?pv0=a0h17000001AzH2AAK, 2BillingContact]a0Cb0000006CSHI?pv0=, <b>&lt;&lt;&lt;---&nbsp;{{{Billing_Account__r.Id}}}</b>

sBillingAccount]a0Cb0000006CSGo?pv0=, <b>&lt;&lt;&lt;---&nbsp;{{{Billing_Account__r.Id}}}</b>

sAccount]a0Cb0000006CSGe?pv0= <b>&lt;&lt;&lt;---&nbsp;{{AccountID__c}}</b>

&amp;TemplateId=015b0000000mYRt &amp;OFN=Service+Order+Form+ &nbsp;<b>&lt;&lt;&lt;---&nbsp;{{Order_ID_show__c}}</b>

&amp;EmailToId={QVar0} &amp;EmailAdditionalTo={QVar1} &amp;CongaEmailTemplateID=a0A17000000DSfq &amp;EmailRelatedToId=a0h17000001AzH2AAK &amp;MFTS0=Stage__c &amp;MFTSValue0=Order+form+sent &amp;LG1=Order+Form+Sent &amp;LG3=1&amp;LG4=2&amp;DS7=2


I have the 5.21.4 (just updated) I don’t know if this happened in previous versions (i haven’t tested yet in one of my sandboxes with the 5.21.2)

Do you have any actions that do anything to the models prior to the snippet running? Screenshot of the actions please.


Hi Pat,

I have actions before, I tested it and if the first action is the snippet there’s no problem,

The other actions I have is create a record in other model (nothing to do with the fields I asking in the snippet) and save it:
9c37972f12c3a4241901ad9699e5fb0454084c05.png



hmmmm … I’d have to look see but only Skuid guys can do that.

I’ve noticed that it’s all the related IDs but not the row in context. That being the contact. hmmmm…

It’s as if all the other models fall out of context. Weird.


yeah I thought that, as if the “main” model fails but the Id field is working and all the fields requested are in the model definition, and no only lookup fields fail, normal fields also fail.


I think the problem is not with your snippet.  It is with the model you have in context.  Context can be very tricky - and we have not exposed good ways for you to see what record and data is in context as you traverse through a set of actions. 

You are expecting the merges to be filled with data from the model connected to the page title where this button is located.  This is what we typically think of as context. 

But what happens is that as soon as you create a new row in your action sequence,  the context switches to that new row and merges bring in the wrong data or none at all. 

So either move your conga action up in your sequence,  or use global data merge syntax in your snippet - as in: {{$Model.ModelName.data.0.FieldName}} This will ignore context and simply bring in data as needed.  (This won’t work if you are trying to bring in particular row data in a multi record scenario)

Hopefully this clears some things up. 

But to answer your question.  There should be no difference between a Snippet executied directly as a button action, and executied as the single action of a Multiple Actions chain. 



That explains it. The row in context changes. The IDs that did merge should then be in relation to the row that was just created in the above actions.


Ahhh ok, thanks for the explanation Rob!


You can mark it as solved :D 

I have decided put the conga url at the beginning, the other actions were only to store “you have sent the document”, so nevermind if it’s before or after the conga composer pop up


Reply