mibuso.com

Microsoft Business Solutions online community
It is currently Thu Sep 18, 2014 5:40 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Solved] Delete data for a selected field IDs
PostPosted: Fri Aug 10, 2012 5:04 am 
Offline

Joined: Mon Jul 12, 2010 2:47 pm
Posts: 352
Location: Noida
Country: India (in)
Hi all,

Good morning.

Please don't ask why i require it but its urgent.

I want to delete all data in all tables for Fields between 50000..99999, i.e i want to delete data from all customize fields in all tables.

How it can be achieved.

_________________
Thanks & Regards,
Saurav Dhyani

http://saurav-nav.blogspot.in


Top
 Profile E-mail  
 
 Post subject: Re: Delete data for a selected field IDs
PostPosted: Fri Aug 10, 2012 9:18 am 
Offline

Joined: Sat Oct 08, 2005 11:22 am
Posts: 503
Location: TURKEY
Country: Turkey (tr)
I've cut this from one of my project so there may be some missing parts. Please check it (pk, validation etc.) before using. Hope this helps.
Code: Select all
OBJECT Codeunit 82000 ModifyFieldValuesInRange
{
  OBJECT-PROPERTIES
  {
    Date=10.08.12;
    Time=10:14:59;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
    OnRun=BEGIN
            DeleteValuesInRange(50000,99999,2,100,FALSE);
          END;

  }
  CODE
  {

    PROCEDURE DeleteValuesInRange@1103301000(TableStartNumber@1103301003 : Integer;TableEndNumber@1103301004 : Integer;FieldStartNumber@1103301006 : Integer;FieldEndNumber@1103301005 : Integer;UseValidation@1103301007 : Boolean);
    VAR
      Field@1103301000 : Record 2000000041;
      FldRef@1103301001 : FieldRef;
      RecRef@1103301002 : RecordRef;
      MigrationMgt@1103301009 : Codeunit 8611;
    BEGIN
      Field.SETRANGE(TableNo,TableStartNumber,TableEndNumber);
      Field.SETRANGE("No.",FieldStartNumber,FieldEndNumber);
      IF Field.FINDSET THEN BEGIN
        REPEAT
          RecRef.OPEN(Field.TableNo);
          IF RecRef.FINDSET(TRUE,FALSE) THEN
            REPEAT
              FldRef := RecRef.FIELD(Field."No.");
              MigrationMgt.EvaluateValue(FldRef,'');
              RecRef.MODIFY;
            UNTIL RecRef.NEXT = 0;
          RecRef.CLOSE;
        UNTIL Field.NEXT = 0;

      END;
    END;

    BEGIN
    END.
  }
}


_________________
Ufuk Asci
Pargesoft


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: