Dynamics mapping - dynamics-365

I have a requirement, Entity A -> I have a lookup field through which i can create New Record for three other entities. When I search Test in lookup field and click New Record, it opens a quick create form and I enter the details and save the record. The issue is, whatever i enter in lookup field it should show in first name field og the quick create form. I know i need to do data mapping. I tried it didnt work. Also I couldnt see the Mapping Tab in the Solution Explorer.
How could i achieve this???

I understand its a default dynamics behaviour that when i search and get opened the quick create form. the searched data is getting pre populated in lastname field, where the lastname cannot be empty so the reason.

Related

Add a sub grid and view for field update

I have added a field to the Contact entity called Website Downloads. This field is updated every time a client clicks on our website but what I want to do is have a sub grid within the Contact form that shows what this entry is each time it's updated. Then I ideally need this in a view with the contacts name and a list of the downloads so I can do an advanced find on the field. Any ideas please. PS I have tried to add a new entity that links to this field but the problem is you cannot do an OR on an Advanced find for 2 separate entities so back to square one.
Already tried a new entity but this won't work as you cannot do an OR on an Advanced Find for 2 entities.
I think you are on right track. You need a related entity to capture all the website hits, then you need a rollup field on contact record to sum up the hits.
So the associated records can be listed in a subgrid on contact form, also Advanced find queries can be done.
Rollup field can be an OOB field but it has timely job to calculate, if you want immediate rollup result it can be a custom field & plugin to accumulate.

How to undelete a field in MSCRM entities

I am trying to add a field to my entity call abc_salespersonname when I try to add it I am presented with duplicate field name.
The field does not show in the solutions entity field list but I can see it in the database.
I do know that when you delete a field from an entity, it does not actually delete from the database.
So my question is, how can I bring this field in the database back onto the entity.
You cannot Undelete any field in a supported way. Once deleted is deleted, gone forever.
Not sure, if you are mixed up with “Remove” & “Delete” options within solution sub-components. Atleast “Publish All Customizations” will make all the database schema, Metadata & UI in sync. Verify the default solution by going to Settings->Customizations->Customize the system to double check.
If you are seeing duplicate field name alert, then you cannot bypass it. Create a new field with different name & move forward.

Show Order ID in Dynamics CRM Order Look up instead of Order Name

In Dynamics CRM 2016 (on-prem), I've custom child entity Partiesthat have a look of type order. Currently it is working properly and it is showing order name but I want it to show Order ID.
I tried to resolve by creating my own view, adding order id field only and making it default view for the look up but it don't meet my requirements.
This is controlled by the lookup view for Orders. The first three fields in the lookup view are shown when selecting records from the lookup field.
You cannot change the position of (or remove) the Name field from the lookup view. That still leaves you with two additional fields to be shown, one of which could be the Order ID.
I know no supported ways around this (except creating a workflow to copy the Order ID to the Name field and adding a custom name field instead, if you really insist).
Changing what appears on the form after you make a selection in a lookup field is not possible, unfortunately. The primary attribute is always what gets displayed after a user specifies a lookup value (which, for the Order entity, is the Name attribute). As Henrik's answer mentions, people commonly get around this by copying the value they want to see into the primary attribute using a workflow or a plugin.

Getting Document Collection in Lotus Notes using the Form UNID

I have the UNID of a Lotus Notes form. can i use this UNID to get the Document Collection of that form ??
I am using the NotesDatabase.Search() method to get the document collection. But this query only works if it is provided with the Form Name. Does not works works with the Form UNID.
I am trying to do this because in my application there are two forms with the same name and Alias name.
Short answer: This is NOT possible.
Documents are linked to the Form via their own Form- item. This is a textitem and contains the alias of the form they were created with. There is NO further relation between the form that was "really" used when creating a document. As soon as you create another Form with that alias and delete the old one, all documents will use the new one. As long as there are 2 forms with the same alias, one of them will be used by chance (usually the one with the smaller NoteID will be used, but this can not be guaranteed).
If your question is to find out, which documents where created with which of the forms the only possibility is to select them according to special fields in the forms. If e.g. one form has an item "CreatedDate" and the other does not, then you could select #IsAvailable( CreatedDate )
Unfortunately if you open a document that was created with the "old" form and save it, it will also have the new item... So this will never be a 100% solution.
To make it even harder: One could create a document using LotusScript and in the end just fill the Form- item: doc.Form = "SomeForm". Then the document was not created with either of your two forms...

MS CRM - getting the field that caused a form save

I have a MS CRM 4 form where when certain fields are changed, I need those fields to be written to an excel sheet.
So, I edited the form field onchange event to call crmform.save() which triggers a plugin to run that writes the field value to a named range (1 cell) of an excel sheet.
However, I don't know which field caused the save. Is there a way to get that information? (Not all fields on the form need to go to the excel sheet)
If I use this: DynamicEntity target = (DynamicEntity)Context.InputParameters[ParameterName.Target];
I can look at specific fields, but I have no way of knowing which ones changed.
Any suggestions?
It's my experience that only the changed fields will have value (in the DynamicEntity) when you update an entity. So let's say you have an entity with a FirstName and Lastname. If you only change the LastName and save. The LastName will have a value however FirstName with be null (unless you have som javascript code that forces the FirstName to be submitted).
If your plugin is triggered on the Pre-Event of the Update on your entity, you should be able to compare the IPluginExecutionContext.PreEntityImages to your DynamicEntity that you've fetched from the Target.
Or if your plugin is triggered on the Post-Event of the Update, you should be able to compare the IPluginExecutionContext.PreEntityImages with IPluginExecutionContext.PostEntityImages.
Looks like you are already going a different way, but another suggestion is to create a hidden field - "FieldThatChanged." In your field on-change javascript, set that field to the name of the field that changed, then access that in your plugin.
Yep, totally changed the way I approached this. I'm using jquery in an iframe to pass all the exact fields (name/value pairs) I want to a method of an ASPX file running in the ISV folder that takes the neccesary action. Thanks for the suggestions all!
I recommend using the Pre and Post Images as suggested by #Forgotten Semicolon. And in addition set the Filtering Attributes so the Plugin is triggered only on the change of the fields you care about.

Resources