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)

Using .value() to set FormIntEdit value at launch

(0) ShareShare
ReportReport
Posted on by 282

Hi all

I have a business requirement on a form, which has led me to creating a custom field on ProdTable. (For example's sake - we will call ProdTable.TestField.) TestField is of type OprNum.

The business requirement is that when the user opens form ProdParmReportFinished to mark the order as finished - the FormIntEdit "Operations_ToOprNum" in General tab will default to the value of ProdTable.TestField.

The problem is I can't seem to get it to even default to a static value (eg. 1). Set AutoDeclaration to Yes and tried editing int() method on both the form and the data source but it wouldn't do it. I know my code SHOULD work because I created a blank FormIntEdit and did the same to it and it worked first time.

I thought maybe it was filling in the default value over my value after my code ran, so I tried it on executeQuery() (set to value 1) just to test the theory but even that didn't work.

Any help would be much appreciated!

Thanks in advance

Luke

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at
    RE: Using .value() to set FormIntEdit value at launch

    Hi lukbel,

    Operations_ToOprNum is a bound control and it is bound to ToOprNum field of ProdParmReportFinished table and shows whatever is in this record. Instead of mucking around with control, you need to default ProdParmReportFinished.ToOprNum  with your new value. Use cross references to find where it is populated and put your code there.

  • lukbel Profile Picture
    282 on at
    RE: Using .value() to set FormIntEdit value at launch

    Hi ievgen

    This is what I would have normally done but I got the impression ProdParmReportFinished record in the table didn't exist until the person runs "report as finished" after opening this form. I'll look into this further

    Cheers

    Luke

  • Suggested answer
    Mea_ Profile Picture
    60,284 on at
    RE: Using .value() to set FormIntEdit value at launch

    Yes, you run it, AX initialize from ProdTable in ProdParmReportFinished .initFromProdTable() method and shows on the form, so you can put your code there. But if you follow my advice and look at cross references you can notice that it may be overwritten in insert method of ProdMultiReportFinished class from ProdRoute.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans