Posts

DYNAMICS 365 VIEW FILTER ERROR “There was an error in showing this condition”

Image
In Dynamics 365, you opened a view filter criteria and an error is displayed in one of the conditions. In this article, we will see how to solve this error in the filter of a Dynamics 365 view. PROBLEM The following error message appears in the filter of a Dynamics 365 view There was an error in showing this condition If you click on the information icon, more details will be displayed REASON The Searchable property of the field having the issue is set to No SOLUTION Open the field properties and set the Searchable property to Yes If you reopen the filter of the view, the condition will be normally displayed without error Hope This Helps!

DYNAMICS 365 FORM NOTIFICATION AND FIELD NOTIFICATION

Image
In a previous post, we saw how to display a global notification that lives across the Model driven App . In Dynamics 365 form, you can display two types of notifications: Form Notifications and Field Notifications . In this article, we will see how to display Form Notifications and Field Notifications within an entity form using JavaScript . The form notification will be displayed on top of the form and the setFormNotification function is used to display form level notifications function displayFormNotification(context) { var formContext = context.getFormContext(); formContext.ui.setFormNotification("This is an INFORMATION form notification.", "INFO", "InformationNotificationId"); formCon...

DYNAMICS 365 UPDATE RECORD OWNER AFTER ASSIGNREQUEST DEPRECATED

Image
In a previous post, we saw how to change record status in Dynamics 365 using C# after the SetStateRequest message is deprecated . In addition, when we wanted to update the owner of a record, we had to use the AssignRequest message to set it. However, as you all know, the message AssignRequest is deprecated and in order to set the owner of a record, you can now use the Update request without doing another specific call. In this post, we will see the function on how to change record owner in Dynamics 365 using C# . Below is the deprecated AssignRequest message used to set the owner of a record public void AccountAssignRequest(Account account) { var assignRequest = new AssignRequest { ...

DYNAMICS 365 UPDATE RECORD STATUS AFTER SETSTATEREQUEST DEPRECATED

Image
In a previous post, we saw how to change record owner in Dynamics 365 using C# after the AssignRequest message is deprecated . In addition, when we wanted to update the status of a record, we had to use the SetStateRequest message to set it. However, as you all know, since the message SetStateRequest is deprecated , you can now use the Update request in order to set the status of a record without doing another specific call. In this post, we will see the function on how to change record status in Dynamics 365 using C# . Below is the deprecated SetStateRequest message used to set the status of a record public void SetStateRequest(Account account) { SetStateRequest setStateRequest = new SetStateRequest ...

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 ...

DYNAMICS 365 HOW TO RETRIEVE BUSINESS UNIT DEFAULT TEAM IN C# AND JAVASCRIPT

In Dynamics 365, each Business Unit can have one or more Teams under it, but has one Default Team that will be automatically created by the system each time a new Business Unit is created, and will have the same name as the Business Unit name. The membership of this team will be systematically managed, where users are automatically added to the team whenever users are added to the business unit and removed from the team whenever users are removed from the business unit. In addition, the default team can be used to simplify the management of the security roles when users have common permissions, where you can associate a security role to the Default Team with a set of permissions that will be given to all users in the business unit. On the other hand, Default Teams cannot be deleted and will have the field Team Type set to Owner ; therefore, they can own records if needed by setting it ...

DYNAMICS 365 ADVANCED FILTER

Image
Previously, we saw the Column options feature that came with the 2021 Microsoft Wave 2 Release that allows the users to add columns to the views on the fly. In this post, we will see an older feature that came with the 2020 Microsoft Wave 1 Release which is the Advanced Filter . As you know, one of the most used functionality in Dynamics 365 is the Advanced Find that gives users the ability to build and execute complex queries and apply actions on the retrieved records. In addition, the filter that existed on the views, was limited to the columns displayed on the view and sometimes not all the columns can be filtered. However, with the introduction of the Advanced Filter feature, the end-users are able to build complex filtering in the entity views whether for system or custom entities similarly to the Advanced Find. But, they will stay in the same ...

DYNAMICS 365 COLUMN OPTIONS FEATURE TO ADD VIEW COLUMNS ON THE FLY

Image
Each time, when end-users request the ability to modify the views, we mainly direct them to the Advanced Find or to Create a personal View where they can add or remove columns as per their need. However, with the 2021 Microsoft Wave 2 release, the users will be able to easily change the view in the interface by adding/removing columns on the fly in the opened view using the Column options feature. So, Let's see how this feature works in the below steps Go to your Dynamics 365 environment and open a view (I will work in the Active Account view) Click the Column Options button on top of the view The Edit Columns pane will open in the right side of the view Here, you can remove columns, organize th...

DYNAMICS 365 HOW TO HIDE RECENT RECORDS FOR LOOKUP FIELD IN UCI

Image
In UCI, a lot of behaviors have been changed comparing to the Classic Web Interface such as the tabs, BPF, and many others. Today, I will be talking about one of these behaviors which is the Recent Records in lookup fields. In a brief summary, the Recent Records feature will suggest the latest records that have been searched for, where the user can select one of them, and, the list of available records of the current view will then be displayed. This is a nice-to-have feature since it might help the users to speed up data entry. However, if the lookup has been filtered to display specific records, the Recent Records will not respect this filter and will keep showing records even is they should not. This scenario can lead to selecting a record by the user that is not allowed to be selected. Therefore, in this situation, it is better to hide the Recent Records t...