
Trying to create a custom object change log:
- The tracking object must contain the following fields:
- Account
- Auto-generated sequential number
- Name of the field that changed (Account Name, Affilated Company, or Parent Account).
- The old value of the field.
- The new value of the field.
- The date/time the old value has been assigned.
- The date/time the new value has been replaced.
- We seed the tracking records for each account, and each of the three tracked fields:
- Account ID
- Name of the filed = AccountName or FamilyName or ParentName
- Old value = blank
- Date/time assigned 1900-01-01 00:00
- New value = existing AccountName or FamilyName or ParentName
- Date/time expired = 9999-01-01 00:00
- Note that initial record will have the fake assigned date, e.g., 1900-01-01 for initial records, and fake expiration for non-expired, eg 9999-01-01 00:00.
The first few fields already exsist it really is the last 2 fields that I am having problems with - creating the fake expiration date
Something like below
event_id account_id field previous_value new_value effective_timestamp 1 0013D00000ZbXodQAF TextName abc ABC 1900-01-01 00:00:00 2 0013D00000ZbXodQAF TextName ABC abc 2018-08-15 16:55:11 3 0013D00000ZbXodQAF TextName abc ABC 2018-08-21 14:55:45
Looking for any thoughts on how to achieve this.
Thanks
John
답변 1개
You can set the default vale of the field as DATETIMEVALUE("4000-01-01 00:00:00")
** You can not set is as 9999-01-01 00:00 because Salesforce can accept dates between Jan 1, 1700 and December 31, 4000. https://help.salesforce.com/articleView?id=000240801&type=1