This topic contains 1 reply, has 0 voices, and was last updated by pcutler 6 years, 11 months ago.

  • Author
    Posts
  • #21387

    vandite

    Hi Everyone

    I have the following scenario: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
    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/…3&entity=18253)

    What I was hoping was to be able to have other parameters appended to the URL (example: https://system.sandbox.netsuite.com/…t=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!
    This is a cached copy. Click here to see the original post.

  • #21388

    pcutler

    I would avoid manipulating the onClick event if possible. You're going to be fighting with each new release to stay compatible.

    Look further into creating a separate button for your process. To deal with the issue you mentioned with the new job record not being in the drop-down list, change your preference for MAXIMUM ENTRIES IN DROPDOWNS under Home > Set Preferences to 0. Then the field will always display as a search box as opposed to loading the options with the page.

    Another alternative would be scripting the whole process with a Suitelet.

You must be logged in to reply to this topic.