Creating URLs off $triggerObject
Yet another Velocity question for @Sanford Whiteman or someone with similar experience.
We create URL's based on an ID of the most recently updated custom object. The issue is, even though the ID field is populated 100% of the time and there is no duplicate Contact, the variable doesn't load consistently.
##IF A NET-NEW ONBOARDING RECORD IS CREATED, PULL ITS ACCOUNT ID##
#if ($context.contains("TriggerObject"))
#set ($focusedObject = $TriggerObject)
##IF AN EXISTING ONBOARDING RECORD IS UPDATED, PULL ITS ACCOUNT ID##
#elseif ($context.contains("OnboardingRelationship_cList"))
#set ($focusedObject = $sorter.sort($OnboardingRelationship_cList,"updatedAt:desc")[0])
#end
##IF PHOTOGRAPHY ISN'T SCHEDULED, DISPLAY TEXT BLOCK, ELSE NOTHING##
#if ($focusedObject.Photography_Scheduled__c == 0)
<b>Photography</b><br>
Please click <a href ="https://website.com/new/photos?flow=uk-s&sfid=$focusedObject.accountID">here</a> to book your photography. We will upload your photos once they’re ready. In the meantime you can go ahead and start accepting orders!<br>##
#else
#end
The website url actually shows the variable name instead of the ID. Yes, I've made sure the box is checked and I'm not using send sample functionality.
Appreciate any thoughts or ideas.