Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Suggested answer

Skipping validate write method for data source.

Posted on by 55

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

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Skipping validate write method for data source.

    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.

  • Hardik__ Profile Picture
    Hardik__ 55 on at
    RE: Skipping validate write method for data source.

    No

    I am working with D365

    Finance and operations

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Skipping validate write method for data source.

    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.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Skipping validate write method for data source.

    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.

  • Hardik__ Profile Picture
    Hardik__ 55 on at
    RE: Skipping validate write method for data source.

    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?

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Skipping validate write method for data source.

    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).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans