Skip to main content
penone
Participating Frequently
Dec 30, 2021 9:27 PM UTC
Question

Spawning Templates On Save (with a catch)

I have a template that spawns x number of times based on a value of a field on the form. The spawn is set to happen when the files is saved. My issue is that when the form is first completed and created it is being done in Netsuite and as fasr as I know there is no way to trigger that script while this process is happening.

 

What the user is currently doing is letting Netsuite fill the pdf and then they download the form, change any field in the form and then revert that field to what it was before so that the save option is avaialble and then saves the form so the spawn is triggered. 

 

My goal is to bypass having the user manipulate a field so that the save option is available and the spawn is triggered. Any ideas on how I can achieve this?

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

try67
Community Expert
Community Expert
Dec 30, 2021 9:32 PM UTC

Add the following code as a doc-level script to your file:

 

this.dirty = true;

Translate
penone
penoneAuthor
Participating Frequently
Dec 30, 2021 9:39 PM UTC

Thanks. After typing my initial message I decided to have the script run on open but only if the page count is more than 1. So far this worked.

Translate
try67
Community Expert
Community Expert
Dec 30, 2021 9:44 PM UTC

It doesn't bother you it will spawn new pages each time you open the file?

Translate