How to count number of times field changes in project and project task?

Jared Wason
Tera Guru

Hi,

I am trying to track the number of times the planned end date changes. I have created a field called u_planned_end_date_changes (integer) on the Project form, and a business rule (on Project) that increase the count each time planned_end_date changes. This part works, however I want the count to increase when the planned_end_date is changed via a project task as well since the project tasks dictate the projects actual end date. I tried creating a business rule (on Project Task) that essentially does "++current.parent.u_planned_end_date_changes;". That is not working though. Can anyone tell me or point me in the direction of how I should be increasing this count on project when the planned end date changes from a project task?

Thank you

1 ACCEPTED SOLUTION

It should be current.field_name++;

If you're running "AFTER" business rules you need to do current.update();

You also can't update a field on a parent record without doing a query. If you change a field like: current.parent.field = value, it won't update without doing a Gliderecord query.

View solution in original post

7 REPLIES 7

You need to GlideRecord into the project table and update it. Assigning value to current wont update the parent


Please mark this response as correct or helpful if it assisted you with your question.

SanjivMeher
Kilo Patron
Kilo Patron

You dont need another business rule for this. The same business rule should take care of this. Because updating the project record via project task would also trigger the business rule to run.


Please mark this response as correct or helpful if it assisted you with your question.

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,

Can you tell me type of BR? And show me the script?

Thanks,
Ashutosh