Tuesday, December 21, 2010

Error 1935 During NAV v5 Client Install

When installing NAV 5.1 on a workstation running Windows 7, I received the following error –

Error 1935.An error occurred during the installation of assembly component {98CB24AD-52FB-DB5F-A01F-C8B3B9A1E18E}.

HRESULT: 0x800736CC.

Error1935

After some quick researching, this error relates to a missing assembly component.

To resolve the issue, install the Microsoft Visual C++ 2005 SP1 Redistributable pack. If you’re running on a 64-bit system, you’ll need to install both the 32-bit and 64-bit versions.

x86

x64

Thanks to KB953610 for pointing me in the right direction.

Thursday, December 16, 2010

Resolving Contract Line Errors

Steps to correct contract line allotments
Dynamics CRM 4 does not provide a way to revise case resolution allotments after the case has been resolved. Reactivating the case and reclosing it will double-dip allotments from the contract lines, leaving them incorrect.
This must be resolved behind the scenes, using SQL scripts.
NOTE: This is not a supported resolution as it directly modifies data rather than relying on the CRM interface. Always make sure and backup a SQL database before modifying data directly.
This article applies specifically to Dynamics CRM v4.0

Get the Case Resolution Activity ID

Use this procedure to get the activity id related to the closed case.
Open the case. Click the History menu item on the left. The top activity should be the case resolution activity. Open it, then click CTRL+N to open the activity in a new browser window.
The Activity ID is the long string between the {} characters

http://server:5555/company/cs/cases/closecase.aspx?id={68C018E8-5D08-E011-B563-001A4B4D64BE}&_CreateFromType=112&_CreateFromId=%7b616C59EA-2DE8-DF11-BA3B-001A4B4D64BE%7d

clip_image002

Get the Contract Line ID

Click through the case to the contract line and use the same procedure as above to get the contract line id.

Double-Check Your Work

Before you start updating all willy-nilly, make sure you have the correct records.
Using SQL Management Studio, connect to the CRM Company database. Use the following scripts to return the records you’re looking to update. Replace the <ID placeholders> tags in the script below with the correct ID’s you retrieved above.
SELECT *
FROM ContractDetailBase
WHERE ContractDetailId = '<CONTRACT LINE ID>'

SELECT *
FROM IncidentResolutionBase
Where ActivityId = '<RESOLUTION ID>'
Sample:
SELECT *
FROM IncidentResolutionBase
Where ActivityId = '81A0A2C9-DE1F-DF11-9063-001A4B4D64BE'
Verify that you’re looking at the correct record and note the current values. In the ContractDetailBase table, we’re specifically looking at the AllotmentsUsed and AllotmentsRemaining fields. For the IncidentResolutionBase table, we’re changing the TimeSpent field.

Update Your Values

If everything matches up and we’re sure we have the right records, use the scripts below to update the correct fields. Replace the <NEW VALUE> tag with the number you wish to use. Replace the <ID placeholders> tags in the script below with the correct ID’s you retrieved above.
UPDATE IncidentResolutionBase
SET TimeSpent = '<NEW VALUE>'
Where ActivityId = '<CONTRACT LINE ID>’

UPDATE ContractDetailBase
SET AllotmentsUsed = '<NEW VALUE>', AllotmentsRemaining = '<NEW VALUE>'
WHERE ContractDetailId = '<RESOLUTION ID>'
You’ll first adjust the Resolution Activity to the correct value. Make a note of how much it as changed and then adjust the Allotments Used on the Contract Line accordingly. Then, use the same number and adjust the Allotments Remaining as well.
For example, we closed a case and resolved it for 30 minutes, when actually it should have been resolved for 45 minutes. The Contract Line is for a total of 600 minutes (10 hours) and after we closed this case, 4 hours (240) had already been used up.
Old Values
Case Resolution: TimeSpent = 30
Contract Line: Allotments Used = 240
Contract Line: AllotmentsRemaining = 360
Corrected Values
Case Resolution: TimeSpent = 45
Contract Line: Allotments Used = 255
Contract Line: AllotmentsRemaining = 345

Friday, December 3, 2010

CounterPoint SQL DTS Errors

One of the software packages our company sells / supports is a Point of Sale package called CounterPoint by Radiant Systems. For more information about CounterPoint, check out our website at www.accelerando.net

