Hi,
I'm new to making macro's and reports.
I'm trying to make a macro on the event Object created, that fills in the attribute Id.
I could use some global variable, perhaps an attribute on the database, that keeps the number of the next Id.
I managed to make a macro and link it to the event Object created, that part works. But now I have to make the code so that it only creates an Id for the symbol Process, and I have to look for the global variable and put it in the attribute of that new object.
I think the code should be something like this:
var allObjects = Context.getSelectedObjects(); for (var i = 0; i < allObjects.length; i++){ var symbol = allObjects[i].GETSYMBOOL; if(smbol = PROCESSYMBOOL){ var NextNr = DATABASE.ATTRIBUUTVALUE + 1; var nID = "O.Proc." & NextNr.TOSTRING(); Designer.setAttributePersistent(allObjects[i], Constants.AT_ID, nID, null); } }
But I don't know it exactly. Can somebody help me to make it work?
Thank you!