Wednesday, January 29, 2014

Calling the workflow Exceptionally in MSCRM

By Passing the guid of the workflow in a special request called ExecuteWorkflowRequest we can fire the workflow. ExecuteWorkflowRequest request = new ExecuteWorkflowRequest(); request.WorkflowId = new Guid("12DEA8BC-86D2-4909-BB79-35A41D097CA1"); request.EntityId = new Guid("12DE4909-BB79-A8BC-86D2-35A41D097CA1"); ExecuteWorkflowResponse response = (ExecuteWorkflowResponse)ser.Execute(request);

Thursday, January 2, 2014

Create a Phone Call Record using SDK in CRM 2011

The main issue you will face in this case is assigning 'to' value to phonecall. When we try to assign a record to a phone call we will face the issues. the below code will helps us to create phone cal record and assign it. //first create the activityparty type object like activityparty toActivity = new activityparty(); //Then assign partyid toActivity.partyid = new Lookup("contact", contactID); //Assign that activitypartyobject to 'to' of phone call. phncall.to = new activityparty[] { toActivity };

Friday, December 27, 2013

Sharepoint Security Prompt after configuring Sharepoint in CRM 2011

We will get this Script Error: Access is denied to the crmmenu.htc.
This is an IE configuration issue: besides adding the sharepoint site to the Trusted Sites, we need to enable one thing: Tool->Internet Options->Security->Trusted Sites -> Custom Level->Miscellaneous->Enable "Allow script-initiated windows without size or position constraints." Thanks.

Wednesday, December 4, 2013

Creating an Email Activity using SDK in CRM 2011

This below codewill fire the email activity in CRM from C#. SendEmailRequest sendEmlReq = new SendEmailRequest(); //guid of the email which is to be send. sendEmlReq.EmailId = emlID; sendEmlReq.TrackingToken = ""; //IssueSend must be marked as true. sendEmlReq.IssueSend = true; service.Execute(sendEmlReq)

Monday, December 2, 2013

Help Menu Unavailable in CRM 2011 after configuring IFD

When we upgraded to CRM 2011 and configured IFD, when we click= on the Help Button, You can see the Following page.
The work around is * please perform the database backup and perform the steps below: Use MSCRM_CONFIG select helpserverurl from configsettings Use MSCRM_CONFIG Update configsettings Set helpserverurl = ” IISRESET

Saturday, October 26, 2013

Open Popup window in CRM 2011

There is default OOb function to Open a new window in CRM 2011. This is a part of the CRM Jscript implementation that will check to determine if the user is using Outlook or Internet Explorer, and open the new window in the appropriate format. function openNewWindow(url) { var name = "newWindow"; var width = 800; var height = 600; var newWindowFeatures = "status=1"; var oldWindowFeatures = "width=800,height=600,status=1"; // Regular Jscript function to open a new window //window.open(url, name, oldWindowFeatures); // CRM function to open a new window openStdWin(url, name, width, height, newWindowFeatures); // CRM function to open a new window // with default CRM parameters //openStdWin(url, name); }

Thursday, September 5, 2013

Retrive CRM 2011 Optionset Values using C#

private string GetOptionsSetTextOnValue(IOrganizationService service, string entityName, string attributeName, int selectedValue) {

RetrieveAttributeRequest retrieveAttributeRequest = new
RetrieveAttributeRequest {

EntityLogicalName = entityName,
LogicalName = attributeName,
RetrieveAsIfPublished = true
};
// Execute the request.
RetrieveAttributeResponse retrieveAttributeResponse =(RetrieveAttributeResponse) service.Execute(retrieveAttributeRequest);
// Access the retrieved attribute.

Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata retrievedPicklistAttributeMetadata =(Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata)

retrieveAttributeResponse.AttributeMetadata;// Get the current options list for the retrieved attribute.
OptionMetadata[] optionList =retrievedPicklistAttributeMetadata.OptionSet.Options.ToArray();
string selectedOptionLabel = string.Empty;
foreach (OptionMetadata oMD in optionList) {
if (oMD.Value == selectedValue){selectedOptionLabel = oMD.Label.UserLocalizedLabel.Label;
}
}
return select