AnsweredAssumed Answered

Updating Related Records

Question asked by mvreade on Oct 11, 2014
Latest reply on Oct 11, 2014 by mvreade

Whenever a record is modified, created or deleted, I need figure out which of the records has the most recent date. That one gets tagged as "Current" and the others get tagged as "History".


I have a One_cn calculated number = 1, and a G_One_cn global number that = 1 too. These two fields form a relationship sorted by Date in descending order. And it's through that relation that I run the script. It first replaces all records with "History", then updates the related record to "Current".


This works fine on modifying existing records and deleting records, but doesn't work on commit when I'm creating a new record. I'm thinking that perhpas the new record hasn't been indexed yet to be part of a relationship.


Is that correct? If so, anyway around it? I tried to add the commit record script, but then I was getting into an infinite loop (as this runs on commit in the layout).



Michael Reade