Hello. I am brand new to this platform and struggling with a few things so please bare with me on what may be obviously simple.
Scenario: I have a MF that retrieves a list (emails from Exchange) into a non-persistable entity. I originally wanted to then write conditionally these objects to a persistable table (condition is does not already exist via unique ID and has a matching value on a single attribute to another entity). Anything with Commit or Create (in a loop) in the MF I could not figure out how to infer to write to the persistable table as it is not part of the MF. Instead I changed the non-persistable entity to a persistable entity. Figured an association to the table with a potential matching value would handle one of the above requirements and adding a validation rule on an attribute for unique would handle the duplication issue (only want it to keep newly fetched emails, not ones that have already been stored) . What occurs is the validation error is triggered and the entire commit is aborted.
Having a function that allows the keeping of uniquely retrieved objects I would think would be basic but for the life of me, cannot figure it out and thinking perhaps I am going about this entirely wrong.