One of our project managers was migrating a customer from the older Pervasive based version to the new SQL based version. CounterPoint provides a utility to import historical data the uses the DTS engine to push the data into the new databases.

As you may know, DTS is a depreciated feature and can be difficult to get running if running on a new system as the SQL installs no longer include it.

There is a backwards compatibility toolkit available for SQL that provides DTS capabilities and this was installed. However, CounterPoint was still firing errors when the DTS package kicked off. The errors we were getting in the log file when running were

Step 'DTSStep_DTSDataPumpTask_1' failed

Step Error Source: Microsoft Data Transformation Services (DTS) Data Pump
Step Error Description:ActiveX Scripting Transform 'DTSTransformation__4' was not able to initialize the script execution engine.

Ultimately, this came down to missing DLL files in the DTS implementation. Following is a list of the steps I came up with to enable DTS functionality.

Requirements

  • SQL 2005 Backward Compatibility Components (source below)
  • The redistributable DTS files (available on SQL 2000 Media)

Steps

  • Install the SQL 2005 Backward compatibility components
  • Open a command prompt and change directory to C:\Program Files\Microsoft SQL Server\80\Tools\Binn
  • Register the following list of DLL’s using the syntax regsvr32 dllname.dll
    • dtsffile.dll
    • dtspkg.dll
    • dtspump.dll
    • axscphst.dll
    • custtask.dll

In our case, the axscphst.dll file was not registered because it had not installed with the Backward Compatibility Components. I was able to retrieve the file from the SQL 2000 media

Note that each of the above DLL files has an associated .RLL file that is located in Resources\1033 under the Binn folder listed above. The .RLL files are also available from the SQL 2000 Media.

NOTE: For my fellow co-workers, I have a zip file put together with all the files involved. It’s available on the ADrive FTP site. Contact me for connection information if needed. There’s a publically downloadable link here - http://tinyurl.com/sql2000dts

In coming up with this solution, I relied on the following sources:

Friday, November 19, 2010

GP: Retrieve List of Company Names & IDs

Here’s a script to return you a quick list of the company ids (which are also the database name) and the company names for the companies defined in the DYNAMICS database

SELECT INTERID,CMPNYNAM FROM SY01500
ORDER BY CMPNYNAM

GP: Reset the System Password

Working as a GP Consultant, I occasionally run into a situation where a client doesn’t remember their System Password for GP. You know, the one that let’s you add users, change company information, the admin level tasks in GP.

The only supported solution is to contact MBS Support, who will walk you thru a process to gather information to send them.

There’s an easier way. Run the following script in SQL to reset the system password to blank. You can then go back into Setup and set it to whatever you want.

update DYNAMICS.dbo.SY02400
set PASSWORD = 0x00202020202020202020202020202020
WHERE DMYPWDID = 1

GP: Error setting User Access to Company

In Dynamics GP, administrators have the ability to control what companies users can access. This also controls what users see when the click the drop-down company field during login.

The menu instructions for this post are for GP 9.0. Newer versions provide the same functionality, although menu layout may be slightly different.

To change User Access for a user, click Tools / Setup / System / User Access. Clicking a username will display all of the available databases on the right and you can click the checkbox to allow or disallow access to specific companies for that user.

Every once in a while, especially have migrating to a new server or merging companies, you’ll get an error message “The user could not be added to one or more database”

A typical reason for this is that on the SQL side of the installation, the GP user already exists as a SQL user on the database, but GP doesn’t know about it. When you click the checkbox, GP tries to add that user to the database users. Since the object already exists, SQL kicks back an error that GP doesn’t know how to deal with.

To resolve the error, open SQL Management Studio and connect to your GP SQL instance. Then, run the following script, replacing <dbname> with the Database name of the company you’re trying to add the user to and replacing <username> with the user’s SQL login id. Our example is for company “Jim’s Bike Shop” that has a database name of JBS and the user id being jfallon.

USE <dbname>
DROP USER <userid>

So for our example, the code would be

USE JBS
DROP USER jfallon

Go back into GP and you should now be able to add the user to the company.

Monday, October 11, 2010

Shrink a LogFile in SQL

Over time, log files on SQL databases can become bloated. This procedure will provide scripts to shrink a log file back to manageable sizes.

1) Perform a complete backup of the database

2) Perform a backup of the transaction log file

3) Run following script to shrink the log file
USE [DB_NAME]
DBCC SHRINKFILE (N'DB_Logical_Name' , 100, TRUNCATEONLY)
BACKUP LOG DB_NAME WITH TRUNCATE_ONLY

4) Check the size of the log file. If it has not shrunk, there may be some data causing it to fail the move. Use the following script to create a sample table and fill it with data which _should_ free up the stuck data.

/* Create the table */
USE [DB_NAME]
DROP TABLE MyTable
CREATE TABLE MyTable (MyField VARCHAR(10), PK INT )
INSERT Mytable (PK) VALUES (1)

/* Fill the table */
SET NOCOUNT ON
DECLARE @Index INT
SELECT @Index = 0
WHILE (@Index < 20000)
BEGIN
   UPDATE MyTable SET MyField = MyField WHERE PK = 1
   SELECT @Index = @Index + 1
END
SET NOCOUNT OFF

5) After running the script rerun the shrink script. The transaction log should now shrink.

USE [DB_NAME]
DBCC SHRINKFILE (N'DB_Logical_Name' , 100, TRUNCATEONLY)
BACKUP LOG DB_NAME WITH TRUNCATE_ONLY

6) If it still hasn't shrunk, delete data from the MyTable table and rerun the fill script. Try the shrink again.

/* Diagnostics */
DBCC LOGINFO

 

This tip came from Rob Bamforth on his blog at http://robbamforth.wordpress.com/2009/11/16/sql-how-to-shrink-un-shrinkable-database-log-database-log-wont-shrink/

Techniques to Shrink a SQL Database

Sometimes the problem is not an inflated logfile or dbfile, but the data itself. In that case, cleaning out old data will help regain that valuable disk space.

A way to gain a little space without purging data is to reindex the database. Indexes, like many other things in SQL grow over time and a reindex will shrink them back down to their fighting weight.

 

lennox_lewis

 

To shrink the indexes, use the following script…

  • USE MyDatabase
  • GO
  • EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 85)"
  • GO
  • EXEC sp_updatestats
  • GO

This script will take some time to process. After it is completed, you’ll need to shrink the actual file to regain that lost space.

  • DBCC SHRINKFILE (N'DB_Logical_Name' , 100, TRUNCATEONLY)

Thursday, September 16, 2010

CRM 2011 Partner Notes

Notes from the CRM 2011 Partner Roadshow in Chicago. Disclaimer that this page is likely to contain errors, if for no other reason than my poor fingers can barely keep up. Plus, Reuben likes to jump around a lot which makes it fun to organize :-)

Morning session – Sales Overview

New Feature Overview

  • User Interface
    • CRM Ribbon
    • Visual Page Flow
    • Adaptive by Task
    • One-click to Customize
  • Outlook Experience
    • Multi-app client
    • Richer Outlook experience
    • Preview Panes
    • Enhanced performance and sync (200x, no lag on startup)
  • Role Tailored Forms and Views
    • Sales mgr and salesperson have different input and views of data based on assigned roles
    • Multiple forms per entity
    • Web and Mobile
    • Drag and Drop customization
  • Advanced Personalization
    • Personal Views
    • Pin favorite record or view to home screen
    • Most-recently used lists
    • Navigation preferences
  • Field Level Security
    • FULL field level security
    • Profiles and rules
    • Read / Write / Create
    • Interactive Override (manager can provide live override for CSR)
  • Productivity
    • Custom Activity Types
    • Re-occurring appointments
    • Dynamic Marketing Lists
      • Set a criteria, list auto-fills
    • Product Catalog enhancements
  • Excel Enhancements
    • Real-time export to Excel
    • Add or edit data from Excel and reimport
    • PowerPivot support
    • Edit using Office Web apps
  • Real-time Dashboards
    • Real-time presentation
      • Salesforce limits how frequently you can refresh
      • Oracle data is 24 hours old
    • Personal dashboards
    • Drag-and-drop creation
    • Extensible thru web resources (pull in silverlight objects, other web apps)
  • Guided Processes
    • Process dialogs (call center if then, record pulls and updates)
    • .NET4 workflow engine
    • Adaptive processes
      • Workflow ‘Light’ – wizard based user entry
      • URL addressable Guided / Visual processes
      • Telemarketing – 4 steps over and over
    • URL addressable processes
  • Inline Visualization
    • Ad-hoc analysis
    • Data drill-down
    • End-user creation
    • .NET 4 chart controls
  • Goal Management
    • Business goal tracking
    • User and team goals
    • Monetary and activity analysis ($100k in revenue / 200 phone calls)
    • Hierarchical with roll-up
  • Conditional Formatting
    • Native Outlook presentation
    • User-defined rules
    • Personal formatting
    • Simple configuration
  • Enhanced Queues
    • Queues against any entity
    • Work state management
    • User and team queues
    • Native workflow support
  • Pervasive Auditing
    • System wide auditing
    • Record or field level
    • Pre-configured audit rules
    • Comprehensive audit history
  • Business Connections
    • Business relationships
    • Social connections
    • Influence tracking
    • Process integration
  • Contextual SharePoint
    • Contextual Documents
    • Custom content types
    • Check-in/check-out
    • Process collaboration (start a workflow in SharePoint and then trigger CRM events)
  • Team Management
    • Team ownership of records
    • Team security roles
    • Team roll-up reporting
    • Internal / external teams
  • Declarative Design
    • One click to customize
    • Drag and drop UI
    • Navigation editor
    • Entity header and footer
      • Lock a field to always display, even while scrolling
  • Cloud Solutions
    • Multi-app server
    • Managed properties
    • Advanced import/ export
    • Cloud install & deploy
  • Dynamics Marketplace
    • Solutions management
    • In-app experience
    • CfMD certification
    • Click and try experience
  • Developer Tools
    • WCF and .NET 4.0
    • Web Resources
    • .NET data types
    • Open Data Protocol (OData)
  • ….Over 500 additional enhancements…

 

