You need to sign in to do that
Don't have an account?

prepopulation of lookup field
Hi All,
can anyone tell me how to prepopulate an account lookup field while creating a new record from a related object. And this should happen through onclick javascript of a button cos i m nt using VF pages here.
Thanks,
Sandeep
Hi,
Please find attached an example where account id needs to be prepopulated from object1 on to object2 when object2's instance is edited. We are using URL to prepopulate certain fields here:-
1) Account ID
2) Job Number
I am presuming you want to pass Account information from "Object1" to "Object2".
As you are talking about using button to implement this hence, I think simple URL to update this information in the survey object. I think the attached code will explain things in a better way:-
I am also assuming that "Object2 "object is linked by a lookup field with the "Object1" object
/a09/e?id={!Object1.Object2}&00N80000004I201={!Object1.AccountId}&00N80000004I206={!Object1.JobNumber}
Here id is the id of the Object2 object
00N80000004I201- is the id of the html control storing Accountid
00N80000004I206- is the id of the html control storing JobNumber
This is an example with edit you can do something similar with create too.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Does anybody know how the HTML control Id is generated? I don't like the idea of having to screen scrape to get them - doesn't make for a very portable App...