How delete fields in record

zaczac Member Posts: 29
edited 2009-02-12 in NAV Tips & Tricks
Hi,
I would like to delete values in fileds but not all record. I have one text field and one number filed. They are not keys. I've created report and write code in it and code looks like this:
IF (object.txtFiled <> '') OR (object.intField <> 0) THEN
   BEGIN
      object.txtFiled := '';
      object.intField := 0;
   END;

It works just fine but I would like to use delete or clear statement if is possible

Answers

  • DenSterDenSter Member Posts: 8,307
    There's a CLEAR command, but I would personally not use it for this purpose. DELETE is only for complete records, that doesn't work for clearing field values. What you are doing, setting those fields to their initial values, is perfect.

    Try the MODIFYALL command, so you don't have to loop through the records. See the C/SIDE reference guide for syntax details.
  • zaczac Member Posts: 29
    Thanks DenSter.
  • DenSterDenSter Member Posts: 8,307
    You're welcome, always glad to help :mrgreen:
Sign In or Register to comment.