Pages

Banner 468 x 60px

 

Wednesday, November 22, 2017

If condition with menuitem in x++

0 comments
If condition with menuitem in x++ :



/// <summary>
/// Enables and disables controls on the form.
/// </summary>
/// <remarks>
/// This method is called from the enableButtonsActive method of the JournalFormTable class. The
/// JournalFormTable.enableButtonsActive method is called by the active method on the data source
/// of this form.
/// The form functionality is limited by the form context and the rights of the security model.
/// </remarks>
void enableButtonsActive()
{
    InventJournalType journalType = journalFormTable.journalTypeId();

    printMenu.enabled(inventJournalTable.RecId != 0);
    // <GEERU>
    if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]))
    {
        this.enableButtonsActive_RU();
    }
    // </GEERU>
    // <GEEPL>
    this.enableButtonsActive_PL();
    // </GEEPL>

    switch (journalType)
    {
        case InventJournalType::Asset:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostAsset));
            break;

        case InventJournalType::BOM:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostBOM));
            break;

        case InventJournalType::Count:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostCount));
            break;

        case InventJournalType::LossProfit:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostLossProfit));
            break;

        case InventJournalType::Movement:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostMovement));
            break;

        case InventJournalType::project:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostProject));
            break;

        case InventJournalType::TagCounting:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostCountTag));
            break;

        case InventJournalType::Transfer:
            postJournal.menuItemName(menuitemActionStr(InventJournalPostTransfer));
            break;
        // <GEEPL>
        case InventJournalType::PlExternalTransfer:
            postJournal.menuItemName(menuitemActionStr(PlInventExtJournalPost));
            checkJournal.menuItemName(menuitemActionStr(PlInventExtJournalCheck));
            break;
        // </GEEPL>
        default:
            postJournal.enabled(false);
    }
   
    // added by adit
    if(element.args().menuItemName() == menuitemDisplayStr(InventJournalTableMovement))
    {
        BITlines.visible(true);
        Lines.visible(false);       
    }   
    if(element.args().menuItemName() == menuitemDisplayStr(InventJournalTableAsset))
    {
        BITlines.visible(false);
        Lines.visible(true);
    }
    // ended by adit
}


0 comments:

A financial dimension value is based on the LAND-00013 record and has been used on a transaction. You cannot delete the LAND-00013 record AX 2012

 A financial dimension value is based on the LAND-00013 record and has been used on a  transaction. You cannot delete the LAND-00013 record ...