機械翻訳について

親子オブジェクトへのアクセス

このサンプル・スクリプトでは、親の商談オブジェクトから顧客対応オブジェクトの子レコードを作成します。 このスクリプトは、商談オブジェクトのデータベースへの挿入前トリガー・イベントに配置します。

コンポジット関連付けを使用して親子レコードを作成する際、子には親のコンテキストの外部に存在しないため、親レコードIDが作成時に子レコードに存在することを確認する必要があります。 親レコードを正しい行セットに追加する必要があります。 その場合のみ、子レコードが属している親レコードを識別できます。

def opptyUpdatedName = Name
def opptyOwnerId = OwnerResourcePartyId
def opptyAccountId = TargetPartyId
def voInteraction = newView('InteractionVO')
def createInt = voInteraction.createRow()
voInteraction.insertRow(createInt) // <-- This is shifted to a place before accessing the children.
def currentDateTime = now()
def interactionName = 'OptyNameModifed' + currentDateTime
createInt.setAttribute('InteractionDescription', interactionName)
createInt.setAttribute('InteractionStartDate', currentDateTime)
createInt.setAttribute('CustomerId',opptyAccountId)
def voIntAssociation = createInt.InteractionAssociation
def createIntAssc = voIntAssociation.createRow()
createIntAssc.setAttribute('AssociatedObjectUid',OptyId )
createIntAssc.setAttribute('AssociatedObjectCode','OPPORTUNITY')