Showing posts with label crm 2011. Show all posts
Showing posts with label crm 2011. Show all posts

Thursday, June 6, 2013

More to maximizing real estate entity forms

In extension to one of our previous blog, this blog would add more to maximize the real estate on entity forms as well.


If you want to hide the left navigation pane from any of entity form as shown in below screenshot follow below mentioned steps:





1. Click the Form Properties of respective entity form


2. Go to Display tab


3. Uncheck Show navigation items option
 
 


4. Then save and publish your changes


This will give you more real estate on any of your entity forms.


Hope this article helps!

Monday, May 27, 2013

Directions and Routing multiple way-points feature of Maplytics


This blog illustrates the Get Direction and Get Route feature of Maplytics. This is important feature to calculate the route(Direction) of selected address.

Direction: Selecting this option from a particular plotted pushpin, you will get you the driving directions to the selected address from the starting point provided in the Current Location text box.





 

Once clicked on Direction you will see the direction between two address along including visual representation.




The table at the top lists the addresses that you have included when determining the directions from the first address in the list to the last one in the list. You can use the Up/Down buttons to change the waypoints in the directions.

Del button can be used to remove an address from the way point list.

Get Direction button will get the directions as well as update route on the map for the waypoints indicated in the table.

Using the Print button you can print the Directions as well as the adjoining Map.

Add to Route: This option can be selected when you would like to define the waypoints for your route to get the directions for. If you would like to meet multiple customers on the way, you could add each of these records as Waypoints to the table.




The Get Route button would then get the directions that join all the waypoints selected.





For further details on Maplytics you can visit our website http://www.inogic.com/addons_maplytics.htm or you can contact us on crm@inogic.com for more information or trial requests.



Wednesday, May 8, 2013

Problem Importing UR12 customizations with Web Resources added in a Pre-UR12 environment

With UR12 Microsoft included new fields and dependencies that prevents us from importing a solution exported out of a UR12/Polaris environment to a Pre-UR12 organization. To resolve CRM Team now ships the Down-level utility along with the latest version of the CRM SDK.

We however came across an issue that was apparently not detected by the Down-level tool and had to be resolved manually by editing the customization file.
The situation here was that we had added a web resource on the account entity form. In the latest version the properties window has the following option




  The feature was missing in the earlier version of the install. When you import this solution to an earlier UR, you see the following error



 When we downloaded the log file we found the cause of the error as stated below.


The import file is invalid. XSD validation failed with the following error: 'The element 'parameters' has invalid child element 'ShowInROF'. List of possible elements expected: 'Url, PassParameters, Security, Scrolling, Border, Preload, IsPassword, Height, Width, AltText, SizeType, HorizontalAlignment, VerticalAlignment, Data'.'.


< < < < < ERROR LOCATION > > > > >


< ShowInROF> false< /ShowInROF> < PassParameters> true< /PassParameters> < Security> false< /Security> < Scrolling> auto< /Scrolling> < Border> false< /Border> < /parameters> < /control> < /cell> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row> < /row> < row height="auto"> < /row> < /rows> < /section> < section showlabel="false" showbar="false" IsUserDefined="0" id="{ca3b45e5-5018-4cd2-8a57-c14fe7224449}" name="{ca3b45e5-5018-4cd2-8a57-c14fe7224449}" columns="1" locklevel="0" labelwidth="115" celllabelalignment="Left" celllabelposition="Left"> < labels> < label description="General" languagecode="1033" /> < /labels> < rows> < row> < cell id="{c41a075f-5bfa-433b-85a4-199a613dc642}"> < labels> < label description="Caption" languagecode="1033" /> < /labels> < control id="xxx_name" classid="{4273EDBD-AC1D-40d3-9FB2-095C621B552D}" datafieldname="xxx_name" /> < /cell> < /row> < row> < cell id="{a7d9469b-ac...'."


To resolve this issue we need to extract the solution which we are trying to import to CRM.


Open the customizations.xml file and search for the “<ShowInROF>” parameter, remove these parameter where all you find from that file and save the file.

   


  After saving the file zip all the files together and import in CRM. This time you can successfully import the solution in CRM.

Hope this saves some time for others with similar issues


Tuesday, April 9, 2013

Looking for more real estate on Dynamics CRM page


This articles shows various ways in which you can increase the space on Microsoft Dynamics CRM home page. 

Hide the Get Started Pane from the home page

We always see Get started pane above each view as shown below.




