Add man Event Update Script to End of Project Edit Script

Notes on the new SeedCode Complete template for FileMaker 13
Posts: 129
Joined: Tue Jul 15, 2008 12:41 am
Location: Perth Western Australia
PostPosted: Sun Jan 13, 2019 11:56 pm
Hi Guy,

I would like to perform automatically an events update script after I have edited a project. In a nutshell, it checks, if certain dates have changed and if yes, update the events accordingly.

So I thought if I add the new script to the end of the script "OK Project Edit", it will be fine, but the OK Project Edit calls another script OnTimer: Go To Object, which is executing after my last script and hence it doesn't work.

I need the project edit action to be fully completed before my script can run.

How do I go about it, that it runs at the end?

Thanks

Kind regards

Regine
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Mon Jan 14, 2019 10:15 am
Hi Regine,

You're right, this can be a bit tricky with the OnTimer scripts. What needs to happen is that you'll need to have your script finish updating the related events before the "Install OnTimer Script" step is performed. That way, everything you need to do is completed before there is a timer set to run the "Go To Object" script taking you to the updated panel in the Projects layout.

I'll dive into the scripts today and get back to you with a bit more detail on where might be a good place.

Regards,

KC
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Mon Jan 14, 2019 12:17 pm
Hi Regine,

I took a look at the "OK Project Edit script" and it looks like you'll just want to perform your custom script right before the last section commented "# Navigate To View Panel". This is where the "Call Go To Object [ ObjectName ]" script is performed, which in turn installs the OnTimer script.

As long as you do your custom work right before this section, it should finish before navigating back to the View (non-edit) panel in the layout.

Hope that helps!

KC
Posts: 129
Joined: Tue Jul 15, 2008 12:41 am
Location: Perth Western Australia
PostPosted: Tue Jan 15, 2019 1:14 am
Hi KC,

Thanks for the info. I had it right at the end and somehow it didn't work.
But it works fine with having it just before that last script step.

However I got a follow up question:
Some dates in the Project are linked. How do I trigger the update of the linked dates, if one of the linked dates is updated through my script?

Thanking you in advance.

Kind regards

Regine
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Tue Jan 15, 2019 11:12 am
Hi Regine,

Glad that worked for you. I'll verify which scripts are involved when updating linked events in a project and get back to you with the details.

Regards,

KC
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Tue Jan 15, 2019 10:02 pm
Hi Regine,

In order to update linked events in your project, you'll need to run the "Update Linked Events..." script in the context of the event and passing in the parameters "sc_projectID", "sc_eventID", "sc_startDate", and "sc_delta" in the hash (#) format. You can see an example Perform Script step around line 21 in the "OK Project event Edit" script.

Let me know if that helps!

Regards,

KC
Posts: 129
Joined: Tue Jul 15, 2008 12:41 am
Location: Perth Western Australia
PostPosted: Thu Feb 21, 2019 12:25 am
Hi KC,

Thanks for the info.

I haven't been able to work it out with your info, but I have solved the problem in a different way. So I am good!

Thanks

Regine
SeedCode Staff
SeedCode Staff
Posts: 17
Joined: Tue Dec 04, 2018 10:21 am
PostPosted: Thu Feb 21, 2019 8:47 am
Hi Regine,

I'm glad to hear you found another way to solve the issue. Thank you for letting us know!

Best wishes,

Ana

Return to SeedCode Complete 13

Who is online

Users browsing this forum: No registered users and 4 guests

cron
(855) SEEDCODE
[email protected]
Follow us: