Hi Avinash,
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
I have tested the code and it is working fine for me… Revert back if you have any queries
Please try to find solutions by debugging the codes, you ll able to achiecve the solutions,
Without debugging AX customizations ll be difficult for you…