Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Single form has some data source methods not extending properly

(2) ShareShare
ReportReport
Posted on by 4
Hello together!
 
There is a standard form LogisticsPostalAddress (Directory model) having LogisticsPostalAddress.Extension (App Suite model). This extension adds TaxRegistration table into it, this table has no insert/update/delete on table level. Also all extension logic is built using event handlers, mostly in LogisticsPostalAddressFormEventHandler class.
What I found: 
1. write and delete methods for the form data source extension are not called at all, but validateWrite and validateDelete are called properly.
2. Table extension methods are called properly, but for insert, update and delete this.isFormDataSource() returns false when data processing is done via UI. But validateWrite and validateDelete methods return true as they should.  
2nd point is result of 1st one I suppose. But I see no reason of such behaviour. Does anyone have any idea where can problem be originated from?
Only delete-related methods are presented below in the code for simplification.
I performed full build on directory and appSuite models having "include referenced models" checkbox set to yes.
Also it was reproduced on another devbox which is used for another project.
[ExtensionOf(formDataSourceStr(LogisticsPostalAddress, TaxRegistration))]
final class LogisticsPostalAddress_TaxRegistration_Fds_Extension
{
    public void delete() // not called
    {
        Info("fds delete extension"); 
        next delete();
    }

    public boolean validateDelete() // called
    {
        Info("fds validateDelete extension");
        return next validateDelete();
    }
}
[ExtensionOf(tableStr(TaxRegistration))]
final class TaxRegistration_Dbt_Extension
{
    void delete()
    {
        if (this.isFormDataSource())
            info("table delete is FDS");
        else
            info("table delete is not FDS"); // goes this way
	next delete();
    }

    public boolean validateDelete()
    {
        if (this.isFormDataSource())
            info("table validateDelete is FDS"); // properly shown
        else
            info("table validateDelete is not FDS");
        return next validateDelete();
    }
}
thank you for any helpful ideas!
 
BR, Aleksei
Categories:
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    16,392 Super User 2025 Season 1 on at
    Single form has some data source methods not extending properly
  • Raj Borad Profile Picture
    1,138 on at
    Single form has some data source methods not extending properly
     
    I think that this issue arises because the `TaxRegistration` data source in `LogisticsPostalAddress` is likely marked as Insert/Update/Delete = No in the form data source properties, or it’s read-only due to join or mode configuration. 

    This prevents the form data source’s `delete()` method from being triggered, even though `validateDelete()` is still called during validation checks. Since table's `delete()` method is called outside of the form data source context, `this.isFormDataSource()` returns false. 
     
    To confirm, check the `TaxRegistration` data source properties in the form, and also ensure deletes are not handled solely through event handlers bypassing standard form methods. Consider logging the call stack to trace execution origin.
  • André Arnaud de Calavon Profile Picture
    294,939 Super User 2025 Season 1 on at
    Single form has some data source methods not extending properly
    Hi Aleksei,
     
    A possible explanation is that records are not physically deleted. The table is part of a date effectiveness framework where records are managed as being current using the fields ValidFrom and ValidTo.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 510 Most Valuable Professional

#2
Saalim Ansari Profile Picture

Saalim Ansari 315

#3
Adis Profile Picture

Adis 312 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans