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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How (and When) to validate specific financial dimension values after record already created?

(0) ShareShare
ReportReport
Posted on by 506

I have a requirement to ensure validation of finanical dimension values for new Customers, Vendors, and Projects.

For Vendors (at least), I have customised DimensionDefaultingControllerBase.addEditControls to mark the mandatory dimensions with a red line.

if(formRun.name() == formStr(VendTable))
           && dimAttr.BackingEntityType == tableNum(DimensionFinancialTag)
           && dimAttr.Name == #IC3RD)
{
    valueStringControl.mandatory(true);
}


However, to handle the validation warnings on the form when attempting to save the record I'm using a post-event on the validateWrite() table method.

The Vendors form launches the Financial dimensions tab at the outset (before the record is created) so this is working fine with validateWrite().

However, for Customers and Projects, there are smaller forms that take basic details and save the record before launching CustTable and ProjTable forms. After this point I believe validateWrite() is not going be called.

I'm leaning towards using canClose() form events to force the user to select a value, but also would like the Edit button to activate the same logic when coming out of Edit mode (do I need to change CustTableInteraction class?).

Are there examples and/or recommendations in AX of both of these types of validation?

CustTable-form.PNG

*This post is locked for comments

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

    Hi _MGP,

    I think it's not a good idea trying to validate already created record. User should be able to close customer record without any changes because he could open it accidentally and simple does not know right values for financial dimensions. However, in case of any changes validateWrite would be triggered. But again user should be able to close a form without saving changes by pressing "Esc".

    As a solution,  you can modify  that "small" form to add financial dimension there with all required validation, so user won't be able to create new customer without entering them. You can find various blogs in the web explaining how to do this, for example, community.dynamics.com/.../how-add-financial-dimension-on-forms-inside-ax2012

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans