機械翻訳について

検索条件に一致するレコード数の取得

このサンプル・スクリプトは、名前がPinnacle Systemsの商談レコードの数を取得する方法を示しています。 このスクリプトは、OpportunityオブジェクトのDatabaseトリガー・イベントの「挿入前」セクションに配置できます。

def v = newView('OpportunityVO')   // VO can be changed according to the Object used for counting the records
def vc = newViewCriteria(v)
def vcr = vc.createRow()
def vciName = vcr.ensureCriteriaItem("Name")  // Field name of the View Object used for the Criteria
vciName.setOperator('=')
vciName.setValue("Pinnacle Systems")
vc.insertRow(vcr)
v.appendViewCriteria(vc)
long count = 0;
v.executeQuery()
count = v.getEstimatedRowCount()
println('Opportunities found: ' + count)
ノート: getEstimatedRowCount()関数は見積りを返します。 正確な値が常に予想される場所では使用できません。