Hi,
I wonder if anyone could help me with the following:
When I use SubmitForm I don´t get any error message about plug-in exception but when using Patch I do.
My context:
I have an embedded canvas app on Dynamics 365 form (Opportunity entity); all working above Dataverse.
The app consists of several Edit Forms with fields and a submit button.
The app settings has Formula-level Error Mangement = ON.
My scenario:
On data submit the app fills in fields in the Opprotunity entity, at the same time a plug-in launches and compares all relevant Opportunity form data (not only the app fields) against a reservation system (outside of Dynamics). If there is some discrepancy the plug-in returns an exception but my app "swallows" it when using SubmitForm function.
When I tried using Patch instead of SubmitForm I got the system message telling me about data discrepancy when communication with the reservation system (see the pic).
Unfortunately Patch functions are a bit tedious to write and it makes fileds validations more tedious...
So my question is:
What is the reason for this kind of behaviour?
Can I make SubmitForm works the same way as Patch?
Thanks a lot
Hancha
Solved! Go to Solution.
My question still stands but I´ve come up with a working workaround, combining Patch and Submit so I can use all the advantages of both 😉
I´m checking the Valid property of the form and If valid I go for Patch, if not I´ll run SubmitForm, which highlights all the incorrectly filled fields...
Something like this:
If(
MyForm.Valid
),
Patch(
Opportunities,
LookUp(
Opportunities,
OpportunityID = [@ModelDrivenFormIntegration].Item.OpportunityID),
{
'Column1Name': DataCardValueXY.Selected.Value,
'Column2Name': DataCardValueYZ.Text,
etc...
}
);
Navigate(SuccessScreen),
SubmitForm(MyForm)
);
My question still stands but I´ve come up with a working workaround, combining Patch and Submit so I can use all the advantages of both 😉
I´m checking the Valid property of the form and If valid I go for Patch, if not I´ll run SubmitForm, which highlights all the incorrectly filled fields...
Something like this:
If(
MyForm.Valid
),
Patch(
Opportunities,
LookUp(
Opportunities,
OpportunityID = [@ModelDrivenFormIntegration].Item.OpportunityID),
{
'Column1Name': DataCardValueXY.Selected.Value,
'Column2Name': DataCardValueYZ.Text,
etc...
}
);
Navigate(SuccessScreen),
SubmitForm(MyForm)
);
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
170 | |
94 | |
65 | |
64 | |
61 |
User | Count |
---|---|
226 | |
162 | |
93 | |
82 | |
81 |