Hi all,
What is the correct place to write the skipDatasourceValidateWrite method??
Actually I have a custom tab page, added to standard form(here SalesTable)
Where I am displaying data, which is actually not a particular record but I am displaying through a query by grouping records based on some fields and that table have some mandatory fields,
(These records actually shows the inventory information for the item in salesLine)
The table here is IntercompanyInventSum, where InventDimId(and few more fields), is mandatory, but I am grouping records from InventDim, based on site and warehouse, and creating Temp instance in this table, so InventDimId cannot have a particular value.
This tab page is only for viewing purpose, no write, edit or delete operations are to be performed, but when I click on save, It gives a warning - 'Field Dimension number' must be filled in'.......
Where Dimension number is nothing but InventDimId.
These validations are done in the ValidateWrite method, so I want to skip ValidateWrite call.
I tried calling skipDatasourceValidateWrite() from init of that dataSource, also AllowEdit, AllowCreate, AllowDelete......are set to 'NO'.
Any suggestions?
Thanks in advance,
Hardik
Yes, I noticed that. D365FO is split into two parts: D365 Finance, and D365 Supply Chain Management. Your question is clearly about the SCM part since you are dealing with sales orders.
No
I am working with D365
Finance and operations
Also, seems that you are not working with AX but Dynamics 365 Supply Chain Management so I will move this post to the corresponding forum.
You can't prevent the standard code from being executed.
Perhaps you need to design your extension in a different way so that you will not end up with trying to write something.
Thank you for the quick response Nikolaos
But here datasource is not a custom table, it is a standard table
So we cant remove super() right(however super will be called because of chain of command)
Any other way we can stop write method?
Clearly your form is trying to write something if you get this error. You need to prevent the writing, not skip validations.
Try removing super() call from write method of this data source (if you never use it for creating data).
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156