My main aim is to show different fields on child object, if the parent object has a particular piclist value.

To achieve this I have created 2 record types and 2 page layouts.

So I have created a custom button to add the child record with prefilled value of the parent by URL hacking.

/a0T/e? CF00N0k000002irEW={!TRIM(Returns_Request__c.Name)} &CF00N0k000002irEW_lkid={!Returns_Request__c.Id} &retURL=%2F{!Returns_Request__c.Id} &RecordType={!IF( INCLUDES( Returns_Request__c.Reason__c ,'Incorrect Pricing') ,'0120k0000008QsNAAU','')} &ent=01I0k000000AsBx

This is the code I have used. It works perfectly on website but does not work on mobile.

Please suggest any improvement on this or maybe a completly different way to show different fields on child record creation based on parent record picklist.


You want to replace your url hack with actions.

Here is a talk on how to do it: https://www.salesforce.com/video/300736/

  • But the thing is I tried actions and for salesforce classic. But in this, I had to create 2 different actions for the object, which has different fields in it. Now the user will have to choose which action button they want to choose for creating the child record. This may lead to users choosing the wrong action button having different fields. – Upasana Paul Jul 19 '19 at 1:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.