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 :
Finance | Project Operations, Human Resources, ...
Answered

Get a value that some user set in a class dialog field (SysLastValue)

(0) ShareShare
ReportReport
Posted on by 15

Hello people, 

how can I get what user has set in a class dialog field? (the class extends runbasebatch, the variable I am interested in is also in a CurrentVersion(1) macro) 

i believe it may look something like this: (but this just gives me a 1, i don't know, how to show the value of a dialog field)

static void getSysLastValue(Args _args)
{
container lastValues;
RunBaseBatchExtendedClass extClass = new RunBaseBatchExtendedClass();
;

lastValues = xSysLastValue::getValue(curext(), 'userId', UtilElementType::Class, classStr(RunBaseBatchExtendedClass));

extClass.unpack(lastValues);

info((strFmt('%1', conPeek(lastValues, 1))));
}

thanks

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    You unpack variables to extClass object, which is the right approach. But then you completely ignore this object and you're trying to part the container by yourself, which is wrong.

    Let's say you're interested in variable myData1 in RunBaseBatchExtendedClass. After you call extClass.unpack(lastValues), myData1 variable is set (in extClass object). All you need to do it extract it from there, usually by a parm method. Like this: extClass.parmMyData1(). If you the class doesn't have any suitable method, you'll have to add it.

  • edgcibu Profile Picture
    15 on at

    Thanks Martin,

    No, the class didn't have the parm method for the variable.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Then you need to add such method, as Martin mentioned.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans