Pages

Thursday, 27 June 2013

Copy Email description to case description when email convert to case

How to copy Email description to case description when email convert to case.

For this i have created a small workflow to get this result.

Please see below screenshot.




I have take this workflow on email entity and it will be fired if regarding field change in email. Because when we convert email to case, regarding filed will update automatically in email. so i took like this.

Just Update regarding case of email.

How to create custom entity in CRM 2011

Please follow below steps for create a custom entity in CRM 2011
1.       Navigate to Settings à Solutions. From here, select the appropriate solution you want to add your entity to. You can also create a new solution for your entity if you prefer.
2.       Inside of the selected solution, make sure you have selected components in the Navigation menu, click the New button, and the select Entity. You are presented with the information form for entering general entity settings.
3.       The first thing you need to do when creating an entity is to enter some general settings. Many of these settings can be changed later, but some can only be made when you initially create the entity, and others can be set after the initial entity creation but cannot be changed again after that. Before creating an entity, you should understand these limitations so you can plan an entity that will meet your long term needs.
4.       When you have completed entering your settings, click the save button. You can continue to customize the entity. Then publish all customizations.






Entity definition

The entity definition area includes a number of different important settings as follows:

·         Display Name / Plural Name: These two fields represent the name of the entity as it will appear in Dynamics CRM. In some contexts the plural name will be used, and in others the display name will be used. These values can be changed later if desired.
·         Name: This field is the name that the entity will be referred to if it is referenced within custom code including custom reports, JScript, or other programming code. This field cannot be changed after the entity has been saved for the first time.
·         Description: This field is an optional field with more information on how the entity will be used within Dynamics CRM. It is a best practice to enter text into description fields that documents how the entity will be used. By entering this documentation, you will make it easier to support your instance of Dynamics CRM in the future.
·         Ownership: This field determines who will own each record in the entity. Another way to think about ownership is to ask, “Who will be responsible for maintaining this record in Dynamics CRM?” This field plays an important part in defining security roles and in establishing views and charts of data. After you select a value for this setting and save the entity, you cannot change it. Options for this field are as follows:
·         User or Team: Select this option if every record in this entity will be “owned” by a user or by a team of users. For example, if you create an entity to track projects, then you will most likely want to use this setting because your projects will be assigned to an owner who is responsible for making sure that his or her projects are managed properly.
·         Organization: Select this option if records won’t be owned by any particular individual or team. For example, if you create an entity to track customer inventory, then you will most likely want to use this setting because this inventory will not be owned by a particular user (or team) in your business.

Wednesday, 26 June 2013

how to trigger a plug-in from jscript

I can tell you that the question of how to trigger a plug-in from jscript comes up pretty frequently.  Usually someone wants to just trigger the plug-in from a form event, but also sometimes people want to trigger the plug-in from a ribbon button.  Unfortunately, a lot of the replies usually say that it's not supported or not possible. I am happy to say that it is possible and that I have regularly used this workaround to achieve this and it even uses supported methodology.

The code examples I link to today will be for CRM 2011 but the basic methodology is the same for 4.0 also.


Description
Here is how this works:

1. First you need to create a new custom entity to act as a trigger entity, I'll often times even name this new custom entity "new_trigger{plugin name}"


2. Now you must register your plug-in (or several plug-ins) on the create or update messages for this new entity. (I usually prefer the create message for my registrations because a new record will be created which keeps a record or audit-trail of who manually executed your plug-in and when in the created by and created time-stamp attributes on the entity)


3.  You must create a jscript web resource that contains a function that performs a soap update or create call on the entity depending on which message you registered your plug-in on.


4.  Lastly you must add your web resource to your form and call your update or create jscript function on one of the exposed form events (OnLoad, OnSave, etc...).  You can also call your jscript function from ribbon button if you want.

I hope this helps!

Monday, 24 June 2013

set value in text field using javascript in crm 2011

How to set value in text field using javascript in crm 2011

function setValueOnload()
{
    Xrm.Page.data.entity.attributes.get("fax").setValue("FAX12345");
    Xrm.Page.data.entity.save();   
}
   (or)
function setValueOnload()
{
    Xrm.Page.getAttribute("fax").setValue("FAX12345");
    Xrm.Page.data.entity.save();
}