How to calculate an Unstored Field while in Editing Screen

Notes on the new SeedCode Complete template for FileMaker 13
Posts: 109
Joined: Tue Jul 15, 2008 12:41 am
Location: Perth Western Australia
PostPosted: Wed Dec 05, 2018 6:55 pm
Hi Guys,

I am wondering if you can give me a tip on a problem I have encountered. I have extended the Project use quite a lot and while entering in the Editing screen I have two unstored fields calculating the MAX dates from portals.

The unstored fields are only calculated when I click the Save button, which results in wrong data in fields that are related and use the first MAX date field to calculate the second MAX due date.

I calculate the finance due date from a portal to a max due date.
This max due date is then used to calculate the settlement due date and the max due date.

On the attached screenshot, it shows the max due date calculated after I clicked Save.
Coming back in the edit screen I added the second line, but the max due date is not updating to 14/2/2019
And the settlement date is using the max due date and calculating wrong because it is not updated, it should be 24/2/2019

So long story short, how can I force FileMaker to calculate the unstored fields without exiting the Edit screen?

I tried to add a commit record script trigger to the portal fields, but no luck.

Any tip would be greatly appreciated.

Thanking you in advance.

Regine
Attachments
maxduedate.PNG
maxduedate.PNG (17.47 KiB) Viewed 25 times
SeedCode Staff
SeedCode Staff
Posts: 684
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Thu Dec 06, 2018 2:05 pm
Hi Regine,

Yes, this expected in Complete as the OnCommit script trigger is keeping the record from committing, which prevents the unstored calculations based on the relationship to evaluate. The stock complete answer to this is to use triggers to loop through the portals and write the totals to globals. You should be able to see this in action in the invoice and estimate line item as that's how the totals are updated there. I know the triggers are a lot more work then the unstored calculations, but we really wanted to be able to revert all changes in edit mode, and holding the record open is the best way (that I know of) to do this in FileMaker.

Let me know if that helps and if you have any other questions.

Best,
-Jason

Return to SeedCode Complete 13

Who is online

Users browsing this forum: No registered users and 1 guest

(855) SEEDCODE
support@seedcode.com
Follow us: