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)

Put the value from a StringEdit to a variable for a parameters in a query

(0) ShareShare
ReportReport
Posted on by

Hi i am new in Dynamics Ax.

I try to extract the value from a StringEdit  to use in a Query with X++ in a click event.

I know how to do for example in VB but i cant find  the paralel method in X++.

for example:

i have  a form with a TextBox1

and take the text value in a variable A

then i declare a sql statement like select JournalId from InventJournal where JournalId == variable A

in VB be like:

variable A = Me.TextBox1.Text

i very gratefull if can oriented with an example or some resources to find the correct method.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Johnkrish Profile Picture
    781 on at

    Hi Uriis23 ,

    First of all you need to make your control property "AutoDeclaration == Yes" , Then in code you can access by 

    ControlName.valueStr()

  • Community Member Profile Picture
    on at

    John Krish, thanks so much for the example i tried the valuestr() befor, but doesnt work until i change the property. the code just a simple like an VB or Java.

    ,I leave the code if it serves someone else

    void clicked()

    {

       str var;

    ;

    var = JournalId.valuestr();

       info(var); //to validate the set value

    }

    Regards.

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