Options

HASVALUE and CALCFIELDS order

matthiasclaesmatthiasclaes Member Posts: 18
NAV 5.0 sp1 on SQL, build 26084

Do you need to call BlobField.CALCFIELDS before BlobField.HASVALUE ?

The C/SIDE Reference Guide is not clear on this, and even suggest otherwise in the documentation of the TRANSFERFIELDS function:
BLOB Fields
If you are copying a record that contains a BLOB field, you must calculate the BLOB field before it can be copied with the rest of the record.

IF Mytable.BLOB.HASVALUE THEN
Mytable.CALCFIELDS(BLOB);

However, this forum post suggests otherwise:
Thanks very much. Putting CALCFIELDS before checking HASVALUE did the trick. Silly ommision on my part.

Thanks to kriki too for achieving that in another way.

Regards,
NVG
My own experiments with NAS programming indicate that HASVALUE requires a CALCFIELDS (at least when a bitmap is stored in them).

Can someone confirm this?

Comments

  • Options
    Big_DBig_D Member Posts: 203
    Hi Mattiasclaes

    Unfortunately in 5.01 Build 26084 you do need to use a Calcfield before a HASValue.

    2009 No need for Calcfield before a HASValue...

    Both give the same result....

    Item.FINDFIRST;
    REPEAT
    Item.CALCFIELDS (Picture);
    IF Item.Picture.HASVALUE THEN
    MESSAGE ('(%1)', Item."No.");
    UNTIL Item.NEXT = 0;

    //No need for Calcfield
    Item.FINDFIRST;
    REPEAT
    IF Item.Picture.HASVALUE THEN
    MESSAGE ('(%1)', Item."No.");
    UNTIL Item.NEXT = 0;


    Hope this helps
    Big D signing off!
Sign In or Register to comment.