G
Godfrey Sorita
Guest
You can do either of the following to pull data from audit trail: 1. Use selectQuery API. Paste the code below to your trigger to query the latest date the lookup field has been updated. rbv_api.selectValue("SELECT createdAt FROM $ACT_TRAIL WHERE objId = ? AND content LIKE ?", {!id}, 'Value of First Name field was changed%'); 2. Use Related Activity Trail tokens. Paste the code below to your trigger to print all audit trail content related to the current record: {!#LOOP_BEGIN.$ACT_TRAIL} rbv_api.println('{!$ACT_TRAIL.content}'); rbv_api.println('{!$ACT_TRAIL.createdAt}'); {!#LOOP_END.$ACT_TRAIL} **You will need to add if conditions to extract the latest date when lookup was attached. **This option is very inefficient.
Continue reading...
Continue reading...