Muhammad Ali Khan

MS CRM 3.0, MS CRM 4.0, Sharepoint 2007 & Sharepoint 2010

Archive for November, 2007

Using MS CRM 3.0 Lookup Form In Your Asp.Net Application

Posted by Ali Khan on November 28, 2007

In this post, I am going to show you how to use the MS CRM 3.0 Lookup form in your application.

So first, here how the MS CRM 3.0 Lookup form looks like

lookup.jpg

Now with only few lines of javascript code you will be able to use this form in your application.

 so here is the sample javascript code J <html>
<head>
    <script language=”javascript”>
        function LookupArgsClass()
        {
            this.items = null;
        }
       
        function openWindow()
        {
            //debugger;
            //var sPath=’_controls/lookup/lookupsingle.aspx?class=null&objecttypes=2&browse=0&DefaultType=0′;
            var sPath=’/_controls/lookup/lookupsingle.aspx?class=ActivityRegarding&objecttypes=1,2,3,4,112,1010,1084,1088&browse=0&DefaultType=2′
            var args = new LookupArgsClass();
            args.items = document.getElementsByTagName(“SPAN”);
            var sCustomWinParams = “dialogWidth:600px0px;dialogHeight:488px0px;dialogLeft=0px;dialogTop=0px;help:0;status:0;scroll:0;center:1;resizable:yes;”
            var abc = window.showModalDialog(sPath,args,sCustomWinParams);
            alert(abc);
        }
    </script>
</head>
<body>
    <input type=”button” onclick=”openWindow()” value=”Click here…”/>
</body>
</html>

 In my other post i am going to show you how to create a lookup like MS CRM 3.0 in your own asp.net application

Posted in MS CRM 3.0 | 2 Comments »

Reterive Mutliple Dynamic Entity Using Attribute Other than ID

Posted by Ali Khan on November 22, 2007

A lot of examples related to DynamicEntity uses either Create, Update or Retrieve (Single). What I was looking for was to retrieved multiple Dynamic Entity but searching on other attributes other than ID, but with no success

So I decided to write it myself J

Here is the sample code of my finding:-

            CrmService service = new CrmService();
            service.Credentials = System.Net.CredentialCache.DefaultCredentials;

            QueryByAttribute query = new QueryByAttribute();
            query.ColumnSet = new AllColumns();
            query.EntityName = “account”;  // please mention your entity name here

            query.Attributes = new string[] { “name” };   // your attribute here.
            query.Values = new string[] { “geopaq” };    // your attribute value here.

            RetrieveMultipleRequest retrieve = new RetrieveMultipleRequest();
            retrieve.ReturnDynamicEntities = true;
            retrieve.Query = query;

            RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(retrieve);
            foreach (DynamicEntity entity in response.BusinessEntityCollection.BusinessEntities)
            {
                Console.WriteLine(“Entity name=” + entity.Name);
                foreach (Property property in entity.Properties)
                {
                    if (property is CrmBooleanProperty)
                    {
                        CrmBooleanProperty bProperty = property as CrmBooleanProperty;
                        Console.WriteLine(“Property Name=” + bProperty.Name + “value=” + bProperty.Value.Value);
                    }
                    else if (property is CrmDateTimeProperty)
                    {
                        CrmDateTimeProperty dateTimeProperty = property as CrmDateTimeProperty;
                        Console.WriteLine(“Property    Name=” + dateTimeProperty.Name + “value=” + dateTimeProperty.Value.Value.ToString());
                    }
                    else
                    {
                        // similarly put other if statements for other properties here…
                    }
                }
            }

Posted in MS CRM 3.0 | Leave a Comment »

Creating & Using Workflow (Part 1) using MS CRM 4.0 Web client

Posted by Ali Khan on November 22, 2007

 Creating & Using Workflow (Part 1) using MS CRM 4.0 Web client

Note : Download this screencast, change the file extension from ppt to rar and extract using  winrar

 https://malikhan.files.wordpress.com/2007/11/creating-using-workflow-part-1-using-ms-crm-40-web-client.ppt

Posted in MS CRM 4.0 | Leave a Comment »