Hello,
I tried to implement the proposed solution for adding a record from another form, but I am unable to make the full flow work.
AddRecordToLUp-20260201-194517762991885.fdf (3.4 MB)
For simplification the Representative field is optional.
1- When the user clicks the blue “+” button, I call the function OpenRepresentativeForm (Event On Click).
function OpenRepresentativeForm(five, context, result) {
five.setVariable(“CurrentFileKey”, five.field.FileKey);
five.selectAction(“Representatives”);
return five.success(result);
}
Problem: When the File form is in create mode, the FileKey is not yet generated, so CurrentFileKey is null. Is there any way to automatically save the Files form in this function?
2- When I call five.selectAction(“Representatives”), the list view is displayed and the user must click the yellow “+” button.
Is there a way to directly open the Representatives form in create mode ?
Something like selectRecord() that would open the form fullscreen, so the user doesn’t need to click the yellow plus button.
3- After the new Representative record is created, I want to return to the File record and pre-fill the Representative field. I call the BackToFileForm function called on th Event “On Complete”.
function BackToFileForm(five, context, result) {
five.setVariable(“CurrentRepresentativeKey”, five.field.RepresentativeKey);
five.selectAction(“Files”, five.getVariable(“CurrentFileKey”));
return five.success(result);
}
but the variable “CurrentRepresentativeKey” is always empty. I tried different types of event with no success.
Can I use the same function to set the CurrentRepresentativeKey in the five.field.RepresentativeKey ?
4- If the user opens the Representatives form with the side menu, they will then bring to the Files form. Is there a way to prevent this or should I create a clone of the Representatives form without the function that brings the user back to Files form ?
This feature is very important for my application, and I would love to know the recommended way to implement this workflow.
I joined the fdf of my sample application.
Thank you!