Skip to main content

Posts

Showing posts with the label UtilIdElements

Merging code/elements in Layers

I've been assigned a task where the merge between VAR and CUS-layer of the application is necessary. I like to make my self a TO-do-list of elements to be processed, so I can check an item when it is done. I wrote a small job to identify elements in the application that were represented in both VAR and CUS-layers thus representing a potential layer-conflict. The job produces an info-log with the potential conflicts that can be copied in to Excel to be used as a TO-DO-list. static void JSOVarVapAndCusConflictsJob9(Args _args) { UtilIdElements utilIdElements; UtilIdElements VarVapUtilIdElements; Map elemMap; MapIterator elemMI; UtilElementType recType; RecId utilId; int pos; str 60 elementName; elemMap = new Map(Types::String,Types::String); while select UtilIdElements where (utilIdElements.utilLevel == UtilEntryLevel::cus) && UtilIdElements.parentId == 0 { elemMap.insert(enum2str(UtilIdElements.recordType)+";"+num2str(UtilIdElements.recid,0,0,0,0),UtilIdElements.na...

How to delete AOT nodes by code (UtilIdElements solution)

in my old post: How to delete AOT objects (AX/Axapta), I have used the TreeNode class. There is another useful method by using the UtilIdElements system table described in the following links: - MS KB 913530 (CustomerSource) - forum topic: microsoft.public.axapta.programming - Currupt records in UtilIdElement and UtilElements Warning: Serious problems might occur if you modify the UtilIdElements table using this or another method. Modify system tables at your own risk. The code: static void Job1(Args _args) { UtilIdElements utilElement; ; ttsbegin; select utilElement where utilElement.name == 'myElementName' && utilElement.utilLevel == utilEntryLevel::cus // any layer && utilElement.recordType == utilElementType::Table; // object type if (utilelement) { utilElement.delete(); ttscommit; info('Record should be deleted now.'); } else { ttsAbort; info('Cou...