Afternoon Technical session with @ReubenK

System Requirements for CRM 2011

  • Client: 32 or 64 bit Windows 7 or Vista / IE7.0 + / Office 2003 + / .NET 4.0 / SQL Express 2008
  • Server: 64-bit 2008 or R2 only / IIS 7 / .NET 4.0
  • SQL: 64-bit SQL Server 2008 or R2 only running on 64-bit Windows Server 2008 or R2 only
  • Developer: Visual Studio 2010
  • IT: System Center Config Mgr 2007 or R2 / Systems Mgt Server 2003 or R2 / System Center Operations Mgr 2007 or R2
  • Email Router: Win7 32 / 64 or on 64-bit Windows Server 2008 or R2
  • Exchange: Exchange server 2007, 2010 or online 12 & 14
  • Sharepoint: 2007 / 2010 / Online 12 & 14

Reporting Enhancements

  • Able to upload to CRM Online if the reports use FetchXML to retrieve data.
  • Advanced Find now can show you the FetchXML query to use to build the report
  • Reports can be packaged into a solution for portability

Field Level Security

  • Secure data at field level
  • Security applies across all access mechanisms
  • Security profiles evaluated at the application server
  • All components of app – Reports, Search, Dupe Detection play by FLS rules
  • Only applies to custom entities and custom attributes on existing entities.

Business Data Auditing

  • Who changed, what changed, when was it changed
  • XML document piggybacking the record tracking the delta
  • Available for out of box as well as custom entities

Visualizations and Dashboards

  • Wizards for user generated chart development
  • Org or user specific charts and share or assign them
  • Drill down enabled

Document Libraries

  • Link any CRM entity with its own library
  • List parts for SP 2010
  • Support multiple SharePoint sites
  • Connect with SP Online or On-Premise
  • Create libraries via workflow or on-demand

@ReubenK: Working towards a simplified licensing model for online services – BPOS, CRM, Exchange. MS has to centralize billing first.

Customization Publication options

  • Unmanaged: becomes a native part of the target system and can be modified
  • Managed: plugs in similar to Windows Feature enabling with versioning, etc.
    • Includes all changes, including form changes / changes to system entities / label changes
    • Includes javascript, which also includes global java libraries – all solution aware
    • Will be dependency aware so that layers built on top won’t be negatively impacted if a lower layer is removed
    • Lot of granularity on what the client can do with the package (no export, no modify, etc.)
  • Working towards digital signatures

Dialog Processes

  • Used to create a dialog (live walk-thru wizard) for users
  • Designed like workflows (uses workflow engine) with new object Pages which are pop-up forms with Prompt and response and branching capabilities
  • Can branch on responses received during the dialog, but also on other values within CRM (This customer is Gold level, provide more options to them)
  • Dialogs are web referencable, so could be used in a call center for repetitive data entry

Multiple Forms

  • Used to simplify user experience, not to protect data
  • Create a custom form
  • Assign it to a security role
  • If the user is a member of that role, they will be able to see the form
  • If a user is a member of multiple security roles, they will be able to switch between all forms available to them

Field Level Security

  • Used to secure sensitive information
  • Applies across all views of the data – forms, reports, advanced finds, etc.

Mobile

  • Mobile Express will be extended
  • Uses the multi-form capabilities of CRM 2011 to display stripped down forms
  • Mobile forms also support the role-tailored forms capabilities
  • Long-term strategy is towards building out device-specific experiences where native objects like the iPhone calendar would be integrated
  • Windows devices will be 1st priority

Process Center

  • Workflow upgrades 3-4x faster (no conversion)
  • Workflow runtime 4x faster
  • Online currently does NOT support custom workflow assemblies
  • Async service upgraded for stability
  • Self-managing and cleaning
    • Automatically delete completed workflow jobs if successful

Security and Authentication

  • Team based security allows user to obtain privilages outside their Business Unit
  • Supports external authenticators (like FaceBook or OAuth)
  • Delete / Rename Business Units (Even root BU)
  • CRM 2011 can be installed using claims based mode
  • CRM _could_ be deployed without ANY Active Directory (pending verification of how the user setup would work)
    • At the platform level, claims based authentication would be setup on SQL as well (or via a middle authentication tier)

Azure Integration

  • App fabric service bus can navigate firewalls, no infrastructure req’d and billed on consumption.Claims aware integration with Service Bus
  • Send messages from CRM online to on-premise securely

Extensability Enhancements

  • In CRM 2011, native CRM data-types are same as .NET data-types
  • LINQ provider available for querying CRM data via API
  • Enhanced SDK provides choice for integration (SOAP, REST, abstracted, service bus)
  • CRM includes service buse en-queue by adding a message thru plugin-registration tool
  • ATOM and JSON support thru OData protocol
  • Uniform URL addressibility and conventions

Plug-In Execution Enhancements

  • Able to participate in SQL transactions (the entire transaction, not individual records)
  • Create traces to return to users

Demo

Demo of CRM web page loaded as a Web Resource in a managed solution that maps band show locations onto a Bing map…in ~20 lines of code

Again, these solutions can be packaged and pushed up to the marketplace as managed or unmanaged code to generate revenue or mindshare.

Why to Cloud?

  • Bandwidth now available globally
  • Security models now open
  • Integration now open for wider development models
  • Availability now can be guaranteed
  • Multi-tenancy optimizes shared infrastructure
  • Design Principles Mainfram –> Client Server –> SaaS
  • Roll-out changed from “Big Bang” to Grow with You

 

@ReubenK – “Integration is not a commodity play” It is highly specialized and has not yet become ‘productized’.

  • Microsoft has invested $2.3B in cloud infrastructure with geo-replicated customer data – rolling out international data centers
  • Public and private cloud flexibility
  • 30,000 engineers working on cloud services
  • Financially backed uptime guarantees
  • SAS 70 and ISO 27001 compliant
  • Carbon footprint innovation
  • Rapid innovation model
    • New capabilities in Azure every 3-6 months

Microsoft working hard for industry specific certifications (FDA)

Azure

  • Windows – SQL – App Fabric
  • “Windows servers in the cloud”
  • Claims aware with multiple identity options
  • Bring your own language
  • Portal accelerators available for deploying apps into Azure
  • Service Bus allows hybrid of online <—> on-premise solutions. Dynamics GP running in-house with a connector to CRM Online
  • CRM Adapter for GP to be expanded to AX and NAV. Will also have CRM to CRM capabilities
  • Connect CRM with InfoUSA to bring back authentic address information
  • Does NOT integrate with JigSaw (asked multiple times today)

BPOS

  • Working towards a common billing / licensing model to be able to checkoff the features you want – Exchange, CRM, SharePoint

Report Publishing

  • Confirmed that IFD and SSRS Connector still needed for internet deployment of Reports

Monday, August 23, 2010

Hidden Attribute Max Length Prevents Relationship Mapping