If user wishes to disable/hide this pane by default then it can be done, follow below steps.

Click on options as shown below





Under General Tab, uncheck the option “show Get started panes on all lists” as shown below




If you are system administrator and you want to hide or remove this get started pane for all users then it can also be done, please follow below steps for this.

Go to Settings -- Administration -- System Settings



Under General tab, set the “Show Get started pane on all lists for all users” option to NO as shown below. After this you can see all the views without Get Started pane for all users




Collapse the Ribbon bar

In order to collapse the Ribbon bar in CRM follow the outlined steps below:

In CRM we can see arrow at top right corner as shown in below image.

         


Click on that arrow so that ribbon bar get collapsed and we can see full screen records as shown below. In below image, as you can see, only menu is visible without the Ribbon bar.




To see ribbon bar again click on the same arrow at top right corner or else you can click on menu options like view, charts, customize etc. to see the menu items




Reduce the width of the CRM Wonderbar

Reducing the width of the sitemap area in CRM is also very simple so you have more space for your CRM page

In CRM we can see resize option on the sitemap as shown in below image



Click on that resize option and resize sitemap as per your needs, you can drag it to left or right side

After resizing the sitemap you can see it as shown in below image



If you want to increase the size of sitemap again drag the resize option as shown below




Wednesday, March 20, 2013

Show different Header/Footer on different pages of SSRS report

Sometimes, there are requirements to show different Header/ Footer on different pages of the report.
Like say, on the first page, header/ footer of report should be some text and on the second page it should be some different text. Please refer below screenshots.
First Page Footer

Second Page Footer

This can be achieved using the solution as described below:
You need to write a simple expression on the textbox control which is placed on the footer. Here you can utilize expression “Globals!PageNumber” which is used to show page numbers. This expression returns the page number, and we can alter this to show different footer on different pages.
You need to write following expression on the textbox control.
=IIf(cstr(Globals!PageNumber)="1","1111-XYZ (2012/12)      © ABC Sol, 2012","1111-XYZ (2012/12)")
If the report page is the first page, then this expression would set the specified text else it would display alternate text.
General Syntax
=IIF(cstr(Globals!PageNumber)=”<Page Number>”,” <Text to display on the specified Page number> ” , ” <Text to display on other page>”)
Similarly, you can use this expression to show different header on different pages as well.
Hope this article helps!

Wednesday, March 6, 2013

Aggregate and Grouping functions using LINQ in CRM


As you know, QueryExpression are built as an Object Model. They support all the features of FetchXML except for grouping & aggregates.

FetchXML supports all the features of QueryExpression including grouping & aggregates. Queries here are built as XML statements.

LINQ queries are built using standard language similar to SQL, but internally it uses QueryExpression and hence it is limited to the features of QueryExppression



The QueryExpression class supports complex queries.
The QueryByAttribute class is a simple means to search for entities where attributes matches specified values.

When using LINQ, it returns IQueryable<Entity> which is not a collection & hence we can’t do group-by or aggregate.

IQueryable<Entity> queryDemo = from a in orgServiceContext.AccountSet

                                                              where a.Address1_City.Contains("a")
                   select a; 
 
However, LINQ supports group by in following way.
 

Write a simple LINQ Query

var lnqQuery = from o in orgServiceContext.OpportunitySet

where o.EstimatedValue.Value >= 10000

select new

   {

OpportunityTopic = o.Name,

PotentialCustomer = o.CustomerId,

Rating = o.OpportunityRatingCode

};
 

In another query pass your created query as a list. You can either do a ToList() or you can make your own List like List<Groups> estList = new List<Groups>() where Groups is your custom class with set & get.


Here, we are using ToList() & grouping the collection by Rating.
 

var lnqQuery2 = (from f in lnqQuery.ToList()
 
//Pass the lnqQuery as a list using ToList() & then group by
 

group f by f.Rating into queryGrp
 

let first = queryGrp.First()
 

//selecting only the first record of all grouped record
 

select new

{

Name = first.OpportunityTopic,
 

Rating = first.Rating.Value

});
 

Now if we want to retrieve all the records from the Query Group, then we can simply create a list of query Group using ToList() & iterate through it as shown in below example

var lnqQuery2 = (from f in lnqQuery.ToList()
 

//Pass the lnqQuery as a list using ToList() & then group by
 

group f by f.Rating into queryGrp
 

//Make a list of queryGrp using ToList()
 

select queryGrp.ToList());
 

//Create a DataTable
 

DataTable table = new DataTable();
 

//Add some columns
 

table.Columns.Add("Topic");
 

table.Columns.Add("Cust");
 

table.Columns.Add("Rating");
 

foreach (var e1 in lnqQuery2)
 

{

//iterate through each record grouped with rating
 

foreach (var e2 in e1)

{

//iterate through each individual record that belongs in a rating
 

DataRow dataRow = table.NewRow();
 
dataRow["Topic"] = e2.OpportunityTopic;
 

dataRow["Cust"] = e2.PotentialCustomer.Name;
 

dataRow["Rating"] = e2.Rating;
 

table.Rows.Add(dataRow);

 }

}

//here you have your list in your dataGridView
 

dataGridView1.DataSource = table;

 

Note- Here we are just showing the rating value. You can get the rating by using FormattedValues["opportunityratingcode"]

For more details you can visit here


Hope this article helps!
                                                                                     
 

Tuesday, February 26, 2013

Issue regarding service activities resolved in UR 12


A while ago, we had requirement of sending an email to the users to whom service activity is scheduled. We had created a workflow which would send an email to the resources whenever they have be scheduled in for a service activity. The workflow was supposed to be triggered on create of service activity and on change of the resources field on service activity.

We were facing issues with this workflow that it was getting triggered on update of any and every field on the activity whereas the triggers defined were “on change of the resources field” and “create of SA”.

To check this issue we enabled the audit log for service activity, then updated some other field from the service activity and checked the audit log. In the audit log we came to know that the “Scheduling” event was getting triggered whenever the service activity is updated for any field.

As you can also see in the below given screen shot, the changed fields shows resource field with the same value in Old as well as New values, but actually we had updated the location field.





The service activity was getting re-scheduled (see above screen) even if the resources were not changed. As the Reschedule event was getting triggered and setting the same resource again in the resources field, the workflow was getting triggered again and again.

We have tried this on different MS CRM updates which had roll ups installed on it. There we came to know that this is the Roll up 8 and 11 issue.

To resolve the workflow issue we have written a script on the “on change” event of the “Resources” field. This script would set the pipe separated resource names in a custom field and the workflow will be triggered on the change of that particular custom field. It means when the resources are changed the script will be triggered and set the names in the custom field. And when the name is changed in the custom field our workflow of sending email would be triggered. So that whenever any other field of the service activity is updated the workflow will not be triggered.

After the release of UR 12, we have checked this on CRM with Update Roll up 12 installed on it. There we noticed that this issue has been fixed. As you can in below screen shot, instead of scheduling the service activity every time, only update event has been triggered on change of any field of the service activity.






Hope this article helps!

Tuesday, February 5, 2013

Use ExecuteMultipleRequest for performance improvement in bulk data load and other operations


 A new request called ExecuteMultipleRequest has been added to the Update rollup 12 for the Bulk Data Load. Using this request, multiple request can be executed with the single server call. The main advantage of this request is that it will definitely improve the performance since in one round trip to the server, it actually posts more than 1 message to be executed. With reduced round trips for each individual request the performance improvement is exponential.

ExecuteMultipleRequest accepts the collection of different request and executes each request in a order they appear in the collection. This request will optionally returns the response of each request or error occurred while executing the request. Each message request in the input collection is processed in a separate database transaction.

Members of ExecuteMultipleRequest:

1.    Requests: It is a collection of message requests to execute.

2.    Settings: It contains settings that define whether execution should continue if an error occurs executing a request and if responses for each message request processed are to be returned.
Below is the example, where different requests like Create/Update are added to ExecuteMultipleRequest collection and submit it for processing in a single round trip.
                    // Create an ExecuteMultipleRequest object.
                    ExecuteMultipleRequest requestWithResults = new ExecuteMultipleRequest()
                    {
                        // Assign settings that define execution behavior: continue on error, return responses.
                        Settings = new ExecuteMultipleSettings()
                        {
                            ContinueOnError = true,
                            ReturnResponses = true
                        },
                        // Create an empty organization request collection.
                        Requests = new OrganizationRequestCollection()
                    };
                   //create account entity
                   Entity accountEntity=new Entity("account");
                   //set name for the account
                   accountEntity.Attributes["name"] = "New Account "+new DateTime();
                   //create CreateRequest object
                   CreateRequest createRequest = new CreateRequest { Target = accountEntity };
                   //add to ExecuteMultipleRequest Collection
                   requestWithResults.Requests.Add(createRequest);
                   //retrieve contact entity
                   Entity contactEntity = _service.Retrieve("contact", new Guid("FC298C3B-2E4F-     E211-9DED-1CC1DE6DAA3E"),                                      new Microsoft.Xrm.Sdk.Query.ColumnSet());
                   //set Business Phone for the contact
                   contactEntity.Attributes["telephone1"]="1234567";
                   //create UpdateRequest
                   UpdateRequest updateRequest = new UpdateRequest { Target = contactEntity };
                   //add to ExecuteMultipleRequest Collection
                   requestWithResults.Requests.Add(updateRequest);
                   // Execute all the requests in the request collection using a single web method call.
                   ExecuteMultipleResponse responseWithResults = (ExecuteMultipleResponse)_service.Execute(requestWithResults);
                        if (responseWithResults.IsFaulted)
                        {
                            // Display the results returned in the responses.
                            foreach (var responseItem in responseWithResults.Responses)
                            {
                                // A valid response.
                                if (responseItem.Response != null) { }
                               
                                // An error has occurred.
                                if (responseItem.Fault != null) { }
                              
                            }
                        }

Members of ExecuteMultpleResponse:

1.    IsFaulted: It can be used  to identify if any of the messages submitted failed. Once you have identified an error you can loop through the response item to read the error description per message failure.

2.    Responses: Indicates the collection of responses.

Note: This request will only work on organizations that have UR12 applied or on Online organizations that have been upgraded to Polaris.



For further read on this, you can also refer to Microsoft CRM SDK documentation on ExceuteMultiple here.



Wednesday, January 30, 2013

Supported ways of accessing URL addressable Forms/Reports Scripts.

While using CRM there may be conditions in which user wants to open forms and reports programmatically. For this we can write the scripts which will open the forms and reports.
Open CRM forms using script:
The form can be open using openEntityForm(); method.
          Syntax :  Xrm.Utility.openEntityForm(name,id,parameter);
 
Parameters :
 
Ø  name: (Required ) The logical name of an entity.
 
Ø  id: (Optional) The string representation of a unique identifier or the record to open in the form. If not set, a form to create a new record is opened.
 
Ø  parameters: (Optional) A dictionary object that passes extra query string parameters to the form. Invalid query string parameters will cause an error.
 
Example:
1.     To Open Blank new entity record :
          Xrm.Utility.openEntityForm("contact");
2.     To Open Existing CRM Form :
    Xrm.Utility.openEntityForm("contact","A85C0252-DF8B-E111-997C-00155D8E4810");
3.  To open Form with default value set using parameter  
 
function OpenNewContact() {
 var parameters = {};
 
//Set the first name of contact to “Scott”
parameters["firstname"] = "Scott";
 
 //Set text in the Description field.
 parameters["description"] = "Description  for this record";
 
//Set the Parent Customer field value to “John”.
 parameters["parentcustomerid"] = "2E862A5A-7D0F-E211-8090-00155D000501";
 parameters["parentcustomeridname"] = " John ";
 parameters["parentcustomeridtype"] = "account";
 
 //Set Do not allow phone to "Do Not Allow".
 parameters["donotphone"] = "1";
 
 // Open the window.
 Xrm.Utility.openEntityForm("contact", null, parameters);
}
 
Open Report using script:
We can also run the report using script. We just have to pass the url to window.open(); method. Below example shows how to open the report.
Syntax : window.open(url);
url need the following parameters:
Ø  action: Two possible values for this parameter are run or filter.
 
·         When run is used, the report will be displayed using the default filters.
·         When filter is used, the report will display a filter that the user can edit before clicking the Run Report button to view the report.
 
Ø  helped:(optional) The value should correspond to the report FileName attribute value.
 
Ø  Id :This parameter is the report ReportId attribute value.
 
Example:
function OpenReport() {
try {
//call function which will return encoded url
var url=getReportURL(filter,AllContacts,'35F560E6-1606-E211-A8FC-00155D000501');
window.open(url);
}
catch(e){
alert("OpenReport  Error >> "+e.description);
}
}
 
//function to create and encode url
function getReportURL(action,fileName,id) {
   var orgUrl = Xrm.Page.context.getClientUrl();
   var reportUrl = orgUrl +
    "/crmreports/viewer/viewer.aspx?action=" +
    encodeURIComponent(action) +
    "&helpID=" +
    encodeURIComponent(fileName) +
    "&id=%7b" +
    encodeURIComponent(id) +
    "%7d";
   return reportUrl;
  }