Alfasith AX

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

Tuesday, September 30, 2014

Container and unbounded string (text) fields are not allowed in a WHERE expression in AX

Hi,

Senario:

str ArgsValue = "00154AC";
while select PurchTable where PurchTable.FeildName == ArgsValue

Solution:

we need to find the EDT used by the particular field and instead of declaring same EDT and assign so the we can over come from that error.

Regards,

EcoResValue, EcoResAttribute with Item Id relation in AX

Hi,

static void AlfasithGetProductAttributes(Args _args)
{
    inventTable                 InventTable;
    EcoResProductAttributeValue ecoResProductAttributeValue;
    EcoResAttribute             ecoResAttribute;
    EcoResValue                 ecoResValue;
    EcoResTextValue             ecoResTextValue;

    InventTable = InventTable::find('1604');
    while select EcoResProductAttributeValue where EcoResProductAttributeValue.Product == InventTable.Product
    {
         select ecoResValue where ecoResValue.RecId == ecoResProductAttributeValue.Value;
         select ecoResTextValue where ecoResTextValue.RecId == ecoResProductAttributeValue.Value;
        info(strFmt("%1 - %2 - %3", InventTable.ItemId, ecoResAttribute.Name, ecoResValue.value()));
    }  
}

Regards,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...