Developing a simple context sensitive report for CRM


Suppose we want to develop a context sensitive report for contact entity. This report, i should be able run on selected records and it should show information related to those records only.

Lets take an very simple example,

We could develop a report for contacts entity that would display firstname and lastname of the selected records from the grid within CRM.

So we could have our dataset like this

select  CRMAF_FilteredContact.FirstName, CRMAF_FilteredContact.LastName
from FilteredContact as CRMAF_FilteredContact

Then while uploading we would select

“Conacts” for Related Record Types

“Related record types” for Display In.

Another way of creating the above report could be this

Our query for the dataset could be

declare @sql nvarchar(2000)

set @sql=’SELECT  CO.firstname, CO.lastname FROM  (‘+@CRM_FilteredContact +’) CO’

exec(@sql)

Here for @CRM_FilteredContact we would define a report parameter with

name=CRM_FilteredContact

DataType= String

Checked Internal option

Non queried for Available Values

Non queried for Default Values with the following value

select firstname,lastname  from FilteredContact

Than we would upload it in CRM the way described above.

 

For a report that shows parent and child records information for e.g. contact and all its activities we can use the following query.

 

SELECT activitytypecodename, regardingobjectidname, subject, fullname
FROM FilteredActivityPointer AS CRMAF_FilteredActivityPointer
INNER JOIN FilteredContact As CRMAF_FilteredContact on
CRMAF_FilteredContact.contactid = CRMAF_FilteredActivityPointer.regardingobjectid

Bye..

Cleared MB2-632 Microsoft Dynamics CRM 4.0 Applications exam


Last Saturday, i cleared the Applications exam.

Total number of 50 questions were there, divided into five sections General, Sales, Marketing, Service and Service Scheduling.

I had read all these books to learn about CRM as an application

  • Course 8913: Applications in Microsoft Dynamics CRM 4.0
  • MS CRM 4 for dummies.
  • Maximizing your sales using Microsoft Dynamics CRM 4.0
  • Microsoft CRM 4.0 unleashed

as well as the videos at

http://www.democrmonline.com/ and few other videos as well….

The course 8913 is more than enough for preparation of this exam. However other books are also very good and informative.

Some of the topics that could be helpful while preparing are

Outlook offline client, Relationship Roles, Setting Personal Options dialog box,Bulk edit feature, User Settings for Service Scheduling, Functionality of Service Calendar, Templates for different entities, Specific functionality of MS CRM outlook client, How Activities are used, Specific functionality attached with each entity, e.g. converting lead, closing opportunity etc…

bye..

No connection could be made because the target machine actively refused it or The operation you are attempting requires a secure connection (HTTPS)


We could receive the above errors while trying to connect to the reporting server from SQL server management studio or while importing organization using Deployment Administrator.

The following changes resolved the issue

Go to reports server’s config file

1) C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\RSWebApplication.config

<ReportServerUrl>http://servername/ReportServer</ReportServerUrl>

<UrlRoot>http://servername/reportserver</UrlRoot>

Change https to http

2) C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\rsreportserver.config

<Add Key="SecureConnectionLevel" Value="0"/>

Change the Value from 2 to 0

Verify the 3rd step as well

3) In IIS, right click the web site –> properties –> Directory Securities –> Authentication and access control –> Edit

Disable the anonymous access

bye..

Enabling Mail Merge Template for other System entities


Hi,

We had a requirement to use the exiting templates for salesorder entity. However as we know, we only get the option of Lead, Opportunity, Contact , Account , Quote and other custom entities in Associated Entity drop down for the mail merge template.

So i first tried out this, exported the customization for the salesorder entity and added attribute IsMailMergeEnabled with the value of 1, imported it and published it.

However this didn’t work, it only works for custom entities.

Than i tried to do the same using the Metadata Service.

// Initialize MetadataService
MetadataService mdService = new MetadataService();
mdService.Credentials = System.Net.CredentialCache.DefaultCredentials;
mdService.CrmAuthenticationTokenValue = new CrmAuthenticationToken();
mdService.CrmAuthenticationTokenValue.AuthenticationType = 0;
mdService.CrmAuthenticationTokenValue.OrganizationName = "orgname";

