How to empty BLOB and Binary with FieldRef

mgmmgm Member Posts: 126
Is it possible to empty a BLOB field with FieldRef?

An example for Text or Integer is:

Field.Type::Integer:FieldRef.VALUE := 0;
Field.Type::Text:FieldRef.VALUE := '';

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    mgm wrote:
    Is it possible to empty a BLOB field with FieldRef?
    Yes, but indirectly. Import some picture to the first item in Item table, then try this:
    rref.open(27);
    rref.findfirst; //find first item - this is for demonstration purpose only
    
    //prepare empty BLOB field
    clear(tempitem);  //tempitem is Record 27 declared as temporary
    tempitem.insert;
    rref2.gettable(tempitem);
    fref2 := rref2.field(92); // field 92 = Picture, BLOB field in Item table
    fref2.calcfield;
    
    fref := rref.field(92);
    fref.value := fref2.value;
    rref.modify;
    
    Hope this helps.

    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • mgmmgm Member Posts: 126
    \:D/ Thanx Slawek!

    Just didn't manage to use this for fieldtype TableFilter and Binary.
    But these fieldtypes are rarely used.
Sign In or Register to comment.