Powered By Blogger
Showing posts with label Disable standard button. Show all posts
Showing posts with label Disable standard button. Show all posts

DisableStandredButton


 My requirement is to disable the delete button for journals that were posted:-

After Posting the button is enabled fig:-

Line level also the button enabled fig:-




Development:-
Formdatasource Extension:

[ExtensionOf(formDataSourceStr(InventJournalMovement,InventJournalTable))]

internal final class DAXInventJournalMovement_Extension

{

   public int active()

   {

       int ret;

       FormCommandButtonControl  delete, removeLine;

       FormRun                   formRun = this.formRun() as  FormRun;

       InventJournalTable        inventJournalTable= formRun.dataSource().cursor();

       #SysSystemDefinedButtons

       ret = next active();

 

       delete     = formRun.control(formRun.controlId(#SystemDefinedDeleteButton)) as FormCommandButtonControl;

       removeLine = formRun.design().controlName('RemoveLine');

       delete.enabled(inventJournalTable.Posted == NoYes::No);

       removeLine.enabled(inventJournalTable.Posted == NoYes::No);

       return ret;

   }

}

-----------------

output Header:-



output Line:-

DisableStandredButton

 My requirement is to disable the delete button for journals that were posted:- After Posting the button is enabled fig:- Line level also th...