Showing posts with label Few records updation. Show all posts
Showing posts with label Few records updation. Show all posts

Jan 25, 2012

How to update only few records?


Sample code in X++ to update the few records...

Static void main updateIds(Args  args)
{
EmplTable  empltable;
 
Ttsbegin;
while select forUpdate EmplTable Index hint EmplIdIdx
                              where EmplTable.EmplId == ‘10001’;
If(emplTable.recId != 0)
{
    emplTable.EmplId = ‘10101’(New EmplId);
    EmplTable.renamePrimaryKey();
    EmplTable.update()
}
Else
{
    Info(‘employee not found’);
}
ttsCommit;
}