1

I'm currently injecting custom Javascript onto specific record types via the User Event Scripts -> Before Load Function script.

In this script, I'm adding a field to the form with type 'inlinehtml', and then adding javascript within tags.

Is this the Netsuite preferred method? Seems extremely hacky.

Here's the example I'm working with: Have the built-in Customer form run a check on session vars and, if a specific var is set, to update the page with info based on that var.

I'm injecting js into the page because I need the URL to load to apply a new URL param or change an existing URL param based on the session var.

1 Answer 1

2

Your before load event function signature looks like: function beforeLoad(type, form, request) You can create a client side script and then use it's script id like:

function beforeLoad(type, form, request){
  form.setScript('myscriptid');...

and Netsuite will load that script and any dependencies (library files) defined in the script definition.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.