Enter the key words to find the related topics

Post Button enabling and disabling for Journals.

Payment Journal
First Form




Journal Vocher
Second Form




For First form follow below steps:

Steps:

1. Navigate to  Classes\LedgerJournalFormTable\enableButtonActive and write below code.

UserGroupInfo        userGroupInfo;
UserGroupList        userGroupList;
boolean                   postButtonEnable;

select name from userGroupInfo
      where userGroupInfo.name =='Post Group'
                join groupId,RecId,UserId from userGroupList
      where userGroupList.groupId == userGroupInfo.name
               && userGroupList.userId == curUserId();
if (userGroupList.RecId)
{
     postButtonEnable = true;
}
else
{
    postButtonEnable = false;
}
2. Now Add postButtonEnable in IF ELSE Condition which is shown in BOLD  FONTS and Highlighted with yellow background color.

if (ctrlPostJournalMenu)
{
     if (!this.journalTable_DS().anyMarked())
    {
      if (ledgerJournalTable.isInWFApprovalProcess())
     {
         // The journal is in workflow approvals.
         ctrlPostJournalMenu.enabled(enabled && !ledgerJournalTable.Posted &&       ledgerJournalTable.isWFApprovalApproved());
     }
     else
    {
       // The is not in workflow approvals.
         ctrlPostJournalMenu.enabled(enabled && !ledgerJournalTable.Posted && ledgerJournalTable.approved() && postButtonEnable);
    }
 }


For Second form follow below steps:

Steps:

1. Navigate to  Classes\LedgerJournalFormTrans\setPostMenuButtonEnabled and write below code.

UserGroupInfo        userGroupInfo;
UserGroupList        userGroupList;
boolean                   postButtonEnable;

select name from userGroupInfo
      where userGroupInfo.name =='Post Group'
                join groupId,RecId,UserId from userGroupList
      where userGroupList.groupId == userGroupInfo.name
               && userGroupList.userId == curUserId();
if (userGroupList.RecId)
{
     postButtonEnable = true;
}
else
{
    postButtonEnable = false;
}
2. Now Add postButtonEnable in IF ELSE Condition which is shown in BOLD  FONTS and Highlighted with yellow background color.  

if (ctrlPostJournalMenu)
{
    enabled = this.isJournalEnabled();
    if (ledgerJournalTable.isInWFApprovalProcess())
    {
       enabled = enabled && ledgerJournalTable.isWFApprovalApproved();
    }
   else
   {
       enabled = enabled && ledgerJournalEngine.approved() &&   postButtonEnable ;
   }
ctrlPostJournalMenu.enabled(enabled);
}



















No comments:

Post a Comment