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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

DataMemberAttribute in Contract class

(0) ShareShare
ReportReport
Posted on by

Hi all,

Usually when we create a Data Contract class when creating a SSRS report, we put something like this for the parameter :

[ DataMemberAttribute("Firstname"),

SysOperationLabelAttribute(literalStr("@SYS32695")),

SysOperationDisplayOrderAttribute('2')

]

public Name parmFirstname(Name _firstName = firstName)

{

firstName = _firstName;

return firstName;

}

My question, can we put a default value in the box ? so when I run this report, and UI some of the field already has default value.

Thanks

I have the same question (0)
  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,095 on at

    Hi WWwong,

    There are a couple of interfaces that can bring additional "features" to contract classes. One of them is SysOperationInitializable, which allows you to initialize variables with default values. You just need to indicate that your contract implements a certain interface with "implements" keyword and implement interface methods in your contract.

    www.anegis.com/.../initialisation-and-validation-of-data-contract-in-ax-2012

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    You can either implement SysOperationInitializable  or assign a value during variable declaration, here is an example https://erconsult.eu/blog/extending-sysoperation-contracts-with-datamemberattribute/

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Wwwong,

    First, I agree to use SysOperationInitializable.

    In addition, I would like to ask if you have a controller class?

    You can override method prePromptModifyContract in controller class, then add code to set your default value.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 663

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 337 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans