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

Announcements

News and Announcements icon
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
    240,020 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,172 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 410 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 390

#3
Martin Dráb Profile Picture

Martin Dráb 262 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans