Hi. I'm executing some code in a client script, on...
# suitescript
s
Hi. I'm executing some code in a client script, one block of jquery to add some elements to the page, and one block of "currentRecord" code to add some sublist items. Even though the jquery is first, the currentRecord block is executing first, followed by the jquery. Does anyone know how to force the jquery to be first? Use case is that I want to blank the page out with some html while my code runs, then I will remove the overlay.
s
I've got an interesting proposal for you to try (not sure if it'll work) but try an inline html field with the jquery.
to my understanding inline html custom fields will and can also trigger scripts (as in like jquery or like javascript like mimic console), not sure what's faster tho
s
That's an interesting idea, however i'd only use that as a last resort here as we have way too many custom fields as it is and I dont want to have any more server code to add one. I must be missing something, there must be a way to force jquery before the currentRecord module.
b
what does your code look like
s
I have just this second got it to work. I was using window.opener on a child popup page to reference the parent page - setting the jquery overlay code on the window.onbeforeunload of the child window works.
s
@Sam L I'm saying using one inlinehtml custom field on your record so that when you load the record it'll trigger those and trigger your jquery, not sure if that'll help Not one jquery per custom field
s
@Sciuridae54696d yeah I did get what you meant, but not a route I wanted to go down until i ran out of options - as it turns out I was close, just needed to put the jquery on unload function of the page which executed it
Thanks though!
👍 1