Options

Updating of Field

niimodinniimodin Member Posts: 142
Hello Experts,
I have a some field with are flowfield but when I look for the record to update other field it doesn't work.
The flowfield appear to be zero.
My code is below
Can someone tell me what I did wrong?
PayrollBuffer.CALCFIELDS(PayrollBuffer."Consolidated Allowances",PayrollBuffer."Bonus Taxable Surplus");


IF PayrollBuffer.GET(Year,Month,StaffID) THEN BEGIN
   PayrollBuffer."Gross Salary" := PayrollBuffer."Basic Salary"+PayrollBuffer."Consolidated Allowances"+
                                   PayrollBuffer."Overtime Taxable Surplus"+ PayrollBuffer."Night Taxable Surplus"+
                                   PayrollBuffer."Bonus Taxable Surplus";
   PayrollBuffer.MODIFY;
END;

Comments

  • Options
    DenSterDenSter Member Posts: 8,304
    Try this:
    IF PayrollBuffer.GET(Year,Month,StaffID) THEN BEGIN
       PayrollBuffer.CALCFIELDS(PayrollBuffer."Consolidated Allowances",PayrollBuffer."Bonus Taxable Surplus");
       PayrollBuffer."Gross Salary" := PayrollBuffer."Basic Salary"+PayrollBuffer."Consolidated Allowances"+
                                       PayrollBuffer."Overtime Taxable Surplus"+ PayrollBuffer."Night Taxable Surplus"+
                                       PayrollBuffer."Bonus Taxable Surplus";
       PayrollBuffer.MODIFY;
    END;
    
  • Options
    BeliasBelias Member Posts: 2,998
    You should move the calcfields instruction after the get
    ...whops, mibuso didn't notice me of an existing reply :?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    niimodinniimodin Member Posts: 142
    Thank you all
Sign In or Register to comment.