As the title suggests, there are sometimes requirements where we need to perform some operation(s) Just before target data insert operation triggers (or in between the whole DMF cycle) but not at the any datasource event or at the Entity insert method.
One of such requirement can where the Any Header data to be populated before line insertion.
Good news is we have a way to achieve it via postGetStagingData method at Entity level, Bad news is it works only after staging is inserted and works even if all target data fails validation.
Below is the implementation way for that
public class SaddafDemoEntity extends common { /// <summary> /// Post staging data /// </summary> /// <param name = "_dmfDefinitionGroupExecution">DMFDefinitionGroupExecution</param> public static void postGetStagingData(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution) { TestHeaderTable headerTable; SaddafDemoStaging staging; select firstonly staging where staging.DefinitionGroup == _dmfDefinitionGroupExecution.DefinitionGroup && staging.ExecutionId == _dmfDefinitionGroupExecution.ExecutionId; headerTable.DMFExecutionId = staging.ExecutionId; //Just the example, you can use any field needed headerTable.insert();
ttsbegin; staging = null; update_recordset staging setting ParentRefRecId = headerTable.RecId
where staging.DefinitionGroup == _dmfDefinitionGroupExecution.DefinitionGroup && staging.ExecutionId == _dmfDefinitionGroupExecution.ExecutionId; ttscommit; } }
No comments:
Post a Comment