Skip to main content
Nintex Community Menu Bar
Question

Mergefield syntax to dynamically populate SObject Id (recordtype selection page redirect)

  • July 9, 2024
  • 2 replies
  • 24 views

Forum|alt.badge.img+3

I am implementing a redirect action from a table component that will take the user to the recordtype selection page in order to create a new object with standard SFDC UI. I have constructed the below Url and it works fine. Question: Is there any mergefield syntax that I can use to avoid hardcoding the SObject Id in the Url, otherwise this adds a cumbersome manual step during migration to replace the Id based on the target org. (Note, this is not an Id of a given record, but an Id of the SObject itself) /setup/ui/recordtypeselect.jsp?ent=01IG0000001s8EL&retURL=%2F{{Model.KeyPrefix}}%2Fo &save_new_url=%2F{{Model.KeyPrefix}}%2Fe%3FretURL=%2F{{Model.KeyPrefix}}%2Fo Decoded Url: /setup/ui/recordtypeselect.jsp?ent=01IG0000001s8EL&retURL=/{{Model.KeyPrefix}}/o &save_new_url=/{{Model.KeyPrefix}}/e?retURL=/{{Model.KeyPrefix}}/o Thanks in advance.

This topic has been closed for replies.

2 replies

Forum|alt.badge.img+13

Hi Andrey, Unfortunately, SObject Ids are not exposed anywhere in Salesforce’s API, so there’s no merge variable we can provide which will allow this to be possible. However, there is a workaround. If you create a very basic Visualforce Page, you can leverage the Visualforce $Action global variable to generate this URL. You can then point to this URL from your Table redirect Action, e.g. 1. Create a VF page named “NewTechReviewRedirect”, with its body equal to

<apex:page action="{!URLFOR($Action.ISV_Tech_Review__c.New)}"/> 

(using the API name of your object, of course) 2. Use this URL in your Table redirect action: URL: “/apex/NewTechReviewRedirect” Assuming that your ISV Tech Review object has RecordTypes, and that the user does not have a default Record Type selected, this should send you to the RecordType Selection step first, and then to the corresponding object’s New page.


Forum|alt.badge.img+3
  • Author
  • July 9, 2024

Thanks Zach, I will try this workaround.