Free PL-400 Exam Braindumps (page: 22)

Page 21 of 100

DRAG DROP (Drag and Drop is not supported)
You are creating a model-driven app that requires complex business logic when a Dataverse record is updated.

The app must provide the following functionality:

-Update a record using a REST API and able to manually retry in the event of a failure without additional development.
-Validate the record values and display an error message next to those that are invalid.

You need to configure the app with the required business logic.

Which implementation method should you use? To answer, move the appropriate implementation methods to the correct functionalities. You may use each implementation method once, more than once, or not at all. You may need to move the split bar between panes or scroll to view content.

NOTE: Each correct selection is worth one point.

  1. See Explanation section for answer.

Answer(s): A

Explanation:




Update using a REST API - Power Automate
Power Automate flows can be used to call REST APIs and handle retries in the case of failure, which is suitable for handling external REST API updates.

Validate record values - JavaScript
JavaScript is typically used for client-side validation and can be used to validate record values and display error messages next to invalid fields in the UI.

This provides the required business logic while adhering to the functionality and implementation methods available.



A company requires a plug-in that makes multiple requests to an external web service. The plug-in must not time out when the web service has issues or is slow to respond.

You need to create the plug-in.

What should you do?

  1. Register the plug-in to run synchronously.
  2. Set the HTTP connection KeepAlive property to false.
  3. Register the plug-in by using isolation mode = none.
  4. Assign the IOrganizationService object to a member variable.

Answer(s): B

Explanation:

Correct:
* Set the HTTP connection KeepAlive property to false.

* Set the HTTP connection timeout value explicitly to limit how long each connection can remain open

Incorrect:
* Assign the IOrganizationService object to a member variable.
* Register the plug-in step once for each web service request.
* Register the plug-in to run synchronously.
* Send requests to use multiple threads

Note:
* Set the HTTP connection KeepAlive property to false
Set KeepAlive to false when interacting with external hosts in a plug-in

Category: Performance
Impact potential: High

Symptoms
If a plug-in makes external web requests and is trying to use KeepAlive on a closed connection, the plug-in will ultimately fail to execute the web request. If the plug-in is registered:

* Synchronously, users may experience:
Unresponsive model-driven apps
Slow client interactions
The browser stops responding

* Asynchronously, plug-in executions may take an extended period of time before failing.

Guidance
In HTTP 1.1, all connections are considered persistent (KeepAlive is true) unless declared otherwise. Due to the fact that plug-ins run in isolation, the Sandbox service translates into them being short-lived executions that generally would not benefit from KeepAlive. To avoid problems with connecting to external services we recommend disabling KeepAlive within plug-ins. If your specific external service would benefit from using persistent sessions for performance reasons, actively send a KeepAlive at an interval of half the idle timeout (30 seconds) to keep the connection from closing.

Problematic patterns
In order to override the default value of KeepAlive for the non-WCF interactions, the approach should be taken to leverage HttpWebRequest to perform the interactions with the web server, but first setting the KeepAlive property to false.

* Set the HTTP connection timeout value explicitly to limit how long each connection can remain open


Power Apps Dataverse, Set Timeout when making external calls in a plug-in

Category: Performance

Impact potential: High

Symptoms
If a plug-in makes external web requests that fail to respond quickly, the plug-in will wait for the full default timeout period before failing. This duration may cause a long transaction that can effect other operations. If the plug-in is registered:

Synchronously, users may experience:

Unresponsive model-driven apps
Slow client interactions
The browser stops responding
Asynchronously, plug-in executions may take an extended period of time before failing.

Guidance
The default timeout value for .Net Http clients is 100 seconds, just 20 seconds short of the time available for the plug-in to complete. It is best to establish an expected baseline time that a calling service will respond. The longer it exceeds this normal response time, the higher the probability it will ultimately fail. As a performance best practice, it is best to fail quickly rather than allow the default timeout period to expire. You should control the period that your call to the external service will wait.

The timeout value you should set will depend on the service. For example, if you can monitor the performance of the service you may determine a duration where 99.999% of requests succeed and set your timeout period to that duration with a few seconds buffer. This will prevent the occasional outliers from having an inordinate impact on the performance of your plug-in.

If you are using System.Net.Http.HttpClient Class, you can set the Timeout value explicitly, as shown in this example setting the timeout to 15 seconds.

C#

Copy
using (HttpClient client = new HttpClient())
{
client.Timeout = TimeSpan.FromMilliseconds(15000); //15 seconds
client.DefaultRequestHeaders.ConnectionClose = true; //Set KeepAlive to false

Etc.


Reference:

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-keepalive-false-interacting-external-hosts-plugin
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-timeout-for-external-calls-from-plug-ins



A company requires a plug-in that makes multiple requests to an external web service. The plug-in must not time out when the web service has issues or is slow to respond.

You need to create the plug-in.

What should you do?

  1. Register the plug-in to run synchronously.
  2. Register the plug-in by using isolation mode = none.
  3. Set the HTTP connection timeout value explicitly to limit how long each connection can remain open.
  4. Register the plug-in step once for each web service request.

Answer(s): C

Explanation:

Correct:
* Set the HTTP connection KeepAlive property to false.

* Set the HTTP connection timeout value explicitly to limit how long each connection can remain open

Incorrect:
* Assign the IOrganizationService object to a member variable.
* Register the plug-in step once for each web service request.
* Register the plug-in to run synchronously.
* Send requests to use multiple threads

Note:
* Set the HTTP connection KeepAlive property to false
Set KeepAlive to false when interacting with external hosts in a plug-in

Category: Performance
Impact potential: High

Symptoms
If a plug-in makes external web requests and is trying to use KeepAlive on a closed connection, the plug-in will ultimately fail to execute the web request. If the plug-in is registered:

* Synchronously, users may experience:
Unresponsive model-driven apps
Slow client interactions
The browser stops responding

* Asynchronously, plug-in executions may take an extended period of time before failing.

Guidance
In HTTP 1.1, all connections are considered persistent (KeepAlive is true) unless declared otherwise. Due to the fact that plug-ins run in isolation, the Sandbox service translates into them being short-lived executions that generally would not benefit from KeepAlive. To avoid problems with connecting to external services we recommend disabling KeepAlive within plug-ins. If your specific external service would benefit from using persistent sessions for performance reasons, actively send a KeepAlive at an interval of half the idle timeout (30 seconds) to keep the connection from closing.

Problematic patterns
In order to override the default value of KeepAlive for the non-WCF interactions, the approach should be taken to leverage HttpWebRequest to perform the interactions with the web server, but first setting the KeepAlive property to false.

* Set the HTTP connection timeout value explicitly to limit how long each connection can remain open

Power Apps Dataverse, Set Timeout when making external calls in a plug-in

Category: Performance

Impact potential: High

Symptoms
If a plug-in makes external web requests that fail to respond quickly, the plug-in will wait for the full default timeout period before failing. This duration may cause a long transaction that can effect other operations. If the plug-in is registered:

Synchronously, users may experience:

Unresponsive model-driven apps
Slow client interactions
The browser stops responding
Asynchronously, plug-in executions may take an extended period of time before failing.


Guidance
The default timeout value for .Net Http clients is 100 seconds, just 20 seconds short of the time available for the plug-in to complete. It is best to establish an expected baseline time that a calling service will respond. The longer it exceeds this normal response time, the higher the probability it will ultimately fail. As a performance best practice, it is best to fail quickly rather than allow the default timeout period to expire. You should control the period that your call to the external service will wait.

The timeout value you should set will depend on the service. For example, if you can monitor the performance of the service you may determine a duration where 99.999% of requests succeed and set your timeout period to that duration with a few seconds buffer. This will prevent the occasional outliers from having an inordinate impact on the performance of your plug-in.

If you are using System.Net.Http.HttpClient Class, you can set the Timeout value explicitly, as shown in this example setting the timeout to 15 seconds.

C#

Copy
using (HttpClient client = new HttpClient())
{
client.Timeout = TimeSpan.FromMilliseconds(15000); //15 seconds
client.DefaultRequestHeaders.ConnectionClose = true; //Set KeepAlive to false

Etc.


Reference:

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-keepalive-false-interacting-external-hosts-plugin
https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/set-timeout-for-external-calls-from-plug-ins



View Related Case Study

You need to ensure that Adventure Works Cycles can track information from visitors to bike fairs. What should you create?

  1. a Power Automate flow that connects with the bike fair Power Apps app to create a lead in Dynamics 365 Sales
  2. a Power Automate flow that generates a new customer record in SharePoint.
  3. a Power Automate flow to capture customer data from the bike fair Power Apps app in SharePoint and create a lead in Microsoft Teams.
  4. a business process flow in Dynamics 365 Sales for capturing leads.

Answer(s): A

Explanation:

Scenario:
-Qualified leads must be collected from local bike fairs.
-Adventure Works Cycles uses a Power Apps app for local bike fairs to attract new customers.

By using a Dynamics 365 connector, you can create flows that initiate when an event occurs in Dynamics 365, or some other service, which then performs an action in Dynamics 365, or some other service.

In Power Automate, you can set up automated workflows between your favorite apps and services to synchronize files, get notifications, collect data, and more.


Reference:

https://docs.microsoft.com/en-us/power-automate/connection-dynamics365






Post your Comments and Discuss Microsoft PL-400 exam with other Community members:

PL-400 Exam Discussions & Posts