You need to use an alternate key for the data operations with the Dataverse table.
Here is the code:
Please select all data operations that this code can execute.
Click on the arrows to vote for the correct answer
A. B. C. D. E. F.Correct Answers: B and E
All Dataverse tables have a primary key.
A primary key is a GUID.
When you read or write records, it is not efficient to search for GUID first and then access the record.
Therefore, it is more convenient and productive to have another unique key for the record - an alternate key.
You can use any column or combination of columns that uniquely identify the records as an alternate key.
An alternate key can be used as a substitute for a primary key.
The alternate keys are important for integration between Dataverse records and external sources.
External databases can use an alternate key for the records access.
When you work with Dataverse records and do not know if the record exists or not, the best way is to use the Upsert operation.
The Upsert is a combination of Update and Insert.
Or if you use this in a code - the UpsertRequest()
It is the combination between CreateRequest() and UpdateRequest()
The UpsertRequest has the performance overhead.
Therefore, if you know that a record does not exist, use the CreateRequest.
Or it is present in the table - use the UpdateRequest()
In the code, we use an alternate key as a combination of the two fields: email address and business phone (Number 1) to create a Customer table object (Number 2)
If the record in the Customer table exists for the values of the alternate key ("infor@cbindustries.com" and "1234-56-78”), the UpsertRequest() (Number 4) will update the values of the firstname, lastname, and jobtitle columns with “John,” “Doe,” and “CTO” (Number 3)
If there is no record in the Customer table for the values of the alternate key ("infor@cbindustries.com" and "1234-56-78”), the UpsertRequest() will create a new record using the values for the alternate key and the firstname, lastname, and jobtitle columns.
All these operations will be performed during the execution of the request (Number 5)
The response (Number 6) has RecordCreated property.
If a request creates a new record, the RecordCreated value is true.
Otherwise, the value is false for the record update.
Options B and E are correct because the code uses the Upsert operation.
The Upsert is a combination of Update and Insert (or create).
All other options are incorrect.
For more information about Dataverse alternate keys and Upsert, please visit the below URLs: