Archive for August, 2008

Custom fields in Custom workflow

By using custom workflow , i will make Auto-numbering in CRM 4.0 .

 

I have created a readonly field on Account entity” new_auto” to hold the “Guid” of

Account. As GUID is always unique , so there is no question about it being duplication. We can use prefix whatever we want.  As one can see AC- (GUID). I will use cutom workflow to obtain the GUID of entity when it is created and then update the entity with the prefix+ GUID.

 

 

 

 

 

using System;

using System.ComponentModel;

using System.ComponentModel.Design;

using System.Collections;

using System.Drawing;

using System.Workflow.ComponentModel.Compiler;

using System.Workflow.ComponentModel.Serialization;

using System.Workflow.ComponentModel;

using System.Workflow.ComponentModel.Design;

using System.Workflow.Runtime;

using System.Workflow.Activities;

using System.Workflow.Activities.Rules;

using Microsoft.Crm.Sdk;

using Microsoft.Crm.SdkTypeProxy;

using Microsoft.Crm.Workflow;

using Microsoft.Crm.Workflow.Activities;

using Microsoft.Crm.Sdk.Query;

 

namespace Number

{

      [CrmWorkflowActivity(“OneTest”, “AccountNumber”)]

 

    public partial class Activity1 : SequenceActivity

    {

 

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)

        {

 

 

            IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));

 

            IWorkflowContext context = contextService.Context;

 

      ICrmService crmService = context.CreateCrmService();

 

      WhoAmIRequest systemUserRequest = new WhoAmIRequest();

 

      WhoAmIResponse systemUser = (WhoAmIResponse)crmService.Execute(systemUserRequest);

 

      ColumnSet cols = new ColumnSet();

 //Getting the ID of entity which unqiue itself

 

      Guid guidID = new Guid(this.objectID.Value.ToString());

 

          // i am using “AC” before GUID.This field will hold the GUID of account

 

      string Number  = “AC-=” + guidID;

 

      TargetRetrieveAccount target = new TargetRetrieveAccount();

 

      target.EntityId = guidID;

      RetrieveRequest getAccount = new RetrieveRequest();

 

      getAccount.ReturnDynamicEntities = true;

 

      getAccount.Target = target;

 

      getAccount.ColumnSet = new AllColumns();

 

      RetrieveResponse retrieved = (RetrieveResponse)crmService.Execute(getAccount);

 

      DynamicEntity regardingAccount = (DynamicEntity)retrieved.BusinessEntity;

 //i am using custom field to hold the value of “GUID” .

 

      if (regardingAccount.Properties.Contains(“new_auto”))

      {

 

          regardingAccount.Properties[“new_auto”] = Number;

 

      }

 

      else

      {

 

          regardingAccount.Properties.Add(new StringProperty(“new_auto”, Number));

      }

 

         crmService.Update(regardingAccount);

 

     

           return ActivityExecutionStatus.Closed;

 

        }

 

 

        public static DependencyProperty objectIDProperty = DependencyProperty.Register(“objectID”, typeof(Lookup), typeof(Activity1));

 

 

 

        [CrmInput(” objectID”)]

 

       [CrmReferenceTarget(“account”)]

 

       // [CrmReferenceTarget(“automatic.crm.new_audit”)]

       // public.automatic.crm.Lookup

 

        public Lookup  objectID

        {

 

            get

            {

 

                return (Lookup)base.GetValue(objectIDProperty);

 

            }

 

            set

            {

 

                base.SetValue(objectIDProperty, value);

 

            }

        }

 

  }

}

Finally we need to publish the workflow using developer tool and then calling the assembly from workflow.

 

CRM 4.0 outlook client -Microsoft Visual c++ Runtime installation error

I recently got stucked in installtion of outlook client for a
customer.There was expection while installig Microsoft Visual c++ Runtime .

exception_Unknown (checkbase.cpp:ccheckBase:: Action:315)

error

error

 

 

 I tried with removing window XP SP 3 , re.installtion of .Netfrmaework version .

But finally i got success after installing .Net framework 3.5 .

Installation of MS CRM 4.0 on Citrix Presentation Server 4.0.

It is quite easy to install CRM 4.0 on Citrix presentation server 4.0 compare to CRM 3.0 but every user need to configure the outlook client for CRM 4.0 unlike CRM 3.0 (in CRM 3.0 we need to click on script to configure the CRM for every user profile).

Here  are  steps:

1 = Intsall the online version of CRM 4.0 through  “Add /remove” program on
citrix server and remember that they must not be any user on  the server.

2 = when you are finished installation then put the configuration wizard on the
desktop of each user via administrator profile .
3 =Every single user need to configure the profile by using configuration wizard.