// Use RetrieveEntityRequest to get the metadataid for the sales order entity
RetrieveEntityRequest entityMDRequest = new RetrieveEntityRequest();
entityMDRequest.LogicalName = "salesorder";
entityMDRequest.EntityItems = EntityItems.EntityOnly;
RetrieveEntityResponse entityMDResponse1 = (RetrieveEntityResponse)mdService.Execute(entityMDRequest);

// Initialize EntityMetadata for the salesorder entity
EntityMetadata entityMD = new EntityMetadata();
entityMD.MetadataId = entityMDResponse1.EntityMetadata.MetadataId;
// Set IsMailMergeEnabled to true
entityMD.IsMailMergeEnabled = new CrmBoolean();
entityMD.IsMailMergeEnabled.Value = true;

// Use UpdateEntityRequest to update the metadata for sales order entity
UpdateEntityRequest ueRequest = new UpdateEntityRequest();
ueRequest.Entity = entityMD;
UpdateEntityResponse ueResponse = (UpdateEntityResponse)mdService.Execute(ueRequest);

However it gave the following error

"<error>\n  <code>0x80040203</code>\n  <description>Entity 38ded7b5-9ec6-4e77-919a-c408023a4db4 is not a custom entity and therefore cannot have its mail merge enabled properties changed</description>\n  <type>Platform</type>\n</error>"

Finally then i tried out this,

Updated the value for IsMailMergeEnabled in the organization database itself.

This is the sql query for that

update MetadataSchema.Entity
set ismailmergeenabled=1
where name=’salesorder’

Followed by an IISReset.

And it worked !!!!  ( however it is unsupported !!! )

I was able to see the order entity in the Associated Entity drop down for the mail merge template.

I am yet to test it thoroughly though !

Check out this post as well

https://nishantrana.wordpress.com/2009/10/07/using-mail-merge-for-other-entities-in-crm-4/

Bye..

Using Mail Merge for other entities in CRM 4


Suppose we need to make use of Mail Merge functionality for the SalesOrder entity.

So one thing we could do is create custom button or menu items using isv.config for SalesOrder’s form as well as grid. Then we could use the same function used by CRM for other entities like Lead, Contact, Opportunity etc. as their JavaScript attribute.

Something like this

For SalesOrder Form

JavaScript="onActionMenuClick(‘webmailmerge’, 1088)”

For SalesOrder Grid

JavaScript="WebMailMerge(‘crmGrid’, 1088);"

1088- entity type code for sales order

Still trying to find out how to add mail merge template for sales order or other system entity.

Found this post

http://blog.sonomapartners.com/2008/01/enabling-mail-m.html

Unfortunately that didn’t work for sales order entity.

One more thing, all these methods are unsupported one!!

Bye..

Few more JavaScript for CRM


Hi,

While searching for “how to hide new button” from related entity’s grid, these are certain things i found out

Suppose if we want to hide few things from the top bar of the CRM, where we could see New Activity, New Record etc.., we need to write  JavaScript in the following page

bar_Top.aspx within _root.

For e.g. if we want to hide ‘New Activity’ button than

<script type="text/javascript">
    function window.onload() {
        document.getElementById(‘mnu_new_activity’).style.display = ‘none’;
          }
</script>

 

From entity’s grid, if we want to hide say assign button than we need to write JavaScript on the following page

HomePage.aspx

<script language="JavaScript">

    function window.onload() {
       document.getElementById(‘_MBdoActioncrmGrid4assign’).style.display = ‘none’;
            }
</script>

And for entity’s form it would

edit.aspx page for that entity.

for lead it would be

SFA\leads\edit.aspx

for invoice it would be

\SFA\invoice\edit.aspx etc..

However this way of using JavaScript is unsupported.

And lastly for hiding add existing button or new button from related entity’s grid, check this site

http://blog.davehawes.com/post/2008/04/23/MSCRM-4-Remove-Add-Existing-xxxxx-button.aspx

Bye..