We have setup a custom attribute called Toll Free that we use to track 800 numbers.

In trying to setup a relationship map between the Lead and Account entity, I received the well known error:

“This attribute map is invalid. The selected attributes should be of the same type. The length of the target attribute should be equal to or greater than the length of the source attribute and the formats should match. The target attribute should not be used in another mapping.”

In looking, I noticed that we have the attribute set to a max of 25 characters in the lead and the default 100 characters in the account. Oh, well there’s the problem. I edited the attribute in the Account and shortened it. Problem solved, right?

Nope, same error. After checking all the other relationships to make sure it wasn’t used elsewhere, I was about to tear out some hair. Then I stumbled on Ronald Lemmen’s article about the error. His article didn’t solve the problem, but in the comments, someone had the solution.

image

When an attribute is created, a second database field called MaxLengthCRMAttribute set to 2x the value of the length of the attribute. Here’s the key, when you shrink the length, it doesn’t shrink the max length. However, when you increase the length, it does.

So I edited the Lead attribute that had been created, set it to 100, published then set it back to 25 and published again. After that, I was able to add the relationship because the max length field values now matched.

Friday, April 30, 2010

Modding Dynamics CRM Reports in SSRS

There are many things that can be handled natively within the Dynamics CRM structure. Every once in a while, you’ll run into something that needs a little help from the outside world. Don’t we all need a little help from time to time? bill-nye-globe

A good example of this would be adding a logo to a Quote or Sales Order. No good way to do that within the CRM framework itself. However, thanks to the open nature of the Dynamics CRM solution, it’s fairly easy to modify the report outside of CRM, make our changes and then import it back in.

For this example, we’re going to modify the Quote form and add our companies logo. You’ll need to have at least a basic understanding of how CRM works, as well as Visual Studio or Visual Studio Business Intelligence Design Studio (BIDS) and SQL Reporting Services (SSRS).

Overview

Reports in Dynamics CRM are actually SSRS reports, wrapped in a CRM framework that passes report parameters, user authentication and other information over to the report to give it the context in which it should run.

Within SSRS, reports generally are not built directly on the Tables / Fields stored in SQL. Microsoft provides objects called Filtered Views that wrap all of the raw data in the context of the security available to the user running the report as well as the context of where the report is being run, including what records to run the report against. These are all parameters passed by the CRM wrapper that surrounds the SSRS report when presented from within Dynamics CRM.

Filtered-Views

Exporting Reports

We start by locating the report in the Report Center. To find the report center, click Workplace and then reports.

To export the report, click the Edit Report button, then choose Download Report from the Action Menu. Save the report into a project folder where you’ll be storing the files for this project.

This .RDL is what we’ll be editing in BIDS to make our changes.

Modifying the Report – Fixing the Data Source

Open your BIDS app and create a new report server project. On the right side, right-click the Reports folder and choose Add existing reports. Navigate to the report.rdl file that you downloaded and bring it into the project.

Weird CRM thing here…: When CRM exports the RDL file it normalizes it for editing (code phrase for I don’t know what it’s doing, but it changes some things around). One of the thing that happens on a regular basis is that the datasource that’s embedded in the RDL file gets reset to the default CRM company Adventure_Works_Cycle_MSCRM. You’ll need to reset that.

Click the Data tab and then the […] link to the right of the dataset selector.

DatasetOpen the dataset and hit the […] again to get to the Connection string. Correct the server name (which will likely have defaulted to localhost) and the catalog (enter the name of your company’s CRM database)

Dataset2 

Making Changes

Go ahead and make your changes to the report. Remember if you have to rebuild the SQL query to use the Filtered Views whenever possible. These provide the prefiltering capability to the user and wrap the report in the security context of the user to prevent unintended data visibility.

When you are done making changes, you now need to upload the report to CRM.

Uploading the report

After your changes have been made, you’ll want to upload the report to Dynamics CRM.

Please, please, please: Save that original report file somewhere you can get back to. I’m not saying you might going to screw something up, I'm saying you WILL screw something up someday and it’s a lot easier to republish that original .RDL file than to try and restore it back in.

Edit the report you want to replace and click the Browse button.

selectrdl There you go, you’ve modified your first Dynamics CRM SSRS report. Don’t you feel like you’ve accomplished something!

A better solution is to create a new report and upload the .RDL file to that, leaving the original one. This gives you something to roll back to in case … um, SQL screwed something up.

Sub-Reports

Note that some of the report (quotes, sales orders, invoices) present their data through sub-reports. These are framed into the main report. The sub-reports would also need to be downloaded and modified. To find these, change the default filter view for the Reports listview to All reports, including sub-reports.

allreportsview

This article is based on an ExpertsExchange tip by member CRM_INFO. The thread is located here -http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Q_24348850.html

Tuesday, April 6, 2010

Hidden Mappings in Dynamics CRM

The source for this post is an article by Jamie Miley, located here.

While working on a Dynamics CRM v4.0 project for a client, I need to map a custom attribute from the Quote Product form to the Sales Order Product form. After searching through the mappings, I determined it wasn’t available. Well, actually, it’s available just hidden from common view.

To find it, run the following SQL query against the <orgname>_MSCRM database -

Select * from entitymapbase where targetentityname = 'salesorderdetail'

Find the row that has the appropriate SourceEntityName and copy the GUID for that row. Use the following URL and paste the GUID at the end.

http://<yourservername>:<port>/Tools/SystemCustomization/Relationships/Mappings/mappingList.aspx?mappingId=

This brings up the hidden mapping and the best part is that this is a supported workaround!

Wednesday, March 31, 2010

Updating ReadOnly and Disabled Fields

This is a repost + comments from an article by Ryan Farley. Many thanks to him and the information he puts out. The full article is located here >>. Relevant portions are copied below.

When you need to set fields disabled or readonly at runtime, you need to keep in mind the type of field you use. Setting a HTML input field is a simple line of Javascript, however, the type of CRM field you've chosen will have an impact on exact items you need to change at runtime. I personally like the look of disabled over readonly. A disabled control will show it's value greyed, indicating to the user that they cannot modify it's contents. A readonly field appears normal. The user only finds out that they cannot change it's value until they attempt to do so.

readonly-disabled

Use the following code to toggle the field status -

// set it as readonly
crmForm.all.new_textfield.readOnly = true;
// OR set it as disabled
crmForm.all.new_textfield.disabled = true;

 

Here’s the tricky part. By default, read-only fields aren’t saved back to the database. Makes sense, right. However, what if you’re updating a field with some code and want that value saved even though you don’t want the user to be able to change it?

Use the ForceSubmit action.

crmForm.all.<field>.DataValue="some value";

crmForm.all.<field>.ForceSubmit = true;

Tuesday, March 30, 2010

Setting defaults for System Fields in CRM

In Dynamics CRM v4.0, the system fields don’t allow you to set a default value. Unfortunate, but there are ways around it.

Add the following code to the OnLoad event for the form. Add as many defaults as you need. The code checks to see if this is a new form (CRM_FORM_TYPE_CREATE) and then sets the values you provide.

//Set default values for system fields
var CRM_FORM_TYPE_CREATE = "1";

if (crmForm.FormType==CRM_FORM_TYPE_CREATE)
{
crmForm.all.fieldname.DataValue = 60;
}

Requiring 1 of X fields in CRM

There may be times when you don’t want to require one specific field to contain data, but at least one in a group. An example would be deciding that we can’t enter a lead if we don’t have a way to contact the lead – phone number, email, mobile, etc.

What we have to do is make sure that at least one of the contact fields for a lead contain data. There’s no way to make sure this happens. We could set them all Business Recommended, but that tells the user that they should all be filled in if possible and that’s not what we need.

Gather the actual names of the fields you want in the required group.

Use the following code to require at least one of the fields to contain data in order to save. Note that this example is based on the Lead form. Place the code in the OnSave event for the form.

The first portion is a concatenated If statement that checks each of the fields for data. If the entire statement evaluates as false, then the second portion of the code pops a prompt to the user letting them know why the save failed and then stops the save process.

Also, the if statement is all on one line, even though it wraps below and

//Contact Check
//Check for at least one contact method
{
if (crmForm.all.telephone1.DataValue==null && crmForm.all.emailaddress1.DataValue==null && crmForm.all.mobilephone.DataValue==null && crmForm.all.telephone3.DataValue==null && crmForm.all.telephone2.DataValue==null && crmForm.all.websiteurl.DataValue==null)
{
alert("Provide at least one phone number or an email address");
event.returnValue=false;
return false;
}
}