codeunit

how can i insert or update a reocrd in a table by using codeunit in navision? i am using the following code… Table.Init; Table.”S.No” := 1 Description := ‘Sample NAS’ Table.Insert; i am getting the error “Datatable 0 does not exist”… how to solve this problem…

… by using INSERT and MODIFY…

Define Table as varaiable, Type Rec, Sub-Type . Add your code to the Run traigger of the codeunit. Run the code unit form the Object Designer. Call the codeunit by C/AL in another object.

Remember put the semicomma (:wink: end of every statement. Table.Init; Table.“No.” := 1; Table.Description := ‘XXXXX’; Table.Insert;