Interview Questions

Wednesday, May 20, 2015

Validation to check document is attached to sales order if not picking list should be disabled

Hi,
Try and excecute the following steps to get the desired result,
Step 1:- Go to Docuref Table, create a new method called filestatus,
Public boolean filestatus(salesTable    _salesTable)
{
    boolean         fileattached = false;
    Docuref         DocurefTableloc;
    ;
    select DocurefTableloc where DocurefTableloc.RefCompanyId == _salesTable.dataAreaId
                              && DocurefTableloc.RefRecId     == _salesTable.RecId;
    if(DocurefTableloc)
    {
        fileattached = true;
        return  fileattached;
    }
    return  fileattached;
}
Step 2:-
NOw go to Classes --> Salestable form --> enableUpdateJournalButtons method
in declaration part -- > boolean             filestatus;
after declaration, paste this code,
filestatus      = docuref.filestatus(salesTable) // to check whether File is attached or not.
Below that u ll find the ------ > if (_buttonUpdatePickingList) this statement,
Just override the statement with this code,
if (_buttonUpdatePickingList)
    {
         if(filestatus == true)
         {
            _buttonUpdatePickingList.enabled(enablePickingListButton);
         }
         if(filestatus == false)
         {
            _buttonUpdatePickingList.enabled(false);
         }
    }
Cheers!!! Work done :-)

No comments:

Post a Comment