The CreatorCon Call for Content is officially open! Get started here.

Value not getting updated on record update from business rule

clyon
Tera Guru

I have a business rule that is working fine with the exception of the update of the value of a field on another record (not current).

All the Info Message displayed are correct but the value doesn't show in the CI record. I verified that if I enter the displayed date directly in the field and it saves successfully.

I checked the XML of the ci record and those values are blank too.

Why is the value not showing up/saving in the record?   TIA

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Christina,



Two things... first, change this to an "after" rule. You want to update related records AFTER the current record is updated (in 99.99% of all cases.)



Second, change the date assignments from getDisplayValue() to getValue(). You want to assign the values directly. getDisplayValue() adds on the user's (or system's) timezone which is going to cause an offset error when it stores the new value. Key thing to remember - the system believes it is storing all date/time values in the database in UTC. It's only when you display it to a user that you would use getDisplayValue() to apply the timezone for human friendly values.


View solution in original post

2 REPLIES 2

Chuck Tomasi
Tera Patron

Hi Christina,



Two things... first, change this to an "after" rule. You want to update related records AFTER the current record is updated (in 99.99% of all cases.)



Second, change the date assignments from getDisplayValue() to getValue(). You want to assign the values directly. getDisplayValue() adds on the user's (or system's) timezone which is going to cause an offset error when it stores the new value. Key thing to remember - the system believes it is storing all date/time values in the database in UTC. It's only when you display it to a user that you would use getDisplayValue() to apply the timezone for human friendly values.


Thank you so much! Those 2 changes along with changes the table I was updating to 'cmdb_ci_computer' and the values showed up.