This post is machine-translated. The original post in german language can be found here.

Mobile Device Portal: Simple field validation

For the first time, I had the requirement to implement a simple field validation in the Mobile Device Portal (MDP). After I have tried something with the WHSWorkExecute class, I have found the class method WHSRFControlData.processData() as well suited for such type of exams.

Such an examination could look as follows:

case #Qty:
    qty = WHSWorkExecuteDisplay::str2numDisplay(data);
    if (qty <= 0)
    {
        errorMessage = "@WAX1172";
        hasError = true;
        break;
    }

    //--> Start
    if (pass.exists(#ProdId) &&
        pass.lookupStr(#ProdId) != "" &&
        mode == WHSWorkExecuteMode::ReportAsFinished)
    {
        my_ProdTable = ProdTable::find(pass.lookup(#ProdId));

        if (qty + my_ProdTable.reportedFinishedGood() +
            my_ProdTable.reportedFinishedError() > my_ProdTable.QtyStUp)
        {               
            errorMessage = "@SYS16097";
            hasError = true;
            break;
        }
    }           
    //<-- End
These post applies to following version:
Dynamics AX 2012

Add comment
 
 

 

 
 
 
Posts of the actual month
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.