Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Attached is a new file created only for this test.  It has never crashed.  Tested on Mac 10.8.4 using FMPA 12.0v4.  Not tested on Windows since my windows system is currently down.  To replicate what seems to be the issue:  

 

Type a number into portal field.  On first child record created in portal, it updates the Parent Balance (yellow) consistently whether I tab, hit RETURN or de-select by clicking the layout ( committing ).

 

But in ONE situation, it will not update ...  on all subsequent portal records, if you hit RETURN ( I'm on MacBook Pro ), the trigger will fire but the Balance will not update.    We know that the cBalance calc updates (it's right below the yellow balance) so the cBalance calc recognises the new number but trigger does not.

 

What I've determined so far:

 

Not a commit issue - adding a commit to the script does not solve it.

Changing the calc doesn't help - referencing the cBalance instead of Sum ( Child::Amount ) in the script does not solve it.

 

I am stumped.  File attached. This is unexpected behavior ( to me at least ). Is there a principle at work that I do not understand?

 

I have set to 'go to next field' on tab, return and enter.  And I realize Mac handles RETURN a bit differently that Windows but I still would have thought it should update since it DOES fire.

ObjectExit.fmp12.zip

Posted (edited)

Isn't it funny how we can spend a lot of time trying to solve something and then as soon as we post, we solve it?  Well, I figured it had to do with commit but I was adding the commit at the end of the script and that would be too late since the Balance was already set.

 

Moving the commit to the beginning resolves it so it must be because Mac, when hitting RETURN, is ahm ... different?  My Mac RETURN key also says 'enter'.  But if so, why does it work on the FIRST child record?

 

Would it be correct to say that is the issue here ... that the Mac RETURN key ( when checked 'go to next field' ) behaves differently than all other exit methods on both platforms?  I won't always want to add a commit.

Edited by LaRetta
Posted

I suggest you use a different field as your source. Rather than using sum() create a summary field in the line items table and grab that (related) value. No need to commit. Worked for me, independent of field exit method.

ObjectExitMOD.fmp12.zip

  • Like 1
Posted

Indeed that works perfectly, Bruce!  Thank you!  And I suppose it makes more sense from refresh POV ( more directly route ).

 

I still would like to pin it down - why it doesn't refresh on subsequent rows but does on the first and why commit is necessary for RETURN but not necessary for tab ( which doesn't commit at all ).

 

This is precisely the kind of thing which can bite me in future if I do not understand its underlying principle.   Luckily, I test everything I do in independent files before ever moving them into a solution or I might not have caught it at all since I usually tab or click the layout instead and it works perfectly in those instances.

 

These kinds of things are such great opportunities to learn much more than just solving an immediate problem.  

Posted

I didn't see that you had attached a file afterwards, thank you.  Why do you feel the need to set a variable first?  

Posted

I like to watch.

 

That is, I like to look at things when testing scripts. Such as, for instance, being able to see what the summary value is that the script is seeing when it runs. I had also tried some other methods of pulling the value. By putting it into the variable, I could comment out or change my set variable step and leave the set field step as is.

Using the variable method isn't necessary. Just my preference. 

  • Like 1

This topic is 4110 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.