Friday, March 2, 2012

Enable SharePoint Designer for Project Web App PWA 2010

Hello,

If you try to Open Project Server 2010 Site in SharePoint Designer you will receive the message:

“Web Site Editing is Disabled. This web site has been configured to disallow editing with SharePoint Designer. Contact your web site administrator for more information.”

To Resolve this you just need to remove the DisableWebDesignFeatures="wdfopensite" from the ONET.XML File.

But be sure that you are removing in the right site.

1) On the server, open Windows Explorer and browse to the folder that contains the site definition:
<Drive:>
\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates\<site_type> \XML


Remember to take a copy of the Onet.xml before the changes in case something bad happens and restart the IIS then,

 Best regards

Install and configure Project Server 2010

Wednesday, October 26, 2011

Microsoft Outlook is not set as the default mail client?


While installing CRM Outlook, it gives a strange error:"Microsoft Outlook is not set as the default mail client. Please set Microsoft Outlook as the default mail client from Control Panel\Internet Options\Programs, and then re-run the check."

I'm sure the Outlook is my default mail client, just in case I reset it again. but the error still exist! I'm aware of CRM always query Registry to get information in such cases, so open the default application key: HKLM\SOFTWARE\Clients\Mail, the Default value is Windows Live Mail, so change it to Microsoft Outlook, the error gone!



Thursday, July 28, 2011

5 syntax changes in Dynamics CRM 2011 plugins

There are number of changes between Dynamics CRM 2011 SDK and CRM 4 SDK. Let’s take a look at what has changed between plugins.
1. The IPlugin now resides in Microsoft.Xrm.Sdk namespace instead of Microsoft.Crm.Sdk
public class ClassName : Microsoft.Crm.Sdk.IPluginpublic class ClassName : Microsoft.Xrm.Sdk.IPlugin



2. The Execute method signature of the IPlugin interface has changed, it now expects an IServiceProvider instead of the IPluginExecutionContext.
public void Execute(IPluginExecutionContext context)
public void Execute(IServiceProvider serviceProvider)


3. To get a reference to the IPluginExecutionContext you now need to call the GetService method of the IServiceProvider interface.
public void Execute(IPluginExecutionContext context)
Microsoft.Xrm.Sdk.IPluginExecutionContext context =(Microsoft.Xrm.Sdk.IPluginExecutionContext)
    serviceProvider.GetService(typeof(Microsoft.Xrm.Sdk.IPluginExecutionContext));


4. ICrmService has been changed to IOrganizationService.
ICrmService sdk = context.CreateCrmService(true);
IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService sdk = factory.CreateOrganizationService(context.UserId);


5. DynamicEntity has been changed to Entity.    ·         Properties property of DynamicEntity no longer exists    ·         Getting and Setting values no longer use *Property classes,
      eg: no more KeyProperty, StringProperty…etc, simply do int value = (int)entity[“schema_name”];
if (context.InputParameters.Properties.Contains("Target") &&
    context.InputParameters.Properties["Target"is DynamicEntity)
if (context.InputParameters.Contains("Target") &&
    context.InputParameters["Target"is Entity)

 

List of changes : Type mapping between CRM 4.0 and CRM 2011

In Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online, the programming model has been changed to use native .NET types whenever possible. A beautiful post from Resultondemand explains it all, with all credit to their great job the excerpts of the post is :
Type Mapping Between Versions
The following table shows the mapping between the defined type for an entity attribute, the type that is used in a record, and the type that was used in Microsoft DynamicsCRM4.0.
Attribute Type Microsoft Dynamics CRM 2011 Type Microsoft DynamicsCRM4.0 Type
AttributeTypeCode.Booleanbool or System.BooleanCrmBoolean
AttributeType.CalendarRulesEntityCollectionDynamicEntity[] or calendarrule[]
AttributeType.CustomerEntityReferenceCustomer
AttributeType.DateTimeSystem.DateTimeCrmDateTime
AttributeType.Decimaldecimal or System.DecimalCrmDecimal
AttributeType.Doubledouble or System.DoubleCrmFloat
AttributeType.Integerint or System.IntegerCrmNumber
AttributeType.
Internal
System.Object
Not used in records.
Not used in records.
AttributeType.LookupEntityReferenceLookup
AttributeType.Memostring or System.StringSystem.String
AttributeType.MoneyMoneyCrmMoney
AttributeType.OwnerEntityReferenceOwner
AttributeType.PartyListEntityCollection or ActivityParty[]activityparty[] or DynamicEntity []
AttributeType.PicklistOptionSetValuePicklist
AttributeType.PrimaryKeySystem.GuidKey
AttributeType.StringSystem.StringSystem.String
AttributeType.StateOptionSetValue or enumeration generated for the entity stateEntityNameStateInfo
AttributeType.StatusOptionSetValue orintStatus
AttributeType.UniqueidentifierSystem.GuidUniqueIdentifier
AttributeType.VirtualSystem.Object
Not used in records.
Not used in records.
Other Type Changes
Old Type New Type
CrmAttributeType Class (MetadataService)Microsoft.Xrm.Sdk.Metadata.AttributeTypeCode
Moniker Class (CrmService)Microsoft.Xrm.Sdk.EntityReference
SecurityPrincipal Class (CrmService)Microsoft.Xrm.Sdk.EntityReference
Happy Coding Smile

Sunday, July 17, 2011

Using CRM 2011 Service to Create Record from Code C# - IOrganizationService

// sample to test the method   
private void CreateAccount(string AccountName)
    {
        IOrganizationService _service = GetCRMService("http://<ServerName>:<PortNumber>", "<UserName>", "<Password>", "<Domain>");
        try
        {
            Entity account = new Entity("account");
            account["name"] = AccountName;
            _service.Create(account);
        }
        catch (Exception ex)
        {
            throw;
        }
    }

// GetCRMService   
    public static IOrganizationService GetCRMService(string ServerURL, string UserName, string Password, string DomainName)
    {
        ClientCredentials credentials = new ClientCredentials();
        credentials.Windows.ClientCredential = new System.Net.NetworkCredential(UserName, Password, DomainName);
        Uri organizationUri = new Uri(ServerURL + "/<OrgName>/XRMServices/2011/Organization.svc");
        Uri homeRealmUri = null;
        OrganizationServiceProxy orgService = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);
        IOrganizationService _service = (IOrganizationService)orgService;
        return _service;
    }

Wednesday, June 29, 2011

SharePoint 2010: Add button to Ribbon with SharePoint designer

Sometimes you may need to add buttons to SharePoint 2010 ribbon. You can take one of two approaches: You can write code to add the button. Another approach is to use SharePoint Designer to add button to Ribbon. Today I’ll show you how to add button to Ribbon using SharePoint Designer. However, when you’ll use SharePoint Designer to add button to Ribbon and if you do  so in Development or Staging server, then think about how to do the same in Production server.

Add Button to List/Library forms (AllItems.aspx, DispForm.aspx, EditForm.aspx, NewForm.aspx)

Let’s say you have a list and you want to add a new Ribbon button in the AllItems.aspx page.
1. First open the site in SharePoint Designer.
2. Then click “List and Libraries” link from the left-hand menu and then click the target list from the details page on the right hand side as shown below:
image
Figure 1: Select List/Libraries in SharePoint Designer

3. Once you click the list name you’ll be landed to the list/library settings page. In this page you can edit four forms (AllItems.aspx, DispForm.aspx, EditForm.aspx and NewForm.aspx) and you can add button to the page’s ribbon. The page is shown below:
image
Figure 2: Four built-in Forms

4. From the ‘List Settings’ tab on the top, select ‘Custom Action’ as shown below:
image
Figure 3: Add custom Action

5. Say you want to add button to ‘NewFom.aspx’. For this click ‘New Form Ribbon’ from the Custom Action. You’ll get the ‘Create Custom Action’ window where you can add custom action to the Ribbon. From the window below you can chose one of three different actions: Navigate to form, Initiate workflow, Navigate to Url. If you need more custom action then SharePoint Designer will not be helpful. You need to write code to extend Ribbon button actions.
image
Figure 4: Custom Action Properties



Find Ribbon Location:

In the List/Library form, the button are placed in groups. As shown in the image below, the new form has three sections:
image
Figure 5: Buttons are placed in Groups/Sections in form
Now you may want to place your button in a particular group and for that you need know the location id so that you can put the id in the ‘Ribbon Location’ in the custom action properties in SharePoint Designer. Using Firebug extension of Mozilla Firefox, I have found the ribbon location id as shown below:
image
Figure 6: Ribbon group/section id (detected using Firebug extension of Firefox)
So now you can put the ribbon location id in the custom action properties. For example to put the ‘Show Me’ button in the ‘Commit’ section I have put the ribbon button location to ‘Ribbon.ListForm.Edit.Commit.Controls._children’. Here the ‘.Controls._children’ is added to the ribbon id. The following figure show two windows side by side:
image
Figure 7: Custom Action windows (On Left) and New Item Form (On right) with ‘Show Me’ button


Decide when to show the Ribbon Button

Sometimes you don’t want to show the button for all users. Rather you want to show for users having a set of permissions. The ‘Rights mask’ option allow us to meet this requirements. The available values can be found on MSDN. You can put more than one values in the Rights Mask text box separated by semicolons as shown below:
image
Figure 8: Rights mask


Source: http://ranaictiu-technicalblog.blogspot.com/2010/06/sharepoint-2010-add-button-to-ribbon.html