Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Extended Form datasour...
Finance forum
Answered

Extended Form datasource create new record even the setup not allow that

Posted on by 515

Hi...

I have added another data source to the WHSWorkTable form. The properties of this new data source are set as follows:

But if I change a value from WhsWorkTable a new record in SalesTable should be created... Can anyone tell me, why?

  • Suggested answer
    Christian Busche Profile Picture
    Christian Busche 515 on at
    RE: Extended Form datasource create new record even the setup not allow that

    Martin,

    you made my day... Thx...

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Extended Form datasource create new record even the setup not allow that

    Refer to the below thread which talks about the same issue and see if it helps your scenario.

    https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/472455/category-name-on-all-forms-with-category-id/1297363

    Thanks,

    Girish S.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 229,173 Most Valuable Professional on at
    RE: Extended Form datasource create new record even the setup not allow that

    Setting properties like "Allow Create" to No doesn't prevent the system from creating records in joined table.

    You need to use CoC on your new data source to implement this behavior. Don't call 'next' in either validateWrite() or write(). validateWrite() should always return true while write() will simply do nothing.

    It'll compile if implemented correctly, this is an exception of the rule that 'next' must be called.

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: Extended Form datasource create new record even the setup not allow that

    What is the join type you set on the newly added DataSource?

    If adding table as DataSource is the issue you can go with adding a view to the DataSource if it's for viewing purpose only.

    Thanks,

    Girish S.

  • Christian Busche Profile Picture
    Christian Busche 515 on at
    RE: Extended Form datasource create new record even the setup not allow that

    In a standard extension, the standard code must be run through with next(), even if it is a custom extension. The code does not compile...

  • Christian Busche Profile Picture
    Christian Busche 515 on at
    RE: Extended Form datasource create new record even the setup not allow that

    André,

    the error occurs because some values of mandatory fields in SalesTable are missing, like AccountNum etc. So I put a breakpoint in validateWrite() method of SalesTable table code...

    So there are no additional x++ code... But probably external code... but I think, that doesn't matter?

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,545 Super User 2024 Season 1 on at
    RE: Extended Form datasource create new record even the setup not allow that

    Hi, As Andre mentioned, please add breakpoint in SalesTable insert method and check call stack to investigate when and why record is getting created in this table.

  • Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,590 Super User 2024 Season 1 on at
    RE: Extended Form datasource create new record even the setup not allow that

    Can you comment the super call for create, write methods of this form datasource and check?

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,867 Super User 2024 Season 2 on at
    RE: Extended Form datasource create new record even the setup not allow that

    Hi Christian,

    Initially when looking at the properties, I would agree with you that this data source is read-only. Is there some additional X++ logic created? Have you used the Debugger to find a cause of record insertions?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,867 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,173 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans