Tuesday, August 31, 2010

Renaming the Primary Key through code

static void RenamePrimaryKey(Args _args)


{

         LedgerTable ledgerTable;
         ;
         select firstonly ledgerTable
                  where ledgerTable.AccountNum == '01010';
         if(ledgerTable.RecId)
        {
                 ledgerTable.AccountNum = 'K' + ledgerTable.AccountNum;
                 ledgerTable.renamePrimaryKey();
        }
        info(ledgerTable.AccountNum);
}

No comments:

Post a Comment