Fix firstRender accidental delete; pass apiName, version to qController.testScript

This commit is contained in:
2023-04-30 19:57:47 -05:00
parent 3a5d2b22b9
commit 4d92a71848

View File

@ -70,6 +70,11 @@ function ScriptTestForm({scriptId, scriptDefinition, tableName, fieldName, recor
const [testException, setTestException] = useState(null as string) const [testException, setTestException] = useState(null as string)
const [firstRender, setFirstRender] = useState(true); const [firstRender, setFirstRender] = useState(true);
if(firstRender)
{
setFirstRender(false);
}
if(firstRender) if(firstRender)
{ {
scriptDefinition.testInputFields.forEach((field: QFieldMetaData) => scriptDefinition.testInputFields.forEach((field: QFieldMetaData) =>
@ -108,6 +113,8 @@ function ScriptTestForm({scriptId, scriptDefinition, tableName, fieldName, recor
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// associated record scripts - run this way (at least for now) // // associated record scripts - run this way (at least for now) //
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
inputValues.set("apiName", apiName);
inputValues.set("apiVersion", apiVersion);
output = await qController.testScript(tableName, recordId, fieldName, code, inputValues); output = await qController.testScript(tableName, recordId, fieldName, code, inputValues);
} }
else else