Object with document field referencing latest versionAnswered
I have an Object with a Document Reference field where the Document Version Reference is set to "Latest Version".
I have to interrogate the selected document in a BEFORE INSERT trigger, but the value of the field is null:
I know getting/setting the unbound field is not supported.
How can I get the ID of the selected document in a BEFORE INSERT trigger? The reference type must be Latest Version.
Steve Lisowski, Stemline Vault Support Team
You cannot use recordChange.getNew().getValue() to retrieve that document ID in a BEFORE_INSERT event. You would either need to query the documents to retrieve that ID, or execute your logic in an AFTER_INSERT event.
Please sign in to leave a comment.