nerdexam
Microsoft

MB-500 · Question #290

An organization has 1,000 vendors that are part of a vendor group named Employee. You have a field named DlvTerm that is used to describe the delivery terms for a vendor. You need to set the value…

The correct answer is B. VendTable v; var vo = new SysDaUpdateObject(v); vo.settingClause() .add(fieldStr(VendTable, DlvTerm), new SysDaValueExpression("Cash")); vo.whereClause(new SysDaEqualsExpression( new SysDaFieldExpression(v, fieldStr(VendTable, VendGroup)), new SysDaValueExpression("Employee"))); ttsbegin; new SysDaUpdateStatement().execute(vo); ttscommit; C. VendTable v; var vo = new SysDaUpdateObject(v); vo.settingClause() .add(fieldStr(VendTable, DlvTerm), new SysDaValueExpression("Cash")); vo.whereClause(new SysDaEqualsExpression( new SysDaFieldExpression(v, fieldStr(VendTable, VendGroup)), new SysDaValueExpression("Employee"))); ttsbegin; new SysDaUpdateStatement().update(vo); ttscommit. Options B and C are correct because both use the SysDa (System Data Access) framework - specifically SysDaUpdateObject combined with SysDaUpdateStatement - to issue a single set-based SQL UPDATE statement against the database. This satisfies the requirement of updating all…

Develop business logic

Question

An organization has 1,000 vendors that are part of a vendor group named Employee. You have a field named DlvTerm that is used to describe the delivery terms for a vendor. You need to set the value of DlvTerm to Cash for all vendors in the vendor group. You must update all vendor records in the vendor group as a single bulk operation. Which two code segments can you use? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point. A. B. C. D.

Exhibits

MB-500 question #290 exhibit 1
MB-500 question #290 exhibit 2
MB-500 question #290 exhibit 3

Options

  • Attsbegin(); while select forupdate VendTable where VendTable.VendGroup == "Employee" { VendTable.DlvTerm = 'Cash'; VendTable.update(); } ttscommit();
  • BVendTable v; var vo = new SysDaUpdateObject(v); vo.settingClause() .add(fieldStr(VendTable, DlvTerm), new SysDaValueExpression("Cash")); vo.whereClause(new SysDaEqualsExpression( new SysDaFieldExpression(v, fieldStr(VendTable, VendGroup)), new SysDaValueExpression("Employee"))); ttsbegin; new SysDaUpdateStatement().execute(vo); ttscommit;
  • CVendTable v; var vo = new SysDaUpdateObject(v); vo.settingClause() .add(fieldStr(VendTable, DlvTerm), new SysDaValueExpression("Cash")); vo.whereClause(new SysDaEqualsExpression( new SysDaFieldExpression(v, fieldStr(VendTable, VendGroup)), new SysDaValueExpression("Employee"))); ttsbegin; new SysDaUpdateStatement().update(vo); ttscommit;
  • DVendTable v; var vo = new SysDaUpdateObject(v); vo.settingClause() .add(fieldStr(VendTable, DlvTerm), new SysDaValueExpression("Cash")); vo.whereClause(new SysDaEqualsExpression( new SysDaFieldExpression(v, fieldStr(VendTable, VendGroup)), new SysDaValueExpression("Employee"))); ttsbegin; new SysDaUpdateStatement().update(vo); ttscommit;

How the community answered

(34 responses)
  • A
    24% (8)
  • B
    65% (22)
  • D
    12% (4)

Explanation

Options B and C are correct because both use the SysDa (System Data Access) framework - specifically SysDaUpdateObject combined with SysDaUpdateStatement - to issue a single set-based SQL UPDATE statement against the database. This satisfies the requirement of updating all 1,000 vendor records as one bulk operation rather than row by row. Both .execute(vo) (B) and .update(vo) (C) are valid methods on SysDaUpdateStatement that trigger the bulk execution.

Option A is wrong because the while select forupdate loop calls .update() on each record individually inside the loop, meaning it issues up to 1,000 separate UPDATE statements - this is a row-by-row operation, not a single bulk operation, which violates the stated requirement.

Option D appears identical to C in the question as written; in the original exam, D likely contains a subtle syntax error or uses an incorrect method name (such as a misspelled API call), making it invalid despite looking correct at a glance.

Memory tip: Think "SysDa = Set-based Data Access." Whenever you see SysDaUpdateObject + SysDaUpdateStatement, that's a bulk operation. A while select forupdate with .update() inside the loop is always record-by-record - if the question demands a single bulk operation, eliminate it immediately.

Topics

#X++ bulk update#SysDa API#forupdate#ttsbegin/ttscommit

Community Discussion

No community discussion yet for this question.

Full MB-500 Practice