exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 2 question 38 discussion

Actual exam question from Microsoft's PL-400
Question #: 38
Topic #: 2
[All PL-400 Questions]

HOTSPOT
-

The following code updates the customersizecode choice column on the Account table if the numberofemployees column value is greater than 100.

Line numbering is provided for information only.



For each of the following statements, select Yes if the statement is true. Otherwise, select No.

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
DimpleG
Highly Voted 2 years ago
The first one should be No, because the Retrieve method will take GUID as a parameter but given the function sending string as AccountID, the account needs to convert to GUID.
upvoted 17 times
SushiFlango
1 year, 8 months ago
1-NO. I agree, Code only works if is new guid(AccountID). 2-No , the second is harder because In the ask no indicated trigger attribute, but Colum set true update all, is not the best practice. this asks with the option Is so idiot because wee don1t have the full context. 3-NO, I agree.
upvoted 4 times
...
vrpexamtopics
2 years ago
I agree. Correct answers are No, No, No. If you update a retrieved entity record with Update method, all fields get updated and hence plugin will be triggered. Comparing int with null will return false and will not throw an exception.
upvoted 3 times
Luci79
1 year, 11 months ago
A plugin on update will trigger only if filter attributes are not used which is not best practice, here is not clear. Also using Retrieve with ColumnSet(True) is not best practice.
upvoted 4 times
...
...
...
1285cc6
Most Recent 1 week ago
No Yes Yes. 1st one is you can't use string in place of GUID 2nd one if filtering attributes is set correctly, a plugin will fire after update 3rd one exception will be thrown. You can't compare null > 100 it will error.
upvoted 1 times
...
JNSNWY
4 months, 4 weeks ago
1. No - using string instead of guid. 2. Yes - numberofemployees will get updated so any plugin attached to this field will run.\ 3. No - that is why it is recommended to use GetAttributeValue.
upvoted 2 times
gradient
1 month, 3 weeks ago
1-NO 2-YES 3-NO Setting unchanged column values will cause the retrieved column values to be set as changed which can trigger unwanted additional business logic or cause auditing data to misrepresent actual changes. Instead, you should instantiate a new instance and only set values that have actually changed. https://learn.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.iorganizationservice.update?view=dataverse-sdk-latest
upvoted 1 times
...
...
rrustick
11 months, 2 weeks ago
According to ChatGPT, when given the code and the fact that the accountId is NOT cast as a GUID, the code could still run: ChatGPT Answer: In summary, while the plugin code itself does not explicitly cast accountId to a Guid, the success or failure of the code execution will depend on the validity of the accountId string as a GUID representation.
upvoted 2 times
...
oescm
1 year, 3 months ago
Shouldn't the second option be "Yes" accoring to Microsoft documentation ?: "You should avoid retrieving all columns in a query result because of the impact on a subsequent update of records. In an update, this will set all field values, even if they are unchanged, and often triggers cascaded updates to child records" https://learn.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.query.columnset.allcolumns?view=dataverse-sdk-latest
upvoted 3 times
FCTopics
8 months, 3 weeks ago
Depending on how the question is interpreted, the second option could be one option or the other. - If we take into account, that the plugin with the code they have put, would fail in the Retrieve so the Update would never be executed, so the right option would be No. - If the second parameter of the Retrieve had been set to a GUID, then the second option would be Yes.
upvoted 2 times
...
...
At09
1 year, 4 months ago
No to all
upvoted 3 times
...
MeTToW
1 year, 4 months ago
First one is "Yes" , you can find the same code at the page below. Entity entity = svc.Retrieve("account", accountid, new ColumnSet("name")); https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/entity-operations-retrieve
upvoted 4 times
friik
1 year, 2 months ago
It's a "No". Look at the parameter of the method, it recieves a string, which is not a correct Guid format. The method parameter should have been (..., Guid accountid) for this to work.
upvoted 4 times
...
...
jkaur
1 year, 6 months ago
No for all
upvoted 4 times
...
DummyTest1
1 year, 7 months ago
I think it should be No, Yes and No. For second one, there seems to be some missing context. But with waht is being mentioned, Yes seems to be correct
upvoted 4 times
...
emapedrozo
1 year, 9 months ago
Sentence 1: No https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/entity-operations-retrieve Sentence 2: No A plugin on update will trigger only if filter attributes are not used which is not best practice. Also using Retrieve with ColumnSet(True) is not best practice, however the parameters are correct. Sentence 3: No https://learn.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.entity.getattributevalue?view=dataverse-sdk-latest
upvoted 3 times
Burhanshah
1 year, 5 months ago
If Retrieve parameters are correct then Sentence 1 should be Yes
upvoted 2 times
...
...
BolDeFruits
1 year, 11 months ago
answer is NO , YES,YES.
upvoted 1 times
Lolloloschi97
1 year, 9 months ago
When an entity instance does not include the attribute specified using the attributeLogicalName parameter this method will return the default value rather than throw an exception
upvoted 2 times
...
...
Luci79
1 year, 11 months ago
A plugin on update will trigger only if filter attributes are not used which is not best practice. Also using Retrieve with ColumnSet(True) is not best practice, however the parameters are correct.
upvoted 2 times
...
Fyrus
2 years ago
if they use columSet(true) every plugin on update of the record will trigger, even if it's value does not changes. Make the test by yourself: Create a plugin that take a value and make it value += 1 on update of another field and make a "columnSet(true)" with an update later...
upvoted 4 times
Luci79
1 year, 11 months ago
If the plugin on update has filter attributes it will only trigger when those attributes are updated not always even if you use ColumnSet(True);
upvoted 1 times
friik
1 year, 2 months ago
If the filtering of attributes isn't mentioned, we shouldn't assume that's happening either.
upvoted 1 times
...
...
...
hikmatune
2 years ago
maybe the first one is correct if its GUID as shown in here https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/entity-operations-retrieve#basic-retrieve
upvoted 2 times
friik
1 year, 2 months ago
Look at the method parameter. It's a string, not a Guid, which is incorrect.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago