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
ClubliClubli 

Custom buttom to populate lookup field

Hi,

 

I have been working on a custom button on contracts. I want to be able to create a new case with a default record type. My problem is that I cannot get the contract lookup field to populate. The code I'm using is:

 

/500/e?RecordType=012P0000000CpQV&CF00NP0000000ZqEo_lkid={Contract.Id)&cas4={!Account.Name}

 

Everthing else is working fine, I just cannot get the contract lookup field to populate. Any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
ClubliClubli

Hi Ankit,

 

Almost right. Instead I had to use the Contract Number. Thanks for pointing me in the right direction.

 

/500/e?RecordType=012P0000000CpQV&CF00NP0000000ZqEo_lkid={!Contract.Id}&CF00NP0000000ZqEo={!Contract.ContractNumber}&cas4={!Account.Name}

 

 



All Answers

Ankit AroraAnkit Arora

If I am not wrong then you are calling this URL from contract right?

 

So you are entering Contract id in URl :

 

CF00NP0000000ZqEo_lkid={Contract.Id)

 Which is correct, including this you need to pass the Name also which will look something like this :

 

CF00NP0000000ZqEo={Contract.Name)

 Let me know if you still face any problem.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

ClubliClubli

Hi Ankit,

 

Almost right. Instead I had to use the Contract Number. Thanks for pointing me in the right direction.

 

/500/e?RecordType=012P0000000CpQV&CF00NP0000000ZqEo_lkid={!Contract.Id}&CF00NP0000000ZqEo={!Contract.ContractNumber}&cas4={!Account.Name}

 

 



This was selected as the best answer
RevJoelRevJoel

I have a similar issue. A custom button was created on Cases to allow for the creation of an Opportunity. In this, I am attempting to pass the Case Number to the new Opportunity. So far, the Case Subject and Account are successfully being passed, but the case number is not working. Here is what I have done:

 

https://na3.salesforce.com/006/e?retURL=%2{!Case.Id}&accid={!Account.Id}&opp3={!Case.Subject}&00N50000002Puns_lkid={!Case.Id}&00N50000002Puns={!Case.CaseNumber}

 

The field: 00N50000002Puns is a custom field that I wish to populate with the Case number as a link (it is a Lookup field). This is  because I need to be able to click that link to go back to the case from within the opportunity. 

 

Any advice or is there a better way to do this? Thanks!

RevJoelRevJoel

bump. .Anyone?