Tuesday, February 28, 2012

To load records, click here in ms crm 2011. Sub-grid does not load automatically

If you have more than 4 sub-grids in a form u have inserted, CRM will automatically load the 1st 4 sub-grids and for the rest sub-grid it will not load, rather it will give a link "To load <entityname> records, click here."
This is because CRM takes care of the efficiency of the form to be loaded faster.
if you want to load the grids after 4th grid, then get the object of the sub-grid and force it to load.
Xrm.Page.ui.tabs.get('<TabName>').controls.get('<Subgrid_Name>').refresh().

hope this helps.

thanks,
yes.sudhanshu

Sunday, February 26, 2012

Create an Email Activity in Microsoft Dyanamics CRM 2011 Using C#

while doing so, i was just refering the "To" and "from" field on the email as general EntityReference.
While doing so, it will not throw any Exceptions, record will be created, but it will not assign the "To", "From" fields.

So EntityReferemce does not work here.
The logic is, we can have multiple values in To ( but dono why From is in same manner, even if From will have only one value always).
So it should be Array of EntityReferences.

So it uses "ActivityPointer" as follows...

Entity eActivityParty = new Entity("activityparty");
eActivityParty.Attributes.Add("partyid", new EntityReference("systemuser", "00000000-0000-0000-0000-000000000000"));
Entity[] aryFrom = { eActivityParty };
eEmail.Attributes.Add("from", aryFrom);


So, hope this will help anyone....

Tuesday, February 14, 2012

Different Services while installling MS CRM 2011

The followings are the different services installed and run after MS CRM 2011 installed


Service
Description
Microsoft Dynamics CRM Asynchronous Processing Service
Services asynchronous processes such as bulk e-mail and workflow.
Microsoft Dynamics CRM Asynchronous Processing Service (maintenance)(new in MS CRM 2011)
Services asynchronous maintenance such as encryption key generation for authentication and database deletion clean up.
Specifically, the service was invoking the provided stored procedure dbo.p_ReindexAll in "ScaleGroupOrganizationMaintenanceJob" table under "MSCRM_CONFIG" DB.
also workflow cleanup processes and also if you are registering the Plugins in "Asynch" then if you have selected "Delete Asynch if status=Successful" then it will be also deleted from db.
Microsoft Dynamics CRM Unzip Service(new in MS CRM 2011)
Handles the uncompressing of zipped files for data import. This service is installed as part of the Web Application Server role.
Microsoft Dynamics CRM Sandbox Processing Service(new in MS CRM 2011)
The Sandbox Processing Service server role enables an isolated environment to allow for the execution of custom code, such as plug-ins.

I was just looing for the role for
the Asynchronous(mentainance) service, what does it do?
so it does for the mentaincnae job like cleaning DB like Asynch data etc.

thanks,
yes.sudhanshu

Wednesday, February 8, 2012

Assign Workflow, plugin message in MS CRM 2011

One observation regarding to the Assign for workflow or plugin.

I want to do something on Assign of a record, may be workflow or plugin is d option.
Workflow
If its workflow, it fires while assigning, but not if assigning to myself.
Any reason why?
Plugin
This fires each time we assign a record even if its myself or other users.

Thanks,
yes.sudhanshu

Tuesday, February 7, 2012

Record Hyperlinks Available in MS CRM 2011 Workflows

Soemtimes we need to include the URL of the record in the workflow, while sending notification email or something like if a case is closed then send an email with the closed case record url.
or if an account is created then send the new account record url to some one etc.

So its now very simple after MS CRM 2011, 5 roll up.
As attached in the image, u will get the field in the SetProperties window of the entity in the workflow.
So this record will be as per the Entity you are creating the workflow.
If u r creatung the workflow against account , then the record will be the Account record URL.

SO this is good to get.

thanks,
yes.sudhanshu

Unhandled Exception: System.ServiceModel.Security.SecurityNegotiationException: SOAP security negotiation in MS CRM 2011, Plugin Registration tool

I got a weired exception while using and creating a connection in plugin registration tool.
this happens for online as well as for onpremise.
The exception is as follows...
---------------------------------------------------------------------------------------------------------------------------
Unhandled Exception: System.ServiceModel.Security.SecurityNegotiationException: SOAP security negotiation with 'http://xrm:5555/XRMServices/2011/Discovery.svc' for target 'http://xrm:5555/XRMServices/2011/Discovery.svc' failed. See inner exception for more details.

Server stack trace:
at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)


Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.Discovery.IDiscoveryService.Execute(DiscoveryRequest request)
at Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy.Execute(DiscoveryRequest request)
at PluginRegistrationTool.CrmConnection.RetrieveOrganizations() in C:\Users\Administrator\Desktop\MSCRM2011_SDK\tools\pluginregistration\CrmConnection.cs:line 315
at PluginRegistrationTool.ConnectionsForm.OpenConnection(CrmConnection con) in C:\Users\Administrator\Desktop\MSCRM2011_SDK\tools\pluginregistration\ConnectionsForm.cs:line 940
Inner Exception: System.ComponentModel.Win32Exception: Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity
'ADMINISTRATOR@mscrm.com'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server.
at System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)
at System.ServiceModel.Security.IssuanceTokenProviderBase`1.GetNextOutgoingMessage(Message incomingMessage, T negotiationState)
at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan
timeout)

---------------------------------------------------------------------------------------------------------------------------

Reason
The line of exception was from the "ConnectionsForm.cs" file of the pugin registration tool and the line of code was
"RetrieveOrganizationsResponse response = (RetrieveOrganizationsResponse)this.DiscoveryService.Execute(request); "
The password for the admin user was of length more than 15, characters :P
Shorten the password, then it will run smoothly.

Note: If the paswword is that much large, it does have impact on MS CRM access or any other sdk code uses or plugin code as well.

thanks,
yes.sudhanshu

Two Default Views for an entity in MS CRM 2011 or MS CRM 4.0

Suddenly i got two default views in my Activity Entity in MS CRM 2011.
May be it has happend while importing solution of 4.0 or what i am not sure about it.
This also happenes in MS CRM 4.0 as well.

Reason i did not know, but the solution is as follows.
Attached is the snap of the two Default views.
Two Default views will be having the same starred Icon.

Solution

1. Create a solution by taking your Entity only.
2. Export the solution and unzip it
3. open the Customization.xml file in VS studio
4. then search for the View in saved queries node tag
5. check <isdefault> value will be 1 there, so make it as 0. thats it
6. then zip the solution and import it, publish it and check. there will be one default public view

thanks
yes.sudhanshu

ms crm 2011 activity feeds

Release Preview Guide Q2 2012 Service Update for MS CRM 2011

couple of good and breaking things in MS CRM 2011 in Q2 2012 release.

1. MICROSOFT DYNAMICS CRM MOBILE
2. BROWSER FLEXIBILITY
3. RAPID VIEW FORMS
4. ENHANCED SOCIAL
5. CUSTOM WORKFLOW ACTIVITIES IN CRM ONLINE

URL : http://crmpublish.blob.core.windows.net/docs/ReleasePreviewGuide.pdf

thanks,
yes.sudhanshu

Sunday, February 5, 2012

Notes and Attachement Concept in MS CRM 2011

In MS CRM 2011, the notes and attachement concept is bit diffrent than MS CRM 4.0.
Initially while creating Enity, if we are not selecting Notes, latter we can select. But once selected , then we can not change it.
As in the
Now its added to form....

thanks
yes.sudhanshu

Thursday, February 2, 2012

Activity Architecture in MS CRM 2011

We all know that we can create custom Activities in MS CRM 2011.
The Structure of Activities has been changed in the DataBase side.

in 4.0 , we used to have the ActivityPartyBase and Activity PointerBase for holding the different type of Activities like Email, Phone call, Fax etc, alsoe it used to have EmailActivityBase and EmailExtensionBase for each activities.

But in MS CRM 2011, it has been changed.
here it has ActivityPartyBase and Activity PointerBase and also the Activity Bases only like EmailBase , FaxBase but no EmailExtensionBase and FaxExtensionBase.

ActivityPointerBase contains all the OTBattributes(fields) of all the OTB activity types ;ike Fax, Email etc.
Activity Bases like EmailBase, FaxBase just contains the ActivityId and also if u will create any custom attributes(fields).
Same way if you will create new Cutom Activities, then one Base table will be created in the database whcich contains only the ActivityId column and will contain other columns if its custom attributes(fields).

If any one has done any queries or SP or developed any custom pages with any queries which used to used the table in 4.0 way, things needs to be changed in 2011, if any one is upgrading from 4.0 to 2011.

Hope my observation will help someone.

thanks,
yes.sudhanshu

MSCRM_CONFIG.HardDelete and MSCRM_CONFIG.SiteWideCleanup SQL jobs MS CRM 2011

there are two jobs MSCRM_CONFIG.HardDelete and MSCRM_CONFIG.SiteWideCleanup in MS CRM 2011, in the Database sever under agent.
so need to worry , from where the jobs came and any threat etc.
These two are mainly for cleaning the Databases in intervals.
in MS CRM 4.0 we had concept like soft delete and the services were doing those jobs.
in MS CRM 2011 also it has to do clean the asynchronous jobs completed and some other tasks.
mainly the job calls the SP "p_HardDelete" under MSCRM_CONFIG database.
some times it used to give error, so for that just make sure that Agent is running.
else restart the Agent.

thanks,
yes.sudhanshu

Wednesday, February 1, 2012

attachment in ms crm 2011

Attachments are used in MS CRM for attaching files against any records.
also this is available in EMail.
im ms crm 4.0 everything was coming to annpotation except Email atachments.

in MS CRM 2011,
all the attachments comes to annotation table, where as the attachments for Email are coming to Attachment table .

just a catch.

thanks,
yes.sudhanshu