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.