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 to populate a Field Value based on another Field without using data source in Form

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

I am looking for a solution on Age Calculation. Lets assume I have a Drop Dialog Box in which i am not attaching any datasource to the form. I manually added some fields in the design level (EmpId, EmpName, DOB, Age, etc., ). Now I want to write a logic for Age calculation based on Date of Birth. 

Here my problem occurs, I am overriding the modified method in Field Level(DOB) but i am unable to access remaining fields like age to assign in that method.

Why it is like that? Do anyone have solution for this?

Here is the screenshot of the design and form

https://www.screencast.com/t/rAleYgxWxD

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You have to set AutoDeclaration = Yes on the field control, then you can refer it by name to access the value of the control, like DateEdit.dateValue(). You may also refer current object with the this keyword, like in modified method of DateEdit, you could use this.dateValue().

    https://msdn.microsoft.com/en-us/library/formdatecontrol.datevalue.aspx

    I would recommend to take some development courses, or there are excellent books available in both print and electronic format.

  • Community Member Profile Picture
    on at

    Hi Vilmos,

                 Thanks for your reply. Actually I already set the AutoDeclaration to yes. But i want to access another field (Age) for which i already mentioned above property to yes but i am unable to access Age field.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    It works the same way, but a different method is returning the value you need, as Age.value().

    msdn.microsoft.com/.../formintcontrol.value.aspx

  • Community Member Profile Picture
    on at

    Its working but i am wondering that, the fields are not coming in the intellisense. Can you provide me the explanation behind the populating the fields in intellisense.

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    IntelliSense in AX is a black box, sitting in the kernel, so you will not be able to get explanation on this. You could try to list variables, methods, definitions with Control+Space (in code and method parameters list) and Control+Shift+Space (in this case if you are in front of a brace character for a function), but IntelliSense sometimes does not pick up such controls, variables every time.

  • Community Member Profile Picture
    on at

    oh, Thanks for the info Vilmos.

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