You need to sign in to do that
Don't have an account?
JackTinsley
OnClick Javascript - Ampersand in Account Problem
I use the following custom button OnClick Javascript code to pass some values and create a new Case from a Contract.
var CaseURL = "/500/e?CF00N70000002BrKD={!Contract.ContractNumber}&CF00N70000002BrKD_lkid={!Contract.Id}&cas4_lkid={!Contract.AccountId}&cas4={!Contract.Account}&cas5=Maintenance%20Request%20RMA&retURL=%2F{!Contract.Id}";
parent.frames.location.replace(CaseURL);
The code does exactly what it's supposed to do but when a value for Account is passed through that has an ampersand in it everything after the ampersand is left off ex. "Jack & Jill" becomes "Jack". When you save everything it is corrected since the ID was properly assigned but I'd sure like to not have my users alarmed when they see the name botched.
So far I've tried to surround {!Contract.Account} with single (%27) and double quotes (%22) but all that does is put a single or double quote in front of the value.
Thanks much.
var CaseURL = "/500/e?CF00N70000002BrKD={!Contract.ContractNumber}&CF00N70000002BrKD_lkid={!Contract.Id}&cas4_lkid={!Contract.AccountId}&cas4={!Contract.Account}&cas5=Maintenance%20Request%20RMA&retURL=%2F{!Contract.Id}";
parent.frames.location.replace(CaseURL);
The code does exactly what it's supposed to do but when a value for Account is passed through that has an ampersand in it everything after the ampersand is left off ex. "Jack & Jill" becomes "Jack". When you save everything it is corrected since the ID was properly assigned but I'd sure like to not have my users alarmed when they see the name botched.
So far I've tried to surround {!Contract.Account} with single (%27) and double quotes (%22) but all that does is put a single or double quote in front of the value.
Thanks much.
Also, I don't think you need to fill the IDs (lkid).
Message Edited by maziz on 11-26-2008 01:55 PM
See the changes made in the URL below...It should now pass the AccountID field into Case Account Lookup field
var CaseURL = "/500/e?CF00N70000002BrKD={!Contract.ContractNumbe