Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Thursday, September 19, 2013

Validate the contract class or SSRS parameter from code level before printing

Just add below code in contract class so that mandatory  fields like date fields can be validated by throwing the warning.

public boolean validate()
{
    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;
}

No comments:

Post a Comment

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...