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
emuelasemuelas 

Prepopulate vf from javascript button.

Hi ,

 

I have  a javascript list button with a lot of validation and stuff for the selected lines.This button creates a new purchase order at the end  and opens the new purchase order form.My code was something like this:

 

..../*validation code*/...

 

--at the end if evrything is ok i have something like this where the fields of the new purchase order form get prepopulated using the address--

 

window.location.href ="/a0I/e?retURL=%2Fa0I%2Fo"+
"&CF00NR0000000cvG6={!Sales_Order__c.Name}"+
"&CF00NR0000000cvEt={!Sales_Order__c.Default_Warehouse__c}";

 

Now for further development i needed to have a visualforce new form for purchase orders....

So now iam unable to prepopulate this....

the addresses look wierd..


window.location.href ="/a0I/e?retURL=%2Fa0I%2Fo"+
"&j_id0:j_id1:j_id29:j_id33:test={!Sales_Order__c.Name}"+

 

I need to be able to retain the earlier javascript code because of the complex validations........Can someone please help me with this prepopulating?

 

 

cloudgofercloudgofer

try using JQuery to search for the element by partial id and then change innerHTML