web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

When closing a form, the CanClose() is not run through

(0) ShareShare
ReportReport
Posted on by 622
Hi all...
I create an extension code on form MarkupTrans like:
 
/// <summary>
/// Code extension for table MarkupTrans.
/// </summary>
[ExtensionOf(formStr(MarkupTrans))]
public final class myMarkupTransFrm_Extension
{
    /// <summary>
    /// additional logic on canClose methode
    /// </summary>
    /// <returns>true if form can be closed otherwise false</returns>
    public boolean canClose()
    {
        boolean ret = next canClose();
 
        if (ret && this.args() && this.args().caller() && this.args().callerName() == identifierStr('myWhsLoadTableCheckMarkupCaptured'))
        {
            ret = this.myCheck();
        }
        return ret;
    }
}
 
But when I close the form this extension is not run through although the standard method FormRun.CanClose() is passed... I can see that by set a breakpoint on both methods...
  • Verified answer
    GirishS Profile Picture
    27,845 Moderator on at
    Hi Christian,
     
    Have you consider adding this validation in validateWrite method of the DataSource or table?
     
    Thanks,
    Girish S.
  • Verified answer
    Christian Busche Profile Picture
    622 on at
    GirihS,
    thanks for the hint...
     
    I made this adjustment a long time ago... During a test in the debugger I noticed several times that this method is (apparently) not (anymore) run.
    Thereupon I compiled the model again and then also this method was run again... I have no idea why only one compile has activated the method again... So everything seems to be ok again...

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 271 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans