Posts

Showing posts from November, 2019

[Error] code 2147748619 or 0x80040b0b when Email or Appointment is Saved with certain Contact, Account in Dynamics 365 / CDS

Image
TL;DR version: The user cannot save the Email/Appointment if one of the Recipient/Attendee has an invalid email address.

SYMPTOM When the user tried to save the Email or Appointment with certain Contact/Account record in Email Recipient/Attendee, the system shows an error messages as below with error message 2147748619 or generic error message and Error code: 0x80040b0b. Once the error message shows up, the subsequent save actions are no longer affected.
The error message or code is not helpful for the user to figure out what is causing the issue.




CAUSE It turned out to be that the issue is caused by one of the Email Recipient/Attendee records which contains the invalid email address.
Normally, you cannot set the invalid email address to the email field via UI or classic workflow. In this case, it was due to the import data not being cleaned up properly during the data migration.

If you attempt the same action in legacy web client, you can clearly see the proper error message too.


RESOLU…

[Power Automate] How to Set Lookup Field Value in Common Data Service (current environment) Flow Connector

Image
If you're using Common Data Service (current environment) connector in your flow and getting the following errors, that means you are either

setting the GUID value directly ornot providing a correct plural version of entity schema name.
Empty segment encountered in request URL. Please make sure that a valid request URL is specified.Resource not found for the segment xxxxx 1. In (classic) Common Data Service connector, you can just set the GUID value of the record to populate the lookup value of the field. For polymorphic lookups, you will have an additional Type dropdown field (e.g. Customer Type) to choose the entity type of the record that you are setting.

But in the new CDS (current environment) connector, you need to provide the type of entity even if the lookup is just normal lookup to a single entity. For polymorphic lookups, there will be multiple fields for each entity type (e.g. Customer (Accounts) and Customer (Contacts) ) and you need to fill up the correct entity type th…

Getting the Lookup Attribute of the Parent Record in Power Apps Canvas App Development with Common Data Service (CDS)

Image
When you collect the CDS data source into the collection, you can add the fields from the related (lookup) entity using AddColumns function. That can be achieved because the lookup values from CDS data source are returned as a record in Power Apps comparing to Dynamics 365 SDK/API which only returns an Entity Reference with GUID and Entity Type.

But adding the fields from the related (lookup) entity works for all data type except the lookup fields. When we add the lookup value of the lookup field, there is no error in the formula but it just returns an empty column. I guess that is because of the same reason why CDS data source structure needs to return the whole record for the lookup value of the lookup field.

I asked in the Power Apps Community forum but I got a response from the Microsoft Community Support Engineer that "we can't get the Lookup value of lookup field in batches". So here is the workaround solution provided by the Microsoft Community Support engineer an…

Intellisense Issue with Experimental Enhanced Formula Bar in canvas app for Power Apps

I have been using Experimental formula bar in Power Apps Studio for a week and so far, I really like it. I can

use Enter for a new linebring up suggestions on-demand using pressing CTRL+ Space (which does not show all the time)navigate around the formula bar with Up and Down arrow keys without getting into suggestionsexpand the formula bar with one click without dragging down all the timelook through the items within a group in the property dropdown Now I feel more like coding in the formula bar rather than using excel formula bar.
But there is one issue that I am encountering Intellisense issue with Experimental Enhanced Formula Bar where the code-completion doesn't remove the user entered partial words properly.
Based on my observation, it would just remove the alphanumeric characters immediately before the cursor and not removing the characters before a space or the single quote '  Scenario 1 The maker entered  'Phon Pressed CTRL + Space and chose 'Phone Calls' f…

[Power Automate] New Action "Executes a changeset request" in Microsoft Flow Common Data Service (current environment) connector

Image
Today, I found one Action in Common Data Service (current environment) connector while I am creating an action step in Microsoft Flow.
The action name is "Executes a changeset request" and I quickly check Microsoft Docs site for more info only to find the following one. (That's very helpful, Microsoft... Thanks for the information)

Maybe it is the preview feature or maybe it is still in progress and that's why the documentation is incomplete and nobody in the community talks about it.
So I just gave it a try and here is what I think it does, based on my observation.

When I added the new step of Executes a changeset request Action, there is an option to add nested actions (just like Control actions). But the only difference with this one is that you cannot add any other action and only Create, Update and Delete actions of CDS (current environment) connector are allowed.


At this point, I sort of get the idea of this Action based on its name "changeset" and th…

Pass Parameters to Quick Create Form in Dynamics 365 using formContext.data.attributes

Image
With the deprecation of Xrm.Page.context.getQueryStringParameters, Microsoft Docs article suggested using formContext.data.attributes API to make retrieval of non-entity bound data consistent across entity forms.
But some of the sample codes that I found online are all using the deprecated Xrm.Page.context.getQueryStringParameters and some are using undocumented Xrm.Utility.getGlobalContext().getQueryStringParameters(). I found some forum thread saying that "getQueryStringParameters" itself is deprecated regardless of whether is from Xrm.Page or Xrm.Utility.
So here is a sample code on how to pass parameters to another form. In this example, I am trying to pass the custom parameter from the main form of an entity to the quick create form which is opened by Xrm.Navigation.openForm API.

First of all, you will need to add the parameter in the Form Properties of the form that you are receiving the parameter (Quick Create form in this case). Follow this Microsoft Docs article to …

Lookups Showing Same Custom View in Unified Interface because of Same viewId in addCustomView JavaScript

Recently in one of my Dynamics 365 projects, I had to filter the lookup using JavaScript because of the nature of the filter which cannot be achieved using OOB filter.

I just simply write the following code to filter and set the viewId by generating some random GUID as set a static value.
var viewId = "c83ee442-91d4-4b47-bb1b-92523c80e06b"; // Random GUID var entityName = "contact"; var displayName = "Filtered Contacts"; var fetchXml = "<fetch><entity name='contact' >................</entity></fetch>"; var layoutXml = "<grid name='resultset' object='1' jump='fullname' select='1' icon='1' preview='1'><row name='result' id='contactid'>......</row></grid>"; formContext.getControl(lookupFieldName).addCustomView(viewId, entityName, displayName, fetchXml, layoutXml, true);
Later in the development stage, we have to…