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 618
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...
I have the same question (0)
  • Verified answer
    GirishS Profile Picture
    27,833 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
    618 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 517 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 440

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans