Monday, July 20, 2009

FetchXml Builder Tool

Friends,

Here is very nice to tool to develop the fetchXml in CRM 4.0. You can add this tool to your CRM arsenals.

I have developed complex fetchXml using James tool in which fetch xml retrieves attributes from multiple entities.

In below example "address1_name", "address1_latitude" are from Contact and "accountnumber" is from Account.

<fetch mapping='logical'>
<entity name='contact'>
<attribute name='address1_name'/>
<attribute name='address1_latitude'/>
<link-entity name='account' from='accountid' to='accountid' link-type='natural'>
<attribute name='accountnumber'/>
<attribute name='accountid'/>
</link-entity>
</entity>
</fetch>

Thursday, July 9, 2009

Programmatically Assign a Custom Role to CRM Users

When you create Custom entity, It is obvious to face this situation.
By default, Custom Entity Create, Read , Write and other privileges are set to system administrator role.
If you require to access this custom entity by users having roles other than System administrator then you would require to create a custom role and assign “Create, Read , Write” privilege to the newly created role. Then add the custom role to user roles. If there are 100’s of user then it would be difficult to assign the custom role manually.
Here is how you will assign custom or system roles programmatically.

1. Get the Root business Unit.
2. Create a Custom Role for Root business unit.
3. Assign Privilege to Custom role using AddPrivilegesRole Message
4. Custom role can be accessed across all child Business Units.
5. Retrieve All Users
6. Then Assign Newly created custom Role to All Users using AssignUserRolesRoleRequest message by looping through all users.

Here are few links to above messages

AddPrivilegesRole
http://technet.microsoft.com/en-us/library/cc151187.aspx
AssignUserRolesRoleRequest
http://msdn.microsoft.com/en-us/library/bb955917.aspx

Jai Ho Crm

Saturday, July 4, 2009

Change the Identity of CRM AppPool

Microsoft Dynamics CRM 4.0 website is run by Crm AppPool under the credential of Network Service. Sometimes we require changing the Identity of AppPool. Ronald Lemmen has written nice post on this.
It helped me so thought sharing it.
Here is how you can change the Identity of AppPool,
http://ronaldlemmen.blogspot.com/2009/04/change-crmapppool-identity.html
Jai Ho CRM

Amol

Friday, July 3, 2009

Bulk Delete in CRM 4.0

Many times we require deleting the multiple records in CRM. One way you can delete CRM records is by selecting records in grid and then deletes it. However CRM grid can display only 250 records per page. It would be difficult for user to delete bulk records let say 10000 using grid. CRM 4.0 has BulkDeleteRequest message which create system job to perform the bulk delete. Bulk delete is carried out by CRM async processing service and the status would be displayed in Data Managementà Bulk Record Deletion section. You can also specify reoccurring bulk delete job based on specific condition. You get code and other details from MSDN
Jai Ho CRM
Amol

Tuesday, June 30, 2009

CRM 4.0 VPC 2009: Access internet inside VPC and access CRM 4.0 from outside the VPC

Few features of Microsoft Dynamics CRM 4.0 VPC 2009
1. All the accelerator are preinstalled on VPC
2. It contains 2 VHD files 1 has all installed component and other is for extension purpose which can be used in future to add new software in VPC
3. It contains two local area network one has fixed IP and other can be used to access the internet inside VPC.
4. It can be closed in saved state quickly as well as it start faster than before.
How to use internet inside VPC.

As I mention earlier VPC has two Local Area Networks; connect the first the (one with Static Address) to Local Only and other to you Network adapter. Ref figure below














In Local Area Connection- I do not remove the IP address just remove the default gateway so for internet can be access using other Local Area Connection.
Now you should be able to access internet inside VPC. Ref figure below





















5. How to access CRM from outside the VPC
As Microsoft Dynamics CRM 4.0 and Default website is running on same port 80, so we require to stop Default Website to access crm from outside using server name or IP.
Add the port 80 to identities of web site. Ref figure below





















Now you can access the CRM using your Server IP address or

Friday, June 19, 2009

Change the Default View of Phone Call Activity

I saw post where developer want to display Contact First Name, Last Name and Phone Number on click on Activity link in workplace. So that user can generate phone call report and call the respective client. Here is how you can achieve this.

In order to have a custom view as per your requirement you have to modify the views of Phone entity itself.
When you want to display it, you should select the activity type = ‘Phone Call’ which will load the Phone Call in view dropdown list.

Now Add the required field in the views of Phone Call which being displayed in View Dropdown list.

How to Add fields in View. Let say you want to modify All Phone Calls view of View dropdown list.

Go to SettingsàCustomizationàCustomize Entitiesà PhoneCallà Forms and Viewsà All Phone CallsàAdd ColumnsàRecord Type(Drop down list)àRegarding(Contact)àSelect the require fields
Finally save and publish your changes.

You should be able to see your columns in “Action Type=Phone Call” and View=”All Phone Call”

Wednesday, June 17, 2009

Quote Process in Microsoft Dynamics CRM 4.0

I have seen few post on Forums, thought I would put some basics related to Quote process in CRM.
Quote is the estimate given to customer prior to any deal. There are different stages of quotes which I would explain you with few examples.
When Quote is create – Draft stage
When you have to send quote to customer, you need activate it and send to Customer – Activate Quote.
In the Activate stage quote won’t be available for edit. So how do I edit quote if my customer asked quote with some other material.
CRM has provided something called Revise Quote. This would allow you to edit revision quote. Now again you would Activate it to send it to customer.
Same cycle follows. Thus for every editing you have to revise the quote. Finally, Quote can be closed as Won or Lost.
First you have to close the quote with state revised
Here is code snippest for revising Quote:
quoteclose qc = new quoteclose();
qc.quoteid = new Lookup(EntityName.quote.ToString(), quoteid);
CloseQuoteRequest cqr = new CloseQuoteRequest();
cqr.QuoteClose = qc;
cqr.Status = 7;
CloseQuoteResponse resp = (CloseQuoteResponse)ConnectToCrm().Execute(cqr);
Then you can create a new revision
ReviseQuoteRequest rqr = new ReviseQuoteRequest();
rqr.QuoteId = quoteid;
rqr.ColumnSet = new AllColumns();
ReviseQuoteResponse rqresp = (ReviseQuoteResponse)ConnectToCrm().Execute(rqr);
quote quoteDraft = rqresp.BusinessEntity as quote;

This is short Quote Process, write me if you have further questions!

Regards,
Amol Gholap