Archive for the ‘Dynamic Online CRM’ Category

Auto Numbers in MSCRM

Thursday, May 1st, 2008 |

Last week I have been looking for the best approach to use auto numbers in Microsoft Dynamics CRM. After discussion with my peers I have come to the following possible options that can be used for auto numbering. Although these may not be the efficient techniques to get auto number work in CRM but they are all workable solutions.

Option 1:

Very simple, supported and mostly acceptable way of auto numbering is to read the attribute Max value and then add 1 to get next auto number. For example you have a custom entity named Project and you want to auto number Project_Ref_Number attribute.  But do not retrieve all records. Just retrieve the record with maximum number value by using following two properties of PageInfo Class in SDK and set descending order.

PageInfo.Count = 1;
PageInfo.PageNumber = 1;

One more consideration should be taken in account to register your auto number plugin to at PreCreate rather at PostCreate.

Issues:

In multi-user environment, this approach can come up with duplicate numbers in Project_Ref_Number when more than one user is creating project records.

Option 2:

This technique requires a bit more work but still supported way of doing things and all the time you will be getting 100% unique number.

You need to create a new table for project entity in a different database and not in CRM default database.

create table dbo.ProjectNumbers
(
 Project_Ref_Number int identity(1,1) primary key clustered,
 Projectid uniqueidentifier not null
)
go

Create a stored procedure for inserting a record into new database. This will increase the performance of your insert query.

create procedure dbo.proc_new_ProjectNumber

@ProjectId uniqueidentifier,

@Project_Ref_Number int output

as

insert into dbo.ProjectNumber

(

 ProjectId

)

values

(

 @ProjectId

)

select @Project_Ref_Number = scope_identity()

go

In your Plugin/Callout:

1.   Access you database using ADO.NET

2.   Execute stored procedure and get next number from returned results

3.   Set the value of the returned number to target entity attribute approperiatly.

4.   All Done

Issues:

1.   You have to setup database.

2.   You have to read and insert into external database.

Option 3:

This option used a lock mechanism on a text file placed somewhere at your webserver. You can create one file to store next number for all entities or you can create one file for each entity. In your Plugin/Callout:

1.   Put a lock on file.

2.   Read the file and read the number there.

3.   Update the number by adding 1.

4.   Release the lock.

5.   Use this number and set your target entity attribute appropriately.

string ProjectAutoNumber = “FilePath”

lock(this)

{

                                       

TextReader textReader = File.OpenText(ProjectAutoNumber);

AutoNumber = textReader.ReadLine();

textReader.Close();

AutoNumber = (long.Parse(AutoNumber) + 1).ToString();

TextWriter textWriter = File.CreateText(ProjectAutoNumber);

textWriter.WriteLine(AutoNumber);

textWriter.Close();

}

Issues:

1.   Resource locking

2.   File system Read/write cost

Although all these options work well but I am still looking for some more robust solution. Ideally I am looking for something like GUID. GUID’s are instantly available and 100% unique.

For your suggestions and improvements, please comment.

CRM Live - Now CRM Online

Thursday, April 10th, 2008 |

This move by Microsoft has been questioned by many partners and the community at large, but we feel it makes sense, given the naming scheme that is taking shape as part of the company’s Software+Services (S+S) push. Microsoft is attempting to categorize its services into one of three categories:

  • “Live” refers to consumer and very-low-end small-business offerings. Examples: Windows Live Messenger, Office Live Workspace.
  • “Online” refers to small-/mid-size and enterprise services that are hosted by Microsoft in its own datacenter. Examples: Exchange Online, SharePoint Online and now Dynamics CRM Online.
  • “Hosted services” refer to Microsoft offerings that are Partner hosted by its integration/reseller partners at the partners’ facilities. Examples: Exchange Hosted Services, CRM Hosted Services, and SharePoint Hosting Services.

Until now, Microsoft has been referring to the Microsoft-hosted version of its Dynamics CRM 4.0 product as Dynamics CRM Live. But given that Microsoft has made it plain that it is going to offer Microsoft-hosted versions of many of its business products to not just large, enterprise customers, but to SMBs, as well, the CRM Live name just didn’t make a lot of sense.

 We think the toughest part will be getting people to quite saying CRM Live and start saying CRM Online!

Workflow Enhancements in Dynamics CRM 4.0

Monday, December 10th, 2007 |

Microsoft Dynamics CRM 4.0 delivers a greatly improved workflow model. It caters to the needs of all users no matter if they are business users, implementers, partners or developers.

Business Users

The most important change to the workflow model in Microsoft Dynamics CRM 4.0 is the new web-based user interface. Business users no longer need access to the Microsoft Dynamics CRM server to create, modify, and monitor workflows. Instead, users can perform these actions on their own computers. Therefore, workflows are now much more visible and useful for Microsoft Dynamic CRM users. For example, if a user wants to create a workflow so that an email will be sent in case an opportunity is assigned to him, he can use the web interface and follow a few simple drag and drop steps to create this functionality.

Business users with adequate permission can participate in creating, running and monitoring workflows from the web based interface. This interface does not provide advance workflow capabilities like Stages, Workflow Templates and Dynamics Expressions. These advanced features can be used while creating more complex workflows like sales processes.

Partners/Implementers

Partners/Implementers can easily customize and upgrade to using the rich workflow model. The new model provides almost three times more record types and entities accessible to create a very powerful workflow in order to automate a complex business process.

Workflows can now be written that are triggered by update and delete events, in addition to the previously supported assign, create, and change status events. For example, it is possible to create a workflow that runs when the credit limit for an account is updated, or when a report is deleted. Similarly, a workflow can be triggered at multiple events. When selecting a triggering event, a user may choose more than one event. For example, a workflow can be created that runs if a contact record is created, updated, or deleted. Also, the list of triggering events can be changed after the workflow is created.

Dynamic values are another powerful feature available. For example, a workflow might include a step in which an e-mail is sent to a customer when that customer is entered into the system as a lead. The e-mail message might contain static text that is the same for every customer and dynamic values that insert the customer’s name and address based on attribute values in the lead record.

The Stages feature can facilitate implementers to encapsulate and compartmentalize business logic. Support for stages is increased by allowing Stages in any workflow, conditional statements, within stages, multiple concurrent processing on a single record, skipping of stages and exiting from the workflow.

Developers/Programmers

Developers and programmers can develop business horizontals and verticals by leveraging the Windows Workflow Foundations coupled with Visual Studio. With the adoption of the Windows Workflow Foundation, there have been some changes to the Microsoft Dynamics CRM workflow APIs. Therefore, a few of the old APIs have been deprecated. Developers have to evaluate existing code to see whether there is any effect on existing workflows.

Windows Workflow Foundation simplifies asynchronous programming for creating persistent workflow applications. The Windows Workflow Foundation runtime engine manages workflow execution and supports workflows that can remain active for extended periods of time. It preserves the state of workflow execution during computer shutdown and restart. Windows Workflow Foundation provides a rich development experience inside Visual Studio using the visual designer. This enables creating workflows graphically by dragging and dropping activities from the Toolbox onto the design surface.

Welcome

PowerObjects Microsoft CRM blog is place where PowerObjects CRM team will share its Microsoft CRM knowledge with rest of the world.More

Find entries :