Hello everyone,I am new to using object structure automation scripts but with the IBM documentation i have figured out how to do a simple validation before data gets written in the objects:
function beforeMboData(ctx) {
structData = ctx.getData();
if (structData.getCurrentData("SERVRECTRANSID")) {
ctx.error("servrectrans", "nofillservrecid")
}
}
Now i am trying to validate if a combination of two fields in the object structure is repeated in others lines but i havent figured out how to do a "for" or a "while" with all the object structure data. I was thinking something like this:
function beforeMboData(ctx) {
x = 0;
while
/-- Variables should be compared here --/
/-- If variables are found in another line --/
x = 1;
if (x == 1) {
ctx.error("servrectrans", "repeatcodserv")
}
}
Any advice will be helpful.PD: English is not my main language, sorry for the grammar.------------------------------
Arturo Carmona Lozano
------------------------------
#AssetandFacilitiesManagement#Maximo