Recently we had a requirement to add the condition Code on
clicking the Condition Code Check box in Item application.
Below is the Code that was written in JavaScript,
Launch Point Type: Attribute Launch Point
Object: Item
importPackage(Packages.psdi.mbo); var conditioncode = mbo.getBoolean("CONDITIONENABLED"); var itemconditionSet = mbo.getMboSet("ITEMCONDITION"); if(conditioncode) { for(i=0;i<3;i++) { var itemcondition = itemconditionSet.addAtEnd(); if(i == 0) { itemcondition.setValue("CONDITIONCODE","A"); } else if(i == 1) { itemcondition.setValue("CONDITIONCODE","B"); } else if(i == 2) { itemcondition.setValue("CONDITIONCODE","C"); } } }