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

Get a table ID in SQL - D365

Hi select ID from SysTableIdView where  SysTableIdView .Name = 'CustTable' Regards,