3

I am trying to create a custom URL button that will be placed on both a Person Account and a Business Account page layout. I want the button to launch a case creation form with record type = "Member Initiative", Account Name = AccountId of record where the button was pressed, Contact Name = Primary Contact ID of record where the button was pressed (for Business Accounts) and Contact Name = Contact ID of record where the button was pressed (for Person Accounts).

I know this can be done using the quick action button, where you can set predefined field values through point-and-click configuration, however at this time, Salesforce does not allow me to put the "Use Active Assignment Rules" checkbox on an action button form and there are instances where these cases need this functionality. Therefore, I am going down the route of creating a custom URL link so that the full form launches and users have the "Use Active Assignment Rules" functionality.

I have been trying to use this SF resource: https://help.salesforce.com/articleView?id=custom_links_constructing.htm&type=5, but so far I have had no luck, as the Account Name/Contact Name fields are not populating no matter what I do.

Any help is greatly appreciated. Thanks,

Ricki

5
  • Assuming you're on Lightning, the Spring 20 release brought back the ability to pass predefined fields in a custom URL Mar 17, 2020 at 21:05
  • @KrisGoncalves I tried to get this to work also, and got an error message saying that the field I was trying to modify wasn't available... when it was. So perhaps there's setting or maybe the url params are wrong? Mar 18, 2020 at 0:08
  • @KrisGoncalves Yes, i read through that article and tried to recreate the exact same thing in the context of my situation but using the example they provided. I put: /lightning/o/Case/new?defaultFieldValues= AccountID={!Account.ID} Just to at least pass the account name into the new case creation form, but even this didn't work. Then I tried doing like Subject="test test test" in the URL to try and pre-populate that, and no luck.
    – Ricki Reay
    Mar 18, 2020 at 1:48
  • @CasparHarmer Thanks for the adding in your experience with this. I am not encountering any error message and the button saves and shows up when I put it on the page layout, however I am unable to pre-populate any of the fields!
    – Ricki Reay
    Mar 18, 2020 at 1:54
  • Oh the error I get here is when I try to save the record from the new record layout - I also get that far. I wonder if it's just something weird with Cases - have you tried another object type? Mar 18, 2020 at 2:19

1 Answer 1

2

You can do like this:-

/lightning/o/Case/new?defaultFieldValues=RecordTypeId=012B0000000RBwHIAW,
AccountId={!Account.Id}&backgroundContext=%2Flightning%2Fr%2FAccount%2F{!Account.Id}%2Fview

enter image description here

enter image description here

enter image description here

2
  • Thank you so much - I VERY much appreciate your help!!! This worked and I added in a few other parameters for pre-population. One more thing that I am now encountering issues with, if I want to set the Contact ID field on the new case = Primary Contact on the account when the Primary Contact field is filled out, but leave blank if Primary Contact is null, how would I go about coding this conditional statement within my URL?
    – Ricki Reay
    Mar 18, 2020 at 18:41
  • I am very interested in the pre-population of ContactID in a case by SFDC URL as well. I've understood, this is a quite an old post, but probably someone can help in that regards
    – Frank
    May 25 at 7:35

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.