Jump to content

Portal script trigger for new record only.


Scott Pon

This topic is 2784 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Environment: FM13 with FM13 Server, mix of Windows 7 and 10.

Is there a way to set a script trigger on if this portal row is new? IE, a script to run if this new child/portal record is new.  

We have a parent record, and portal to Children records.  The children records have 2 fields: Profile Name and Process type.  Our user would like to enter a new child record (profile name and process type).  if the process type already exists, we will need to archive the existing record (matching the profile type).  There is more bI want to start with this first.

I see script triggers to the layout "OnRecordCommit", but no similar script trigger for portals.  Any ideas on how to handle this?  Or am I going to have to add a button to go to another screen to accomplish this?

Thanks.  I hope i gave enough info for you to help me.

 

Link to comment
Share on other sites

I would probably not allow direct editing of the portal - rather, I would have a plus button that launches either a new little window or a popover where the data is entered, and can be handled when a Done button or whatever is used....

  • Like 1
Link to comment
Share on other sites

Thanks for your input.  The editing directly into the portal was requested by the user, which is why I am investigating.  But your way is definitely doable.

Link to comment
Share on other sites

  • 3 weeks later...
On 14.7.2016 at 8:56 PM, Scott Pon said:

I see script triggers to the layout "OnRecordCommit", but no similar script trigger for portals.  Any ideas on how to handle this?  Or am I going to have to add a button to go to another screen to accomplish this?

You can put a script trigger to the field in portal. One possibility would be to add "OnObjectValidate" trigger. With one field in portal script can check if ID of the current portal record is empty. But if there are two fields in the portal "Profile" and "Process", you have to have additional logic, because ID is not anymore empty if Profile-field has been filled and user continues to the Process-field (record is created).

You could put another script trigger into the first field to check if the ID is empty and keep track of its ID by creating a global variable after committing the portal record (go to next field and then set the global variable of id). On the second field (Process) trigger the script that does the business logic and empties the global variable that was set on the first field's script.

Link to comment
Share on other sites

This topic is 2784 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.