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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error Message on ValidateWrite Method

(0) ShareShare
ReportReport
Posted on by 618

Hi Guys,

I have created a validation in one of the form where it should show an error message if the validation fails. I created it, but I need to show one field set on my parameters (inventory Management Parameter) along with the error message. how this can be done ?

Checkfailed(" Test for Message") I need to show one field also which is set on the Parameter next to "Test for Message".

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    236,751 Most Valuable Professional on at
    RE: Error Message on ValidateWrite Method

    What's the problem? If you don't know how to compose a message from several parts, use strFmt() (e.g. strFmt("Message with partameter %1", parameterValue)). If you don't know how to access the field, please tell us more about it. If you have some other problem, please explain what it is.

  • Shyam Mani Profile Picture
    331 on at
    RE: Error Message on ValidateWrite Method

    Hi Alex,

    Please let me know how exactly you want the message to look like in real. You want to show like '<Field Name =No/yes or value> <Your message>', it should not be difficult.

    Regards,

    Shyam

  • D365  beginner Profile Picture
    618 on at
    RE: Error Message on ValidateWrite Method

    Hi Shyam,

    I just want to show Message + Default unitId set in Inventory Management parameter. the field name is    " InventParameters.DefaultUnitId" how the code should be ?

  • Verified answer
    Mea_ Profile Picture
    60,284 on at
    RE: Error Message on ValidateWrite Method

    Hi Alex Antony,


    Try this code

    checkFailed(strFmt("Error text %1", InventParameters::find().DefaultUnitId));


  • D365  beginner Profile Picture
    618 on at
    RE: Error Message on ValidateWrite Method

    Dear Ievgen,

    It works fine.! Thanks a lot.!

    Thanks to all for your support.

  • Martin Dráb Profile Picture
    236,751 Most Valuable Professional on at
    RE: Error Message on ValidateWrite Method

    For reference, this question is also discussed in parallel on another forum.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans