Hallo iammicky, The first test version is o.k. but the second one (REPEAT…UNTIL) doesn’t work. I don’t know why. Can you help me? //version 1: Object.SETRANGE(Object.Typ,Object.Typ::Table); Object.SETRANGE(Object.ID,5); IF Object.FIND(’-’) THEN Object.Datum := 010180D; Object.MODIFY; MESSAGE(‘Fertig’); //version 2: IF Object.FIND(’-’) THEN REPEAT Object.Datum := 010180D; Object.MODIFY; UNTIL Object.NEXT = 0; MESSAGE(‘Fertig’); Name DataType Subtype Length Object Record Objekt
Hi, 1.) What error text appears ? 2.) IF Object.FIND('-') THEN begin REPEAT object2 := object; Object2.Datum := 010180D; ok := Object2.MODIFY; UNTIL Object.NEXT = 0; end; MESSAGE('Fertig'); Name DataType Subtype Length Object Record Objekt Object2 Record Objekt ok Boolean
Hallo iammicky, It is always the same error message that 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’). It’s the same with your lates version. Lars
try with objects that you know you can make changes to. Else I have no idea.
Hi, Try Put this one before object.find(’-’) on the Object Object.SETFILTER(Type,’<>%1’,Object.Type::TableData);
Great ! If i had read my own text exact, i should have seen that :
quote:
obj.SETRANGE(Typ,i); // Here I do the same !!! MaxCount := obj.COUNT; Counter :=0; IF obj.FIND('-') THEN BEGIN;; REPEAT
Hi Aloi, that’s my codeunit at the moment: Object.SETFILTER(Object.Typ,’<>%1’,Object.Typ::TableData); IF Object.FIND(’-’) THEN REPEAT Object.Datum := 010180D; Object.MODIFY; UNTIL Object.NEXT = 0; MESSAGE(‘Fertig’); Name DataType Subtype Length Object Record Objekt There is a new error message which I do not understand. “Your’re not authorised to change form XY…” - but I can change the form. Lars
Hi, it’s working well for tables with that codeunit: Object.SETFILTER(Object.Typ,’=%1’,Object.Typ::Table); IF Object.FIND(’-’) THEN REPEAT Object.Datum := 010180D; Object.MODIFY; UNTIL Object.NEXT = 0; MESSAGE(‘Fertig’); But I do not understand the problem with forms yet. The problem is still there. Do you have an idea? Which are the Object.Typs? TableData, Table, Form…? I do not know the type “TableData”. What’s that exactly? Lars
Hi iammicky, I just found your: “LizenzInfo.GET(obj.Typ,obj.ID); IF LizenzInfo.“Modify Permission” <> LizenzInfo.“Modify Permission”::” " THEN ok := obj.MODIFY;" It looks very interesting too! I think that’s what I still need. Where do you get the LizenzInfo? Lars
LizenzInfo : Record 2000000043;
Hallo iammicky, thank you! Where do you know these table-IDs? I couldn’t find any documentation about them. Thats the latest codeunit: Object.SETFILTER(Object.Typ,'<>%1',Object.Typ::TableData); IF Object.FIND('-') THEN REPEAT IF LizenzPerm.GET(Object.ID,Object.ID) THEN BEGIN IF LizenzPerm."Modify Permission" <> LizenzPerm."Modify Permission"::" " THEN BEGIN Object.Datum := 010180D; Object.MODIFY; END; END; UNTIL Object.NEXT = 0; MESSAGE('Fertig'); Name DataType Subtype Length Object Record Objekt LizenzPerm Record License Permission
But it was only possible to change 1273 objects. Lars
Sorry Lars, but your code is easier to read if you use the reply to topic link and mark your code as code : Object.SETFILTER(Object.Typ,'<>%1',Object.Typ::TableData); IF Object.FIND('-') THEN begin REPEAT IF LizenzPerm.GET(Object.ID,Object.ID) THEN // ERROR !!! Object.TYP Object.ID // You use the wrong parameters BEGIN IF LizenzPerm."Modify Permission" <> LizenzPerm."Modify Permission"::" " THEN BEGIN Object.Datum := 010180D; Object.MODIFY; END; END; UNTIL Object.NEXT = 0; end; MESSAGE('Fertig'); Name DataType Subtype Length Object Record Objekt LizenzPerm Record License Permission
Thanks! Lars