I have a main form with a primary field and a look up field. When clicked on the look up field, a QuickCreate form appears. That QuickCreate form also contains a look up field to the table of the main form. But as long as the main form isn't saved I cannot find the primary field of the main form in the look up field of the QuickCreate form.
Can someone help? Thank you
Solved! Go to Solution.
Yes, you can trigger a save automatically on any form event.
What you're looking for is a piece of formscript that sits on the onChange event for the field you are targeting and when it fires, it checks null, sets submit mode, and refreshes the page with save True. There will be a small flicker while the page reloads which users might complain about but probably they will never notice. The script then would look something like:
if (typeof (myScript) === "undefined") { var myScript= {}; }
myScript.execute = function(executionContext) {
'use strict';
var formContext = executionContext.getFormContext();
if(formContext.getAttribute("myAttribute").getValue != null)
{
formContext.getAttribute("myAttribute").setSubmitMode("always");
formContext.data.save().then(function (result) { }, function (error) { });
}
}
Yes, you can trigger a save automatically on any form event.
What you're looking for is a piece of formscript that sits on the onChange event for the field you are targeting and when it fires, it checks null, sets submit mode, and refreshes the page with save True. There will be a small flicker while the page reloads which users might complain about but probably they will never notice. The script then would look something like:
if (typeof (myScript) === "undefined") { var myScript= {}; }
myScript.execute = function(executionContext) {
'use strict';
var formContext = executionContext.getFormContext();
if(formContext.getAttribute("myAttribute").getValue != null)
{
formContext.getAttribute("myAttribute").setSubmitMode("always");
formContext.data.save().then(function (result) { }, function (error) { });
}
}