Posts

Showing posts from January, 2022

DYNAMICS 365 PORTAL HOW TO CALL AND EXECUTE WORKFLOW

Image
Calling Dynamics 365 Workflows from portals can only be done by configuring and adding buttons in entity lists or entity forms. However, and for some requirements, you need to call a workflow from a web page that does not contain entity list nor entity form. So, how do we do this? All portal pages automatically include a JS reference to the file js\antiforgerytoken.js that contains an object named shell which has a method called ajaxSafePost that can be used and let you achieve request calls to the server. How do we use this function to call workflow from the portal? Below is an example of how you could use the ajaxSafePost method to invoke the execute workflow service. I've created the below function that take the parameters needed to execute the workflow function Execut...

DYNAMICS 365 AUTOMATICALLY EXPAND COLLAPSE BUSINESS PROCESS FLOW IN JAVASCRIPT

Image
As you know, in Dynamics 365, business process flows are used to ensure that the users follow the same steps in order to achieve specific operation. It leads the users through the process by guiding them on what should be entered during each phase of it. In the Unified Interface, the business process flow is by default collapsed and the user must click on it to see what is needed in this phase. However, you can still enhance this user experience, by dynamically showing and hiding the business process flow whenever it is needed. Therefore, the user can know when and what is needed in this phase of the process. In the following points, we will see how to dynamically collapse and expand a business process flow (BPF) in JavaScript . First thing to know is that the BPF can have three display states: Expanded, Collapsed, and Floating ...

POWER PLATFORM RECOVER DELETED ENVIRONMENTS

Image
You deleted an environment and you want to recover it back? You can do it from the Power Platform admin center if you are still within the time limit which is 7 days of deletion. In the below steps, we will see how to recover a deleted environment from the admin center . Open the Power Platform admin center and go to Environments Click the Recover deleted environments button In the new page, you will see all the environments that were deleted within 7 days of deletion Select an environment to recover, and click Recover Confirm the recovery by clicking Continue and then OK ...

DYNAMICS 365 HOW TO EXECUTE FETCHXML QUERIES IN C#

Previously, we saw how to execute FetchXml query using Xrm.WebApi in JavaScript In this quick post, we will see how to execute FetchXml query in C# . Prepare the FetchXml you want to execute whether from the Advanced Find, or any other FetchXml generator in the community Create the C# function you want to call in order to execute the retrieve request and Copy/Paste the FetchXml query In order to be able to execute FetchXml queries in C#, you must use the FetchExpression class instead of QueryExpression as per the below public void FetchXmlInFetchExpression() { var fetchQuery = @" <fetch version='1.0' output-format='xml-platform' ma...

DYNAMICS 365 HOW TO EXECUTE FETCHXML QUERIES IN WEB.API JAVASCRIPT

In Dynamics 365, you can use WebAPI calls to retrieve data using OData queries. However, when coming to more complex queries, the OData might become complicated to be built if not impossible. Therefore, using FetchXml queries in the WebAPI call is your best option. Querying using FetchXml have more advantages from the easiness to be generated using the Advanced Find and more readable, to using joins and aggregations. In this quick post, we will see how to execute FetchXml query using Xrm.WebApi in JavaScript . Prepare the FetchXml you want to execute whether from the Advanced Find, or any other FetchXml generator in the community Prepare the JavaScript function you want to call in order to execute WebAPI request The below function is used to retrieve the user roles ...