Groovyを使用してリード・フィールドに商談クローズ日を割り当てるにはどうすればよいですか。
商談オブジェクトに「更新前」トリガーを作成して、商談クローズ日を割り当てる関連リードを識別し、必要な値でフィールドの値を挿入できます。
このサンプルGroovyスクリプトを使用すると、作業を開始できます。
def a = OpportunityLead
def f = ''
while (a.hasNext()){
def d = a.next()
f = f + ' - ' + d.LeadId
}
//throw new oracle.jbo.ValidationException('The lead ID is ' + f)
println('Leads - ' + f)
def vo = newView('Lead')
def vc = newViewCriteria(vo)
def vcr = vc.createRow()
def vci = vcr.ensureCriteriaItem('LeadId')
vci.setOperator('=')
vci.setValue(/*get the value from previously found leads*/)
vc.insertRow(vcr)
vo.appendViewCriteria(vc)
vo.setMaxFetchSize(500)
vo.executeQuery()