nerdexam
Microsoft

PL-400 · Question #91

You have the following code: You have a contact record that uses the GUID 2CFB1599-DEAD-425F-AB4A-76E6CAB51B09. You need to assign the contact record as the primary contact for an account when you…

The correct answer is B. Option B C. Option C. To assign a primary contact to an account during creation, two valid code segments would involve instantiating an Account entity and setting its primarycontactid attribute to an EntityReference pointing to the contact's GUID.

Submitted by sofia.br· Apr 18, 2026

Question

You have the following code: You have a contact record that uses the GUID 2CFB1599-DEAD-425F-AB4A-76E6CAB51B09. You need to assign the contact record as the primary contact for an account when you create the account. Which two code segments can you use? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

Exhibits

PL-400 question #91 exhibit 1
PL-400 question #91 exhibit 2

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D

How the community answered

(33 responses)
  • A
    9% (3)
  • B
    70% (23)
  • D
    21% (7)

Why each option

To assign a primary contact to an account during creation, two valid code segments would involve instantiating an `Account` entity and setting its `primarycontactid` attribute to an `EntityReference` pointing to the contact's GUID.

AOption A

This option contains a code segment that does not correctly assign the primary contact or uses an invalid method/syntax for setting the `primarycontactid` lookup field on the `Account` entity.

BOption BCorrect

This option provides a valid code segment that correctly assigns the specified contact GUID to the `primarycontactid` lookup field of the `Account` entity, establishing the primary contact relationship during account creation.

COption CCorrect

This option also provides a valid code segment that correctly assigns the specified contact GUID to the `primarycontactid` lookup field of the `Account` entity, using an alternative but equally valid method for setting the `EntityReference`.

DOption D

This option contains a code segment that does not correctly assign the primary contact or uses an invalid method/syntax for setting the `primarycontactid` lookup field on the `Account` entity.

Concept tested: Dynamics 365 SDK account primary contact assignment

Source: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/entity-references

Community Discussion

No community discussion yet for this question.

Full PL-400 Practice