Add Classification Code
This example shows how to add a classification code to access the standard object Industry. The associated (related) collection name of Industry is CodeAssignment.
To access the Industry object:
-
Create the custom choice list, Industry_xxx_c, in Account.
-
Create a trigger in Account as shown below:
def ClassCategory_t = '1972 SIC' def ClassCode_t = nvl(Industry_xxx_c, '0') def CreatedByModule_t = 'ZCM' def OwnerTableName_t ='HZ_PARTIES' def OwnerTableId_t = PartyId def oldIndustryCollection = CodeAssignment def vo = newView('CodeAssignment') if(ClassCode_t) { def newIndustry = vo.createRow() newIndustry.setAttribute('ClassCategory', ClassCategory_t) newIndustry.setAttribute('ClassCode', ClassCode_t) newIndustry.setAttribute('CreatedByModule', CreatedByModule_t) newIndustry.setAttribute('OwnerTableName', OwnerTableName_t) newIndustry.setAttribute('OwnerTableId', OwnerTableId_t) vo.insertRow(newIndustry) }