QuestionQ32

Extend the platform

The following code updates the customersizecode choice column on the Account table when the numberofemployees column value exceeds 100.

Line numbers are included for reference only.

Question Image

For each statement, select Yes when it is true. Otherwise, select No.

Yes or No
StatementsYesNo
Does the Retrieve method use the correct parameters?
Will a plug-in triggered on the update of the numberofemployees column execute after the Update method is executed?
Will an exception be thrown if the value for numberofemployees is null?
Explanation

IOrganizationService.Retrieve requires a Guid record ID, whereas accountId is declared as string. Update plug-in filtering attributes are evaluated against the columns included in the Update request; this request updates customersizecode, not numberofemployees. For a non-nullable value type such as int, GetAttributeValue<int> returns the type’s default value when the attribute is missing, so a null/missing numberofemployees yields 0 rather than an exception.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!