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 :
Dynamics 365 Community / Forums / Finance forum / Override ValidateDelet...
Finance forum

Override ValidateDelete unsure what this code does ret = ret && this.type().ValidateDelete();

(0) ShareShare
ReportReport
Posted on by 157

Hello, looking for clarification on what this code does. Specifically this.type().ValidateDelete(). It is within the ValidateDelete override.

    public boolean validateDelete()
    {
        boolean ret;
        ret = super();
        if(ret)
        {
            ret = ret && this.type().ValidateDelete();
        }
        return ret;
    }

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    HI Kurt,

    This is a bit similar question as your other post. Can you share the exact object name? Then it can be explained in its context.

  • Verified answer
    Sukrut Parab Profile Picture
    71,735 Moderator on at

    This is most likely example of salestable or purchTable validate delete method  which  calls validate delete of salesTableType or  purchTableType class.

     boolean         ok = true;
            PurchTableType  purchTableType;
    
            ok = super();
    
            if (ok)
            {
                purchTableType = this.type();
                ok = purchTableType.validateDelete(_intercompanyForce);
            }
    
            return ok;


    So you can clearly see from above code , depending on the type of order it calls validateDelete method of instance of purchTableType class . 

  • Verified answer
    Kurt Warner Profile Picture
    157 on at

    Thank you, that makes since. Andre, it was from the D365 Operations Packt book Extending Microsoft Dynamics 365 for Operations Cookbook. The vehicle management systems that the book uses for demo, table ConWHSVehicleServiceTable. I thing they're just introduction the code concept as there is not different types of service, at lease that I see yet.

  • Kurt Warner Profile Picture
    157 on at

    BTW: In the demo there is a service type with class ConWHSVehicleServiceTableType so it works exactly as you say. Thanks 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

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 > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans