am working within a Canvas App that is embedded on a Model Driven Form. I want to create new Work Order Products in a Work Order Form within an embedded Canvas App.
My Data Source for my embedded App is [@'Work Orders'] and I have a Gallery that is a collection of items to become new Work Order Products
ClearCollect(colProductsSelected,Filter(colAssetsSelected,!IsBlank(colAssetsSelected.msdyn_product.Name)))
The syntax for the On Select on a Button is the bellow
ForAll(
colAssetsSelected,
Patch('Work Order Products',Defaults('Work Order Products'),
{'Work Order':ModelDrivenFormIntegration.Item},
{Taxable:false},{Product:msdyn_product},
{Unit:msdyn_product.defaultuomid},
{Currency:msdyn_product.transactioncurrencyid},
{'Price List':msdyn_product.pricelevelid}));
Navigate(ScreenAuxiliary,ScreenTransition.Fade)
If I use the same (almost) code on a canvas app which is on the for as a Iframe, works like a charm. The drawback there is that it does not carry the Work Order Number so I have to look up and enter it again although I am in a form on that Work Order.
BUT the above code does not work - no errors, but it asks me for Unit Cost, then for Total Amount and much more. When I attempted to create Work Order Products with Flow, I encountered the same numerous required fields which should not be required in order to save a Work Order Product...
Please help....