Boolean resetting itself

MauddibMauddib Member Posts: 269
edited 2006-03-21 in Navision Attain
I have a temporary table in a report. Its a temporary table of Type Purchase Header. And I am populating it with data from a few places. At one point i have this code:

PHead."Document Type" := PHead."Document Type"::Order;
PHead."No." := "Purch. Rcpt. Header"."Order No.";
IF PHead.INSERT(FALSE) THEN BEGIN
PHead."Completely Received" := TRUE;
MESSAGE(FORMAT(PHead."Completely Received"));
PHead.MODIFY(FALSE);
MESSAGE(FORMAT(PHead."Completely Received"));
PHead.FIND;
MESSAGE(FORMAT(PHead."Completely Received"));
END;

The messages that I get are Yes. Yes. No.

Why, in between the modification and re-retreiving the record from my Temp table does this field reset itself to False?

GaMBe

Comments

  • DenSterDenSter Member Posts: 8,307
    I think your FIND command finds another record. Do PHead.GET(PHead."Document Type",PHead."No.") and try again, that code should work fine as far as I can see.
  • krikikriki Member, Moderator Posts: 9,112
    Check a few things:
    -There may be no filters on "PHead" for doing a FIND (or FIND('=') ). (But I don't think this is the problem)
    -If your field "Completely Received" is a flowfield, this is normal, because it is always recalculated.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • MauddibMauddib Member Posts: 269
    Sorry lads i wasnt with it yesterday at all. Not thinking straight. It is not a flowfield or anything, its normal. But there was a formula futher down the properties which I didnt notice.

    Funnily the formula thats there doesnt actually give the correct value, but thats another days work.
Sign In or Register to comment.