Model Driven PowerApps - dynamics-crm

I am developing a model driven Power App. I have an entity with a few person/group fields like "Updated By" and "Completed By". Is there a way for the App to recognize who is updating a record so that I can place that card into an MS Flow and send an email with the information of who updated the record? Or maybe fill out a field in the record itself of who last edited it?

Model driven Power App (aka Dynamics 365 CRM) stores the last modified person & timestamp by Out-of-the-box design in the modified record itself. You can use that in MS Flow - Dynamic content while sending out an email.
If you want to capture it in some additional field - you can do that also.

Related

Multiselect lookup field in Dynamics

Can I:
make manipulation with subgrid so I can choose multiple Contacts and save them in the field (or even better choose only the email address from the Contacts) or
make a lookup field to Contact that allows me to choose multiple contacts
Longer description of the problem:
I have made some customization of the Invoice entity in Dynamics Sales, but what I also need is an email failed that is a lookup to Contacts, so I can choose a multiple contacts, so later on I can get the email information and send them an email with power automate. But since I'm new to Dynamics I'm not sure how to manipulate with the subgrid, I researched something about creating N:N relationship, but I'm not sure how can I manipulate with on save/ on load events, cause I need to choose multiple contacts and save them in this field.
Customized Invoice Entity

Is it possible to extract data from the body of an outlook email and throw it in SQL automatically?

Situation: We get audit emails every morning. The body of the email contains a table with various columns. The column labelled 'ID' is the unique key for each row. I have to copy the data from the ID column, format it in note++, and then paste it in a pre-filled query in SQL were I run it.
Question: Is it possible to automate this process? if so, where could I start? I would be nice if I could have something that either runs automatically or manually, reads the email, extracts the data from the column, formats it, and throws it in a query and executes.
Additional Details: The emails are always from the same distro, fire at the same time every day, and the table columns are static.
My skill Level: Beginner but resourceful and eager to learn, so please don't crucify me if I am not clear.
Yes, it is possible. You can develop a VBA macro or a COM add-in if you need to distribute your solution on multiple machines. Basically you are interested in handling the NewMailEx event of the Application class which is fired when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem.
After retrieving the incoming item you can process it by getting property values and adding them to the SQL Db.
You may find the Walkthrough: Create your first VSTO Add-in for Outlook article helpful.

How to populate look up field based on text field - Dynamics 365

I am trying to populate contact field (Potential Customer) based on text field (Email Address) set. To bear in mind, it should be unique based on the customer record.
Condition is if Email address field is set, look up field (Potential Customer) value should be fetched based on the Email address field.
Wherever you are trying to fill that contact lookup from (plugin, form script, console job, web app, ETL, MS Flow, etc), you have to fetch the contact by filtering the email value and set it in lookup entity reference.
You can use web api or fetchxml to achieve that. Here is how it should look like.
https://crmdev.crm.dynamics.com/api/data/v9.0/contacts?$select=fullname&$filter=emailaddress1 eq 'test#gmail.com'
C# example
Javascript example
Once you fetch the lookup field based on email address using web api which is suggested by Arun. To set lookup field on form using javascript see below article.
https://xrmdynamicscrm.wordpress.com/2020/06/17/dynamics-crm-365-set-lookup-regarding-field-while-using-xrm-navigation-openform-formparameters/
Please mark my answer verified if i were helpful

How to programmatically set the subject (title) of an Outlook 365 meeting from user data entered at runtime

Background
Our Training team uses an Excel worksheet to track our online training, listing the date, customer, topic, type of training, type of meeting (Teams live event or Teams meeting), presenter, and moderator. In addition to the information in the worksheet, we create an Outlook 365 meeting for each workshop. The subject (title) of the Outlook meeting takes this format: {Customer} {Topic} {Event Type} {Meeting Type} {Start}.
Goals
Replace the Excel worksheet with an Outlook 365 view in table
layout, eliminating a time-consuming and redundant step in our process.
Minimize data entry.
Do 1 and 2 in such a way that I can distribute the solution to our Training team without involving a request to systems admins or requiring our team to do any heavy lifting code- or configuration-wise.
Problem
I've tried two methods and am getting stuck at the same spot: I can't figure out how to set the meeting request subject equal to the information entered by the user.
Progress
Method 1: Outlook form or template
I modified P.2 in an appointment request in Outlook 365 to be a data entry form for the custom fields Customer, Topic, EventType, MeetingType, Presenter, and Moderator. Another custom field, TrainingEvent, is a read-only Boolean set to Yes when the appointment is created. I use this field to filter non-training events out of the new calendar view. Another custom field, EventID, has an initial value that concatenates the other fields in the order we need for the meeting subject. I saved the modified request as both a form and an Outlook template to test each method.
Both work fine, right up to the point of setting the actual meeting subject equal to the EventID. That is, when I submit the request the meeting is created and all the fields are populated with what I entered. The subject remains empty. I can't find any guidance, using VBA or otherwise, on how to populate the subject based on user entry at runtime.
Method 2: Microsoft Forms + Automate
So I tried another way: I created a form in Microsoft Forms to collect the same data, then ran it through Microsoft Automate modifying an existing template that creates an Outlook 365 event when a form is submitted. Same result: The event is created with all my entered data, but the subject remains empty.
Obviously, I could just ask our team to enter all the separate fields and also the subject, but that defeats goal #2.
What am I missing? This feels like it should be such an easy problem to solve.
I found the answer. I added the Subject field to my custom P.2 (data entry form). In the field properties on the Value tab, I changed "Property to use" from Value to Text and set the initial value to the concatenated field EventID. Voila!

Query for Showing Specific Field Changes in Microsoft Dynamics CRM Entities

Is there a query that I can run on a Microsoft Dynamics CRM database (SQL Server) that will show me all the cases where a particular field was modified in all records of a particular entity in the CRM instance? I would like to see the "Old Value" and "New Values" values of the modified field. I have seen this done through the CRM Audit Log Summary page (i.e. https://social.microsoft.com/Forums/en-US/01b4318b-ec73-4eb2-9245-479f643cc58a/ms-dynamics-crm-audit-history-shows-icons-instead-of-values), but want to run a SQL query instead of go through the CRM UI to capture more info.
For example, I have an custom entity type called the "Car" entity type. There is a field in the Car entity called "Driver". How can I query the audits (auditing is enabled on the Car entity type in Dynamics CRM, btw) for all Car records so that I can display all Cars whose Driver has changed in a format with "Old Value" and "New Value" in the results?
I have queries the default CRM table 'AuditBase', but the only remotely relevant column in that table is 'ChangeData', which I cannot find any useful info in.
Can anyone help?
Thanks in advance.

Resources