Page 1 of 1
Add man Event Update Script to End of Project Edit Script
Posted:
Sun Jan 13, 2019 11:56 pm
by Regine
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Mon Jan 14, 2019 10:15 am
by kcembrey
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Mon Jan 14, 2019 12:17 pm
by kcembrey
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Tue Jan 15, 2019 1:14 am
by Regine
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Tue Jan 15, 2019 11:12 am
by kcembrey
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Tue Jan 15, 2019 10:02 pm
by kcembrey
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Thu Feb 21, 2019 12:25 am
by Regine
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
Re: Add man Event Update Script to End of Project Edit Scrip
Posted:
Thu Feb 21, 2019 8:47 am
by ana
Hi Regine,
I'm glad to hear you found another way to solve the issue. Thank you for letting us know!
Best wishes,
Ana