0

I've created the following URL Hack button.

https://cs24.salesforce.com/a11/e?
 CF00N19000000LoMt_lkid=00119000003Y9T3AAK
 &CF00N19000000LoNI={!Visit_Report__c.Name}

Notice the CF00N19000000LoMt_lkid=00119000003Y9T3AAK

This is the Account ID on a related list that I"m trying to force to a specific account each time record is created. I don't have coding skills to create a trigger for this. Any thoughts on what I'm doing wrong?

Every time I hit the button, it leaves the Account ID field blank.

  • 2
    What happens if you add &CF00N19000000LoMt=Test? – Boris Bachovski Jan 22 '15 at 22:45
3

The custom field ID for lookup fields comes in 2 forms, the field ID which takes in the name of the lookup record and also the field ID followed by _lkid which takes in the record ID. What happens in your case, you're setting the lookup ID but not specifying the name of the record, hence it's showing blank. Try appending the name of the record to the URL as well:

&CF00N19000000LoMt=YourRecordName

2

You need to also add the name of the object setting "&CF00N19000000LoMt=A%20Name"

  • Can you expand on this answer to educate @Jim about why this is necessary and what the difference is between this and the _lkid parameter? – Mark Pond Jan 23 '15 at 2:32
  • 1
    First of all this is not an officially supported way to populate fields when editing records through the standard edit page (so it might not work anymore in the future). Secondly you need to specify both [FIELDID] and [FIELDIF]_lkid because you need to set both the record ID and it's rpimary Name field: this way on load SF loads the object correctly. This is not documented anywhere, it is a purely pragmatic explaination :) – Enrico Murru Jan 23 '15 at 15:41
  • Hi All. Thanks. It does work when you append the name of the record to the lookup, however my concern in doing that is somebody will come along and create a duplicate record and will cause my lookup to fail. I know that you can do this with a trigger, however I'm not skilled in coding, so unfortunately this is not an option for me. @enreeco are you saying my code should now look like CF00N19000000LoMt_lkid=A%2000119000003Y9T3AAK – Jim Mottola Jan 26 '15 at 15:17
  • No it should be "&CF00N19000000LoMt=Account%20Name&CF00N19000000LoMt_lkid=00119000003Y9T3AAK" – Enrico Murru Jan 27 '15 at 16:45

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.