function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Populating objects from custom button URL field

I am having a small issue populating 2 fields in my custom button, everything else seems to work fine but the account field does not populate anything and I cannot populate a user in the account contact field.  comments by the problem areas. code:
CF00N3B000000OKFI_lkid={!Opportunity.Primary_Contact__c.UserId}&//not sure how to reference the user id here?
CF00N3B000000OKFB ={!Opportunity.Account}&//this field is left blank, but these references work in any other field i assign them to
Name=Quote For {!Opportunity.Name}

and in fact i would rather have the primary user in the related list Contact Roles as the Account contact.  Any help is greatly appreciated!
Prabhat Kumar12Prabhat Kumar12
On this line you can use only {!} . Because this field seems a contact field and you need to use id in contact lookup field.

Try to change {!Opportunity.Account} to ​{!Opportunity.AccountId} .

Let me know if does not work.
it gives me an error when using 
Error: Field does not exist. Check spelling.

the primary_contact__c is a  lookup(Contact) if that makes a difference
Prabhat Kumar12Prabhat Kumar12
Use this 

 {!}  this will work.
Jayson Faderanga 14Jayson Faderanga 14
what Prabhat suggest is're referencing a foreign entity, you need to append __c with __r for the system to get the right value for reference.