分類コードの追加
この例では、標準オブジェクトIndustryにアクセスするための分類コードを追加する方法を示します。 Industryの関連(関連)コレクション名はCodeAssignmentです。
Industryオブジェクトにアクセスするには:
-
アカウントにカスタム選択リストIndustry_xxx_cを作成します。
-
次に示すように、アカウントでトリガーを作成します:
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) }