Understanding pipeline in CRM 4.0


Different stages in the event execution pipeline introduced in CRM 4.0.

Stage #1

•Pre-Operation – This is where custom logic can be registered to execute before the platform operation occurs. Logic that runs in this stage can stop further execution of the pipeline as we will discuss more in the plug-in chapters. Custom logic that runs in this stage is not part of the platform transaction.

Stage #2
•Pre-Operation – System – This stage is reserved as a pre-operation stage for system internal processing. Operations that occur as part of this stage are part of the Platform Transaction.You can’t register your own custom logic to run during this stage.

Stage #3
•Platform Operation – This is where the real work happens. The request/event that caused us to be in the pipeline is processed here and reflected on the state of the system. This stage is also part of the Platform Transaction. You can’t register your own custom logic to run during this stage.

Stage #4
•Post-Operation-System -This stage is also reserved as a post-operation stage for system internal processing. Operations that occur as part of this stage are part of the Platform Transaction. You can’t register your own custom logic to run during this stage.

Stage #5

•Post-Operation -This is where custom logic can be registered to execute. Custom logic in this stage can be either synchronous or asynchronous. Asynchronous logic will be handed off for processing by the Asynchronous Service queue. Custom logic that runs in this stage is not part of the platform transaction.

For better understanding of pipeline check out this wonderful article

http://crmscape.blogspot.com/2009/02/ms-crm-40-plug-in-stages-pipelines-and.html

Bye..

0x80044150 Generic SQL error. Platform : Server was unable to process the request in CRM


Hi,

I got this error while using CrmService from an web application.

Later i found that Crm Asynchronous Service(client)  was not running, so starting it solved the issue.

Just thought of sharing that !

Bye..

Hiding form assistant in CRM


Hi,

We could use the following script to hide the form assistant in Crm , we would use it in the form load event

document.getElementById(‘RelatedInformationPane’).style.display=’none’;

// ToggleInformationPane() to toggle the form assistant pane

document.all.RelatedInformationPane.ToggleInformationPane();

For CRM 4.0, go to customization ->customize entities-> select your entity–> select form properties->select Display tab and uncheck enable form assistant check box !!

Bye..

Cancel delete using PreDelete callout.


Just an example of using PreDelete callout !!!

public override PreCalloutReturnValue PreDelete(CalloutUserContext userContext,
   CalloutEntityContext entityContext,
   ref string errorMessage)
  {
   
   // Use retrive to get the status value
   CrmService service=new CrmService();
   service.CallerIdValue=new CallerId();
   service.CallerIdValue.CallerGuid=userContext.UserId;
   service.Credentials=System.Net.CredentialCache.DefaultCredentials;

   // Get status value
   ColumnSet cols=new ColumnSet();
   cols.Attributes=new String[]{“statuscode”};

   BusinessEntity busEntity= service.Retrieve(EntityName.salesorder.ToString(),entityContext.InstanceId,cols);

   salesorder poOrder=(salesorder)busEntity;
   // check for PO status value
   string poStatusValue=poOrder.statuscode.Value.ToString();

   // if status is found cancel the event and show error message
   if(poStatusValue==1)
   {
    errorMessage = “Aborting delete : Record cannot be deleted !”;
    return PreCalloutReturnValue.Abort;
   }
   
   return PreCalloutReturnValue.Continue;
  }

 Bye…

Body OnLoad function in content page in ASP.NET


Hi,

I wanted to certain script to run in the onload of the body for my content page.

To do this we need to do the following

Add an id and runat attribute to the body tag in the MASTER page

<body id=”body” runat=”server”>

And in the Content page’s  page load handler

protected void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl body = this.Master.FindControl(“body”) as HtmlGenericControl;
body.Attributes.Add(“onLoad”, “alert(‘Hello World’);”);
}

Bye…

Server Application Unavailable in ASP.NET 2.0


Hi,

I was getting this error when trying to open a asp.net 2.0 page.

However other applications developed in asp.net 1.1 were running fine.

Then realized that both of them were using the same Application Pool, so created a new application pool and assigned this new application pool to my asp.net 2.0 application.

That solved the issue.

“An application pool is a process that responds to web requests under IIS. An application pool does not have a setting for what type of ASP.Net applications will be run in it. Instead, it loads the appropriate libraries when an ASP.Net application is loaded in the process. Because the libraries for ASP.Net 1.1 and ASP.Net 2.0 are similar, but not the same, the application pool cannot respond to requests for both types of applications at the same time. This can cause sporadic behavior if you are using the server at the same time as another developer and you have applications using different versions of the framework in the same application pool”

Bye..

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