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 :
Microsoft Dynamics AX (Archived)

Want to show message after comparing to Fields.

(0) ShareShare
ReportReport
Posted on by 518

Hello all,

Want to compare the to fields as soon as the data is entered or updated in first field and show the info message after that. Where to write code to do so.

I have written code on data source < field< modified

public void modified()
{
    CustFeeDetails custFeeDetails;
    super();
    if(custFeeDetails.AdmitionFee<custFeeDetails.SportsFee)
    {
        info("Admition fee must be graeter than sports fee");
    }
}
Thank You
Siddhant

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    If you want to validate entered value you can write your code on validate method of the data source field for form specific functionality. If this logic should work for all form that use this field you can use validatefield method on the table.

  • Siddhant Singh Profile Picture
    518 on at

    Hello Miroshnikov,

    If this I have to do in the D365FO, What will be the line of code in that.

    I have written this in D365FO for same.

    [ExtensionOf(formStr(SalesTable))]

    final class SalesTable_Form_Extension

    {

       [PostHandlerFor(tableStr(SalesTable), formMethodStr(SalesTable, validate))]

       public void validate()

       {

           SalesTable salesTable;

           if(salesTable.ReceiptDateRequested>salesTable.ReceiptDateConfirmed)

           {

               info("The date of arrival of the packaging agreed with the customer is greater than the delivery date indicated in the order. Check the dates before proceeding");

           }

       }

    }

    Thank You,

    Siddhant

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    First of all you don't do pre\post event handler anymore, that's and old style. You use CoC instead, here is an example in docs how to override validate for a form data source field https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/method-wrapping-coc#form-data-fields

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans