Remove an industries solution from a database?

I have to remove an industries solution from a database. Before I can import the standard objects I have to delete the data in the added fields. How would you do that? My first experients with RecordRefs aren’t bad! Is there a posibility to delete a field in a RecordRef? Thanks for your help! Merry Christmas Lars

Hi Lars, if you know the objectnumbers of industrie solution , you can delete the objects in the designer. if not try the foolowing workaraound : Original database : set all “last modified” to 1.1.1980 take a blank cronus-database import all objects your customer will need export after that all objects to a FOB-File import the FOB-File in your original database setfilter on “last modified” to 1.1.1980 delete the objects that appear

Did you mean to delete a field inside C/side? Or the value of a field??? IF you want to delete values of fields added over field id 50000, you can investigate trough tables with a codeunit using AllObjs, tableref, recordref and deleting values for the ID over 50000. It’s a little tricky, but possible. good luck.

Ciao Domenico, I didn’t understand exactly what you mean. I’m not a senior consultant so far! That’s my testcodeunit: IF Tabelle.FIND(’-’) THEN BEGIN //“Tabelle” is a Record on a table list REPEAT IF STRPOS(Tabelle.“Versions Liste”,‘XXX’) > 0 THEN //XXX is the name of the solution FOR i := YYYYY TO ZZZZZ DO BEGIN // YYYYY…ZZZZZ is the range of field-IDs IF Field.GET(Tabelle.ID,i) THEN BEGIN RecRef.OPEN(Field.TableNo); REPEAT FldRef := RecRef.FIELD(Field.“No.”); FldRef.VALUE(’’); MESSAGE(FORMAT(FldRef.VALUE)); //Until now I only can see it but I can’t delete it UNTIL RecRef.NEXT = 0; END; END; UNTIL Tabelle.NEXT=0; MESSAGE(‘Fertig’); END;

Hallo iammicky, I can’t delete table fields if they contain data. When I try to replace an object with additonal fields with a standard object the system tells me to delete the data first before deleting fields…

Sorry, table to modify : internal table 2000000001 Object In the german version : field ‘DATUM’ Do it in a codeunit VARIABLE OBJECTS RECORD 2000000001 object.modifyall(datum,01011980d) Shureley you have to look that the fields used by your industrie solution are empty before importing the FOB-file which you created in Cronus-database

If you do not know which fields to clear do the following Export all tables from original and cronus to txt-files and compare the fieldlists. If you use windiff or so it is an easy job to do. BTW : Why deleting the industrie solution ? I have one in my database, which i never will use nor which i can use, because i have no licence. But my database runs very well.

I want to delete the industry solution because it’s too much work getting all the SPs and HFs imported.

SP = Servicepack = Softwareupdate of database objects Why installing SP if only objects are corrected, which yuo are not using ? HF = Hitfix = Softwareupdate of executebles This is independent of you industrie solution and is ever to do

Try this: Tabelle.SETRANGE(Tipo,Tabelle.Tipo::Table); w.OPEN(‘Table #1#################’+ ‘Field #2#################’); IF Tabelle.FIND(’-’) THEN BEGIN //“Tabelle” is a Record on a table list REPEAT IF STRPOS(Tabelle.“Version List”,‘XXX’) > 0 THEN //XXX is the name of the solution //fieldstart is an integer //customization tables under id 50000 must field number starting from id 50000 //customization tables over id 50000 can have field id starting from id 1 if Tabelle.ID>50000 THEN fieldstart:=1 ELSE fieldstart:=50000; FOR i := fieldstart TO 100000 DO BEGIN // YYYYY…ZZZZZ is the range of field-IDs IF field.GET(Tabelle.ID,i) THEN BEGIN RecRef.OPEN(field.TableNo); IF RecRef.FIND(’-’) THEN REPEAT FldRef := RecRef.FIELD(i); FldRef.VALUE(’’); w.UPDATE(1,FORMAT(field.TableNo)+’ '+FORMAT(FldRef.NUMBER)); w.UPDATE(2,FORMAT(RecRef.NAME)); RecRef.MODIFY(FALSE); //MESSAGE(FORMAT(FldRef.VALUE)); //Until now I only can see it but I can’t delete it UNTIL RecRef.NEXT = 0; END; //? END; UNTIL Tabelle.NEXT=0; MESSAGE(‘Fertig’); END; w.CLOSE; VAriableS: FldRef FieldRef RecRef RecordRef field Record Field Tabelle Record Oggetto i Integer w Dialog fieldstart Integer You have to modify the record to set changes. This code deletes the values of all the fields in a customization (filtering for version). Then you can delete them. Furthermore you can try to put in the //? place this code: field.DELETE; i didn’t try, but maybe it works and delete the customization field from the table!!! Tell me.

Hi iammicky, if you for example use this version of an object: NAVW13.70,LG3.12,SOLUTION2.3 //SOLUTION is the industry solution. Now you get the SP-objectversion NAVW13.70,LG3.13. You have to search and copy all the LG3.13 changes into your NAVW13.70,LG3.12,SOLUTION2.3 object- and this maybe for 30 more objects. Don’t you know this problem?

Hey juelicher, at last, did it work? Let me know. Bye.

Hi juelicher, i know the problem especially with LG. we do it with CompareIT and a little bit stupid Delphi shell programming. so the last update of nearly 270 Objects was done in 3 hours.(LG = Lohn&Gehalt, Update vom LG2.12 → LG2.13)

Another option would be to create a copy of the table with only the fields you want to keep. Run a codeunit to copy the records from your existing table to the new table. Delete all records from the existing table. Dataport out the data from the new table. Delete the fields from the existing table and dataport in the data. Not elegant but simpler steps. Regards, Django

Hi Domenico, that’s what I did: Object.SETRANGE(Object.Typ,Object.Typ::Table); IF Object.FIND(’-’) THEN BEGIN REPEAT IF ((Object.ID < X) OR (Object.ID > Y)) THEN BEGIN IF STRPOS(Object.“Versions Liste”,‘XYZ’) > 0 THEN BEGIN FOR i := X TO Y DO BEGIN IF Field.GET(Object.ID,i) THEN BEGIN RecRef.OPEN(Field.TableNo); IF RecRef.FIND(’-’) THEN REPEAT FldRef := RecRef.FIELD(Field.“No.”); CASE Field.Type OF Field.Type::Boolean:FldRef.VALUE(FALSE); Field.Type::Option:FldRef.VALUE(0); Field.Type::Integer:FldRef.VALUE(0); Field.Type::Decimal:FldRef.VALUE(0); Field.Type::Text:FldRef.VALUE(’’); Field.Type::Code:FldRef.VALUE(’’); Field.Type::date:FldRef.VALUE(0D); Field.Type::Time:FldRef.VALUE(0T); END; RecRef.MODIFY(FALSE); UNTIL RecRef.NEXT = 0; END; END; END; END ELSE BEGIN RecRef.OPEN(Object.ID); IF RecRef.FIND(’-’) THEN BEGIN REPEAT RecRef.DELETE; UNTIL RecRef.NEXT = 0; END; END; RecRef.CLOSE; UNTIL Object.NEXT=0; MESSAGE(‘Fertig’); END; Name DataType Subtype Length RecRef RecordRef FldRef FieldRef Field Record Field Object Record Objekt i Integer All the best Lars

_

Hi iammicky, it isnt’t possible to change the table data in the object table (original error message in German:‘Sie können Tabellendaten nicht in der Objekttabelle verändern. Modifizieren sie stattdessen die Definition der Tabelle’). Is there another way to do that? Regards Lars

quote:


Originally posted by iammicky
Sorry, table to modify : internal table 2000000001 Object In the german version : field ‘DATUM’ Do it in a codeunit VARIABLE OBJECTS RECORD 2000000001 object.modifyall(datum,01011980d) Shureley you have to look that the fields used by your industrie solution are empty before importing the FOB-file which you created in Cronus-database


Hi Lars i can do it, perhaps an issue caused by licence ?? I use a solution developer licence

No it’s not a licence issue, I guess. I tried a solution developer licence also - without success.

I use the following codeunit to change the Object table : OBJECT Codeunit 50098 Objekte reset { OBJECT-PROPERTIES { Datum=04.09.03; Zeit=12:00:00; Versions Liste=hdn reset; } PROPERTIES { OnRun=BEGIN FestDatum1 := 010180D; FestDatum2 := 010190D; CASE STRMENU(STRSUBSTNO('Alle erreichbaren Objekte auf den %1 setzen,'+ 'Alle erreichbaren Objekte auf den %2 setzen,'+ 'Alle erreichbaren Objekte <> %3 auf %4 setzen',FestDatum1,FestDatum2,FestDatum1,FestDatum2)) OF 1: Step1; 2: Step2; 3: Step3; END; // case END; } CODE { VAR obj : Record 2000000001; ok : Boolean; info : Dialog; MaxCount : Integer; Counter : Integer; Lizenz : Record 2000000040; i : Integer; LizenzInfo : Record 2000000043; FestDatum1 : Date; FestDatum2 : Date; PROCEDURE OpenMessage@6(); BEGIN info.OPEN('Objekte reset auf Datum #6######\'+ 'Tabellen : @1@@@@@@@@@@@@@@@@@@@@@@@\'+ 'Formen : @2@@@@@@@@@@@@@@@@@@@@@@@\'+ 'Reports : @3@@@@@@@@@@@@@@@@@@@@@@@\'+ 'Dataports: @4@@@@@@@@@@@@@@@@@@@@@@@\'+ 'Codeunits: @5@@@@@@@@@@@@@@@@@@@@@@@\'); END; PROCEDURE CloseMessage@4(); BEGIN info.CLOSE; MESSAGE('Objekte Reset beendet !'); END; PROCEDURE Step1@1(); BEGIN OpenMessage; info.UPDATE(6,FestDatum1); obj.RESET; FOR i := 1 TO 5 DO BEGIN; obj.SETRANGE(Typ,i); MaxCount := obj.COUNT; Counter :=0; IF obj.FIND('-') THEN BEGIN;; REPEAT Counter := Counter + 1; CASE i OF 1:info.UPDATE(1,ROUND(Counter/MaxCount*10000,1)); 2:info.UPDATE(2,ROUND(Counter/MaxCount*10000,1)); 3:info.UPDATE(3,ROUND(Counter/MaxCount*10000,1)); 4:info.UPDATE(4,ROUND(Counter/MaxCount*10000,1)); 5:info.UPDATE(5,ROUND(Counter/MaxCount*10000,1)); END;//case obj.Datum:= FestDatum1; obj.Zeit := 120000T; obj.Ge„ndert := FALSE; LizenzInfo.GET(obj.Typ,obj.ID); IF LizenzInfo."Modify Permission" <> LizenzInfo."Modify Permission"::" " THEN ok := obj.MODIFY; UNTIL obj.NEXT = 0; END; END; CloseMessage; END; PROCEDURE Step2@2(); BEGIN OpenMessage; info.UPDATE(6,FestDatum2); obj.RESET; FOR i := 1 TO 5 DO BEGIN; obj.SETRANGE(Typ,i); MaxCount := obj.COUNT; Counter :=0; IF obj.FIND('-') THEN BEGIN; REPEAT Counter := Counter + 1; CASE i OF 1:info.UPDATE(1,ROUND(Counter/MaxCount*10000,1)); 2:info.UPDATE(2,ROUND(Counter/MaxCount*10000,1)); 3:info.UPDATE(3,ROUND(Counter/MaxCount*10000,1)); 4:info.UPDATE(4,ROUND(Counter/MaxCount*10000,1)); 5:info.UPDATE(5,ROUND(Counter/MaxCount*10000,1)); END;//case obj.Datum:= FestDatum2; obj.Zeit := 120000T; obj.Ge„ndert := FALSE; LizenzInfo.GET(obj.Typ,obj.ID); IF LizenzInfo."Modify Permission" <> LizenzInfo."Modify Permission"::" " THEN ok := obj.MODIFY; UNTIL obj.NEXT = 0; END; END; CloseMessage; END; PROCEDURE Step3@3(); BEGIN OpenMessage; info.UPDATE(6,FestDatum2); obj.RESET; obj.SETFILTER(Datum,'<>%1',FestDatum1); FOR i := 1 TO 5 DO BEGIN; obj.SETRANGE(Typ,i); MaxCount := obj.COUNT; Counter :=0; IF obj.FIND('-') THEN BEGIN; REPEAT Counter := Counter + 1; CASE i OF 1:info.UPDATE(1,ROUND(Counter/MaxCount*10000,1)); 2:info.UPDATE(2,ROUND(Counter/MaxCount*10000,1)); 3:info.UPDATE(3,ROUND(Counter/MaxCount*10000,1)); 4:info.UPDATE(4,ROUND(Counter/MaxCount*10000,1)); 5:info.UPDATE(5,ROUND(Counter/MaxCount*10000,1)); END;//case obj.Datum:= FestDatum2; obj.Zeit := 120000T; obj.Ge„ndert := FALSE; LizenzInfo.GET(obj.Typ,obj.ID); IF LizenzInfo."Modify Permission" <> LizenzInfo."Modify Permission"::" " THEN ok := obj.MODIFY; UNTIL obj.NEXT = 0; END; END; CloseMessage; END; BEGIN END. } }