Showing posts with label MS CRM 2011. Show all posts
Showing posts with label MS CRM 2011. Show all posts

Thursday, April 7, 2016

Insert Image in knowledge base article

Insert Image in knowledge base article

1.       Create one Image (PNG/JPG/GIF) type web resource into CRM system.
2.       Upload image you want to show in article into Web resource.
3.       Save your image web resource.
4.       Once you save your web source, CRM shows direct URL for that web resource.

5.       Open your article where you want to insert image, and also open image resource in another browser window using web resource URL.
6.       Now simply drag image to Article.

7.       Save and publish article
8.       Now article will show image.



Tuesday, April 28, 2015

Run report from custom ribbon button for selected records

MS CRM has feature to run report on selected records, when you create report using SQL queries you need to specify one report parameter with prefix CRMAF_, this parameter will allow you to pre- filter report.
And when user selects records from grid and run report from report menu, then CRM asking to select records / use these records dialog, in this dialog user need to select either all applicable records, all records on all pages in the current view or selected record.
But sometime user doesn't want to see this dialog or wants custom button to run specific report on selected records.
To do this, first need to add custom button on ribbon and add call JavaScript function on button click.
When calling JavaScript function from ribbon pass Crmparamter SelectedControlSelectedItemIds
 as parameter to JavaScript function, so that we will get all selected record ids in JavaScript function.

And JavaScript function should be like

function RunReportforSelectedRecords(selectedRecords)
{
    var selectedIds;
    for (var i = 0; i < selectedRecords.length; i++) {
        if (i == 0)
            selectedIds = selectedRecords[i];
        else
            selectedIds = selectedIds + "," + selectedRecords[i];
    }
     var rdlName = "Your Report Name.rdl";
    var reportGuid = "8ca0d6b4-f8ec-e411-8ca2-0050568c6d7d"// Report GUID - Replace with your report GUID
    var entityType = "10012"// Entity Type code - Replace
    var para = encodeURIComponent(entityGuid);
    var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=filter&helpID=" + rdlName + "&id={" + reportGuid + "}&p:selectedContactIds=" + selectedIds;
    window.open(url, null, 800, 600, truefalsenull);
}

This will open new window and report will be executed.

To open report I used report URL

"/crmreports/viewer/viewer.aspx?action=filter&helpID=" + rdlName + "&id={" + reportGuid + "}&p:selectedContactIds =" + selectedIds


This URL contains

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 choosing the Run Report button to view the report.
helpID:
This parameter is optional. For reports that are included with Microsoft Dynamics CRM the value in this parameter allows the Help button to display appropriate content about this report when Help on This Page is chosen. The value should correspond to the report FileName attribute value.
Id:
This parameter is the report ReportId attribute value.

More details on Opening a Report by using a URL



p: CustomParameterName
This is custom parameter I used in SSRS report.
To pass parameter value using url we need to specify p:{parameter name}

In this example I am getting string of selected record GUIDs and I am passing it to report.
And I am using these selected GUID in report query like below



CREATE TABLE #selectedContacts(ContactId uniqueidentifier)

 declare @delimiter CHAR(1) =','
  DECLARE @start INT, @end INT
    SELECT @start = 1, @end = CHARINDEX(@delimiter, @selectedContactIds)
    WHILE @start < LEN(@selectedContactIds) + 1 BEGIN
        IF @end = 0 
            SET @end = LEN(@selectedContactIds) + 1
              INSERT INTO #selectedContacts (ContactId) 
        VALUES(SUBSTRING(@selectedContactIds, @start, @end - @start))
        SET @start = @end + 1
        SET @end = CHARINDEX(@delimiter, @selectedContactIds, @start)
    END 

select FirstName, LastName
         , EMailAddress1
         , Telephone1
 from Contact
where ContactId in
(
  select contactid from #selectedContacts
)


When use this query as it is in report SSRS will create report parameter with name @selectedContactIds as this is the only variable not declared in this query.

 In this approach passing record ids in URL, generally URL will support up to 2048 characters, and that’s limitation of around 50 records will come when executing report this way. 

Tuesday, March 31, 2015

Microsoft Dynamics CRM Installations, Updates and Documentation

This article lists all the installations, updates and documentation for the currently released MS CRM products.

List included For MS CRM 4.0, MS CRM 2011, MS CRM 2013 and MS CRM 2015

Click Here..

Microsoft Dynamics CRM Installations, Updates and Documentation


Tuesday, February 25, 2014

Total record count in MS CRM grid

By default CRM is not giving total number of records for entity in grid. If there are more than 5000 records, then CRM will display 5000+ records and when you navigate through 5000+ then count is changing per page size.
If want to show count of total number of records in grid, then need to modify database values.
Steps:
1.       Open MSCRM_CONFIG database in SQL server management studio

select * from DeploymentProperties where ColumnName ='TotalRecordCountLimit'

2.       In this table IntColumn default value is 5000.
3.       Update IntColumn value to -1

Update DeploymentProperties Set IntColumn=-1 Where ColumnName = 'TotalRecordCountLimit'

4.       When using -1, then CRM will take count of all records.
5.       If don’t want all records, but want say 15000 records count then update IntColumn value to number of record count want.
6.       Reset IIS.

7.       Try now.. 

Before



After







Friday, April 26, 2013

MS CRM 2011 Email Scheduler

Schedule Email using CRM 2011 workflows.

Details are here.. MS CRM Email Scheduler (http://mscrmemailscheduler.codeplex.com/)

Tuesday, March 26, 2013

To Run SQL based custom CRM 2011 Report from reporting server credentials


When running CRM 2011 SQL based custom report from reporting server we need to specify username and password.




Here username should be systemuserid and password should be organizationid.

If you are using username as domain\account and passport of account, you might get following error. 

An error has occurred during report processing (rsProcessingAborted) Cannot create a connection to data source ‘CRM.’ (rsErrorOpeningConnection) Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

To get systemuserid and organizationid, you need to run SQL query on CRM database. Here is the query

SELECT fullname, systemuserid, organizationid FROM SystemUser 
Or
SELECT fullname, systemuserid, organizationid FROM FilteredSystemUser 



Thursday, November 29, 2012

Entity Primary Text Field from database




CRM is storing all attributes in Attribute table and all entities into Entity table.
In database CRM is using ColumnNumber and IsCustomField columns to identify attribute is custom or not.
IsCustomField=1 means custom filed.
If you want to find Entity primary text field then use following query

select EntityView.Name, EntityView.PhysicalName, AttributeView.Name, AttributeView.PhysicalName from AttributeView
inner join EntityView
on
EntityView.EntityId=AttributeView.EntityId
where ColumnNumber<33 and IsCustomField=1


ColumnNumber < 33 are all system attributes for that entity and ColumnNumber > 33 are all custom attributes for that entity in Attribute Table.