-1

I am currently having some trouble implementing a functionality where we need to create a form for kyc related to the account, and be able to reach it by an unique url. I've found two questions very close to what i'm looking for, but they are both very old and also without clear steps to generate the unique url, those being:

Generate Unique URL in salesforce and Visualforce page with unique URL?

These answers appears to be quite useful in terms of what to do but i still don't understand how to do it. I'm also worried that i can't directly use the id of the account in the url (safety concerns) and since those questions are old, there may be a better or new standard way to do this?

For the sake of completion, i will list clearly the steps i need to perform and where exactly my trouble is:

  1. When we convert a (Lead -> Contact, Opportunity, Account) a blank KYC record should be created and related to the account (done);
  2. A button should be available in the record page for sales people to click and trigger the action (done);
  3. The action should create a unique url that will open a form to update the unique kyc related to that particular account (how?);
  4. Trigger to happen after update of kyc record (done).

Any recommendations?

1 Answer 1

0

We do this all the time, all you need to do is pass in a variable to the url then handle the variable in the controller.

For example say your form base url would be something like this: https://yourcoolsite.com/s/form

Then you have a parameter you want to pass through like account id you could do something like: https://yourcoolsite.com/s/form?param=0010000ABC. In your button you're concatenating the base to the parameter to make a unique link. In the controller class you'd have a variable for the param and then you can use that to reference back to the Account.

If you want to go real crazy you can encode your parameter so it doesn't look like a Id but a bunch of letters, then you simply decode it back in the class. I did, it makes the url longer and more confusing, maybe you don't need to do that, but you could.

Now your unique link can be shared out to your customer or whomever or make a QR code with it.

2
  • Thanks a bunch! That's exactly what i was confused about. Set up a new page in a community and the controller is querying the correct record using the parameter. P.S.: I am actually encoding and decoding the parameter for safety xD Commented Feb 19 at 20:56
  • Exactly, and you can keep expanding on the idea, for example I have a custom object storing the links so we query that and not a Account record, because I have different field values to pass into the controller that displays different text or we populate the record that's created/updated. Commented Feb 20 at 18:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.