Alfasith AX

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

Friday, May 16, 2014

Job to check the table before insert in to that concern table for the existence in Dynamic AX

Hi,

static void AlfasithCode2CheckB4Insert(Args _args)
{
container contain;
    str 30 Name;

    int i;
    ContanerTable   ContanerTableLoc;
    contain = ["Ram","Sam","Mam","Kamal","Ram","Raja","Rani","Kamal"];
    for(i = 1; i <= conLen(contain) ;i++)
    {
        name = conPeek(contain,i);
    select ContanerTableLoc where ContanerTableLoc.Names == name;
            if(!ContanerTableLoc)
            {
                ContanerTableLoc.Names = Name;
                ContanerTableLoc.insert();
            }
    }
    info("Process completed...");
}

Regards,

No comments:

Post a Comment

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) ...