17 Haziran 2014 Salı

AX 2012 Add validate method, groupping and labeling parameters with RDP class

Class Declaration:

[
    DataContractAttribute,
    SysOperationGroupAttribute("DateGroup", "Date Range", "1", FormArrangeMethod::Vertical),
    SysOperationGroupAttribute("Other", "Other Filters", "1", FormArrangeMethod::Vertical)
]
class myContract implements SysOperationValidatable

{
...
}

Parm method:

[DataMemberAttribute('StartDate'),
SysOperationGroupMemberAttribute("DateGroup"),
SysOperationDisplayOrderAttribute("1")]
public StartDate parmStartDate(StartDate _StartDate = startDate)
{
   startDate = _StartDate;
   return StartDate;
}


Validate method:

public boolean validate()
{
    boolean isValid = true;
    if ( !endDate || !StartDate)
        isValid = checkfailed("You have to enter first/last dates!..");

    return isValid;
}

Hiç yorum yok:

Yorum Gönder