Skip to main content
penone
Participating Frequently
December 30, 2021
Question

Spawning Templates On Save (with a catch)

  • December 30, 2021
  • 1 reply
  • 517 views

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 has been closed for replies.

1 reply

try67
Community Expert
Community Expert
December 30, 2021

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

 

this.dirty = true;

penone
penoneAuthor
Participating Frequently
December 30, 2021

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.

try67
Community Expert
Community Expert
December 30, 2021

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