Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, October 8, 2017

Checkbox in dialog in X++

static void DialogCheckBox(Args _args)
{
    Dialog      dialog                   = new Dialog("New dialog with checkBox");
    NoYesId     checkValue               = NoYes::No;
    str                         strMessage = "Confirmation will create Variation. \n Click OK to proceed.";
    str                         strTitle = "Confirmation of Project / Contract WBS";

    DialogField dialogFieldVariation     = dialog.addFieldValue(extendedTypeStr(NoYesId), checkValue, "Create variation");
    DialogField dialogFieldVariationType = dialog.addFieldValue(enumStr(ProjBudgetRevRequestorType), "","Variation type");
    DialogField dialogFieldVariationDiscription = dialog.addFieldValue(extendedTypeStr(Description), "" );
    dialog.caption("Confirmation of Project / Contract WBS");
    dialog.addText("Please check to create Variation. Click OK to proceed",0);
    if (dialog.run())
    {
        checkValue = dialogFieldVariation.value();
        if(checkValue)
            info("Hi");
        else
            info("Bye");
    }
}

Tuesday, September 26, 2017

An update conflict occurred due to another user process deleting the record or changing one or more fields in the record

Hi,


Record conflict errors.

You needs to block the records to your session these are the ways you can lock the table records.

1. ttsbegain and ttscommit will also plays this role.

2. OCCEnabled true the property in table level.

3. In X++

a. select statement.

 select pessimisticLock purchTable where purchTable.PurchId == "XXXXX";

b. recordset statement.

update_recordSet pessimisticLock purchLine setting
            RemainInventPhysical = 0,
            RemainPurchPhysical   = 0,
            PurchStatus           = PurchStatus::Canceled
            where purchLine.PurchId == purchTable.PurchId;


Thanks,
Alfasith

How to invoke and iterate List as Contract methods in AX 2012/ D365

Hi, Public void performContractIterate(ClassContainsListAsContract    _ListCarryClass) { List contractFieldList = new List(Types::Class); ...