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
sapsap 

To populate a standard field with a value from temporary variable using S-control

hi, I am able to prepopulate fields using current record values like
 
parent.frames.location.replace("/006/e?retURL=%2F006%2Fo&RecordType=012500000009ELe&opp4={!Permits_Wells__c.Account__c}") }
 but now my requirement is to populate a standard field 'account name(acc2)'with a temporary variable 'name1' using
 
name1="xxxx";
parent.frames.location.replace("/001/e?retURL=%2F001%2Fo&acc2=name1") } I tried using this but this is not working. Is there any problem with the syntax. Any help is appreciated. thanks in advance.
marie.tournemarie.tourne
I think it should be written this way :
parent.frames.location.replace("/001/e?retURL=%2F001%2Fo&acc2="+name1)
name1 is a JavaScript variable, you have to concatenate it (+ operator) with the rest of the string, in order for the URL to be evaluated like : parent.frames.location.replace("/001/e?retURL=%2F001%2Fo&acc2=xxxx")
sapsap
hi, Thanks alot for your reply. My code is working now.