Hi Everyone
I have the following scenario:
[LIST]
[*]User creates a Quote (Customer Only)
[*]User converts quote into Sales Order and needs to add a new Job
[*]User clicks on the + icon next to the job field to create a new job in the popup window
[*]The job is pre-populated with the Customer from the Sales Order Entity field
[*]User populates job fields and saves
[*]User saves Sales Order
[/LIST] What I'm looking to achieve is to pre-populate other job fields from the existing sales order field values.
I figured I could try and attempt to do this by manipulating the onclick value of the + button to pass through more parameters into the URL. When I inspect the element, the current button's onclick value is: function() {setSelectValue(document.forms['main_form'].elements['entity'],-1); document.forms['main_form'].elements['entity_display'].value=''; document.forms['main_form'].elements['entity_display'].isvalid=true; NS.form.setValid(true); Syncentity(true);return false;}
Based on clicking that button, only the entity value is passed through (example: https://system.sandbox.netsuite.com/app/accounting/project/project.nl?job=T&target=main:job&label=Job&parent=18253&entity=18253)
What I was hoping was to be able to have other parameters appended to the URL (example: https://system.sandbox.netsuite.com/app/accounting/project/project.nl?job=T&target=main:job&label=Job&parent=18253&entity=18253&classId=1&department=2&location=3)
Then I could utilise a User Event Script onBeforeLoad function to populate those values in whichever field when the job is being created.
I understand manipulating the DOM is not the ideal way to go but there doesn't seem to be a better way to add jobs from the Sales Order with further pre-populated fields. If I create a separate button for this process, I believe it won't add it to the job list in the sales order in real time so they'd have to refresh the customer field to see the job.
Any help is appreciated.
Thanks!