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, ...
Unanswered

Initialize Parameters in the SSRS Contract

(0) ShareShare
ReportReport
Posted on by 5

Hi All,

I have read the implementations for SysOperationInitializable (to initialize parameters), SysOperationValidatable (to validate parameters).

I want to set the FromDate and ToDate to certain values based on Today(). 

The SysOperationValidatable  works.

I am not able to get SysOperationInitializable to work. The code does not seem to execute the Initialize ( ) Method. What am I missing ?

The code is below. I know this has been discussed long time back, but I cannot get the code in Initialize ( ) to execute.

ClassDeclaration

[DataContractAttribute]
class BM_072_Contract implements SysOperationInitializable, SysOperationValidatable
{

BaseDate FromDate, ToDate;

}

Initialize ( )

public void initialize()
{
FromDate = systemDateGet() - 40;
ToDate = systemDateGet() - 10;
}

[DataMemberAttribute("From Date"),
SysOperationLabelAttribute("From Date"),
SysOperationDisplayOrderAttribute('1')]
public BaseDate ParmFromDate(FromDate _FromDate = FromDate)
{
FromDate = _FromDate;

return FromDate;
}

[DataMemberAttribute("To Date"),
SysOperationLabelAttribute("To Date"),
SysOperationDisplayOrderAttribute('2')]
public BaseDate ParmToDate(ToDate _ToDate = ToDate)
{
ToDate = _ToDate;
return ToDate;
}

public boolean validate()
{
//Validate the input parameters.
boolean isValid = true;

if (!FromDate)
{
isValid = checkFailed("From Date should be entered");
}
if (!ToDate)
{
isValid = checkFailed("To Date should be entered");
}
if (isValid && (FromDate > ToDate))
{
isValid = checkFailed(strfmt("From Date should be less than or equal to To Date",
date2StrUsr(fromDate, DateFlags::FormatAll), date2StrUsr(toDate, DateFlags::FormatAll)));
}
return isValid;

}

I have the same question (0)
  • Blue Wang Profile Picture
    Microsoft Employee on at

    HI Vikash,

    Add attribute SysOperationAlwaysInitializeAttribute.

    Reference: https://www.schweda.net/blog_ax.php?bid=445&wdl=en

    [DataContractAttribute,SysOperationAlwaysInitializeAttribute]
    class BM_072_Contract implements SysOperationInitializable, SysOperationValidatable
    {
    
    BaseDate FromDate, ToDate;
    
    }

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 681

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 202 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans