I have been trying to get the script "Create records for multiple templates" to work in an automation script. I am trying to get this to work because the button I have in the base the run the extension script does not work in Interface Designer. Any Help or insight to get this to work would be greatly appreciated, or if you know of a work around to get the button to work in the interface that would work as well.
Below is the original script and the values from the base used to the script prompt.
this is the code from the script:
These are the tables and fields that fills the information that the extension is looking for:
// Define fields from script settings
let childFieldInTemplate = templateTable.getField("Project Task (Template)");
let childNameInChild = childTable.getField("Name (Task)");
let childOrder = childTable.getField("Task#");
let templateOrder = templateTable.getField("Task#");
let templateType = templateTable.getField("Type (Link)");
let parentFieldInChild = childTable.getField("Projects (Link)");
// Define tables from script settings
let parentTable = base.getTable("Projects");
let typesTable = base.getTable("Project Type");
let childTable = base.getTable("Project Task (deliverables)");
let templateTable = base.getTable("Project Template");
The script you posted was designed to run in Scripting Extension and will not run as written in an automation. Thus, it will not run as written from an interface button.
It looks like someone who is familiar with the differences. between scripting extension and automation scripts could easily make the changes to get it to work.
- Hardcode the names of all the tables and fields instead of using script settings
- Get the record ID of the triggering record through an input variable and query for the record based on the id to get all the necessary field values.
- remove the output