Hi,
Here is the requirement: I want to auto-submit the Purchase Requisition workflow through Power Automate based on a condition.
I attempted to create a new field in the PurchReqTable and added it to the PR form. After the creation of the PR and its line, I added the field I created (toggle: workflowautosubmit is yes) and added events like modified, enter, selection on changing. However, these events did not trigger during debugging.
Later, I tried to add the field in the PR Header entity, and through an extension, I attempted to add the ModifiedField method with the below code. However, it did not trigger even during debugging. Can you please correct my code and point out where I went wrong?
Thanks in advance for your reply.
code:
final class PurchReqDataEntity_Extension
{
{
PurchaseRequisitionHeaderEntity purchReqHeaderEntity;
PurchReqTable purchReqTable;
Select RecId from purchReqTable where purchReqTable.RequisitionNumber == purchReqHeaderEntity.RequistionNumber;
{
// activate and submit workflow
Workflow::activateFromWorkflowType(workflowTypeStr(PurchReqReview),purchReqTable.RecId,/@Test:ProcurementPRReviewMeassage/,NoYes::No);
purchReqTable.canSubmitToWorkflow(workflowTypeStr(PurchReqReview));
}
super(_fieldId);