You need to sign in to do that
Don't have an account?
custom button- look up issues
Hi,
I have created this custom button on Contracts (custom object)
/a06/e?CF00N30000007eLJc={Account.Name}&CF00N30000007eLJc_lkid={Account.id}& 00N30000007eKjn={!Account.Calle_facturacion__c}& 00N30000007eKjs={!Account.Ciudad_Facturacion__c}& 00N30000007eKkH={{!Account.Pais_facturacion__c}}& 00N30000007eKkM={!Account.Estado_Provincia_facturacion__c}& 00N30000007eKkR={!Account.Codigo_Postal_facturacion__c}& retURL=/{!Account.Id}
I go to an Account records and from there I create a new "Contract" not the standard object but a custom one....
When I click on the "NEW" custom button all the fields are populated except the 2 look up fields:
00N30000007eKkM={!Account.Estado_Provincia_facturacion__c}&
00N30000007eKkH={{!Account.Pais_facturacion__c}}
these ID´S are the "Contract" fields I want to prepopulate with the Account ones.
The question is why are all the text fields prepopulated correctly? For instance:
00N30000007eKjn={!Account.Calle_facturacion__c}&
00N30000007eKjs={!Account.Ciudad_Facturacion__c}
And why are the 2 look ups left blank?
The Accounts look up were filtered but I have deleted these filters!! I have also tried tried with quotes and with the account field ID without success
00N30000007eKjs="{!Account.Ciudad_Facturacion__c}"
00N30000007eKjs={!Account.Ciudad_Facturacionid__c}"
nothing!! :(
Any ideas!?
Got It!!!!
retURL=/{!Account.Id}
/a06/e?CF00N30000007eLJc={!Account.Name}&CF00N30000007eLJc_lkid={!Account.Id}&
00N30000007eKjn={!Account.Calle_facturacion__c}&
00N30000007eKjs={!Account.Ciudad_Facturacion__c}&
CF00N30000007eKkH={!Account.Pais_facturacion__c}&
CF00N30000007eKkH_lkid={!Account.Pais_facturacionId__c}&
CF00N30000007eKkM={!Account.Estado_Provincia_facturacion__c}&
CF00N30000007eKkM_lkid={!Account.Estado_Provincia_facturacionId__c}&
00N30000007eKkR={!Account.Codigo_Postal_facturacion__c}&
retURL=/{!Account.Id}
Need to put CF before any look up field & for the _lkid need to use the look up ID field.
:))))
Thanks Ankit!!!
All Answers
Not sure though, but worth giving a shot. When you want to fill the lookup reference using the URL parameter then you need to fill two values for lookup ids
1) Name of the object record in Id
2) Id of the object record in Id_lkid
Like you have already done for the first one
"e?CF00N30000007eLJc={Account.Name}&CF00N30000007eLJc_lkid={Account.id}"
Now if you want to fill the other two lookup reference then you should fill the id in lkid for them
00N30000007eKjs={!Account.Ciudad_Facturacion__c}&
00N30000007eKjs_lkid={!Account.Ciudad_Facturacion__c.Id}&
00N30000007eKjn={!Account.Calle_facturacion__c}&
00N30000007eKjn_lkid={!Account.Calle_facturacion__c.id}
In above I have just explained you how to do this but you need to figure out what exactly are the lkids for the lookup reference and what ids are to be filled in them.
P.S : You can find out the lkids and ids of reference fields in view source.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Thank you Ankit!!
You are right and I know i need to add the lkid but cannot find that info in this source??
00N30000007eKkH="Pais_facturacion__c"&
00N30000007eKkH_lkid="????"
Account.Pais_facturacion__c (id: 00N30000007eK3u) is a custom look up that looks at the Pais object:
object API name: Pa_s__c
object id: 01I30000001r182
Any other ideas?
Thank you.
If "Pais_facturacion__c" is a lookup field then you need to so something like this :
00N30000007eKkH="Pais_facturacion__c.Name"&
00N30000007eKkH_lkid="Pais_facturacion__c"
Let me know if it is not clear to you.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Got It!!!!
retURL=/{!Account.Id}
/a06/e?CF00N30000007eLJc={!Account.Name}&CF00N30000007eLJc_lkid={!Account.Id}&
00N30000007eKjn={!Account.Calle_facturacion__c}&
00N30000007eKjs={!Account.Ciudad_Facturacion__c}&
CF00N30000007eKkH={!Account.Pais_facturacion__c}&
CF00N30000007eKkH_lkid={!Account.Pais_facturacionId__c}&
CF00N30000007eKkM={!Account.Estado_Provincia_facturacion__c}&
CF00N30000007eKkM_lkid={!Account.Estado_Provincia_facturacionId__c}&
00N30000007eKkR={!Account.Codigo_Postal_facturacion__c}&
retURL=/{!Account.Id}
Need to put CF before any look up field & for the _lkid need to use the look up ID field.
:))))
Thanks Ankit!!!
This looks like everything you are pulling is from the same object - the Account page.
I have tried using the CF and the _lkid but for the life of me I can't figure out how to pull the Quote Lookup from the Quote Line Item to this new custom object :(
If you want to populate the field called "Hello" in the "New object" with
a field from the quote line item called "Laura"
And "Hello" ID is 00001111
Then your code should look like:
CF00001111_lkid={!Quote .Quotelineitem.lauraId}&
I'm doing that ...
https://na8.salesforce.com/a1O/e?
CF00NC00000052E9C={!Quote.QuoteNumber}&
CF00NC00000052E9C_lkid={!Quote.Id}
but it won't work.
I can pull from the Quote Line Item object okay, but it won't let me reach to the Quote object. But I have done something similar with a Contact and looked up to the Account.
Hi Laura,
Should be something like:
CF00N30000007eKkH={!Quote.QuoteNumber__c}&
CF00N30000007eKkH_lkid={!Quote.QuoteNumberid__c}&
as i said:
00N30000007eKkH this one is the field you want to prepopulate
Quote.QuoteNumber is the field you are taking the info from
First line CF + ID of the field you want to populate = Look up field name you take the info from {!Quote.QuoteNumber__c}
Second line CF + ID + _lkid = the look up field ID of the field ={!Quote.QuoteNumberid__c}
let me know if you have any issues
:))