Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Bronze Contributor
Posts: 125
Registered: ‎12-09-2010
Accepted Solution

Opportunities - The given key was not present in the dictionary

I upgraded a working instance of Saleslogiox 7.5.3 to 7.5.4.   Customizations included some changes to the webclient frontend and some changes to the tables.

 

I first upgraded the applications, web host, web reporting and so on.  Then applied the upgrade bundle, and then applied the LAN hotfixes (the ones available at the time were 1, 3, 4 and 5).  I then restored the 7.5.4 web project to a new VFS, built it and deployed it without changing anything else.  Most of the application works fine, I tried both on firefox and internet explorer.  But when I try to open an existing opportunity (the list view also works fine), I get the error "The given key was not present in the dictionary".

 

I thought maybe it was a problem that got fixed with the web fixes, so I applied all the fixes from the web, 1, 2 and 3  (application, bundle and web bundle), built and deployed, but the error still occurs.

 

I didn't make any changes, and I haven't applied any customizations from beforehand.

 

Any idea what would cause this error?   I believe I followed all the steps in the upgrade document (I skipped the ones pertaining to re-applying changes, since I will be redoing those, there weren't many).

 

Any advice?

 

Thanks

Robert

Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Opportunities - The given key was not present in the dictionary

Seems data related.

 

Use SLX Profiler and get the SQL statement executed when you receive this error, then take a look at the data for that record and see if you can determine what is going on (e.g. Bad UserID, Bad OwnerID)

Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com
Bronze Contributor
Posts: 125
Registered: ‎12-09-2010

Re: Opportunities - The given key was not present in the dictionary

Not sure...  I checked the profiler, and nothing jumps out at being incorrect.  It does run a number of queries, and I check the last couple in the list, and they're fine.  No errors noted.

 

From the error it looks like its adding items to a list and then not finding the right item, so it seems more of a code issue.  Or something missing in the database that the profiler won't help me find.

 

Here's the full exception error:

 

http://win2003-vdg3qfp:3333/SlxClient/Opportunity.aspx?entityid=O6UJ9A000006&gid=LOOKUPRESULTS The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Sage.Platform.WebPortal.Workspaces.Tab.TabWorkspace.CreateContentControls() at Sage.Platform.WebPortal.Workspaces.Tab.TabWorkspace.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

I tried inserting a new opportunity, and the same thing happened the moment the webclient tried to open the new opportunity after I clicked 'save'.

Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Opportunities - The given key was not present in the dictionary

You should take the last couple of Queries executed and run them (if on MS SQL, using SQL Management Studio) and then peek at the results.

 

Keep an eye out for Foreigh Keys (AccountId, ContactId, LeadSourceId, etc).

If any of those fields is blank, it is the likely cause of the problem.

 

Also, sometimes I have seen issues with Blank vs NULLs (not sure if this is still an issue), where if a Blank is found, the system attempts to actually retreive an Entity object based on the "Blank" value as an ID.

 

 

Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com
Nickel Contributor
Posts: 47
Registered: ‎05-25-2011

Re: Opportunities - The given key was not present in the dictionary

I think i've seen similar issues when there are changes in the portal manager structure of the page (for example you added or removed a tab). In my experience, clearing the users profile from the VFS (in application architect) and restarting IIS solved the issue.
Bronze Contributor
Posts: 125
Registered: ‎12-09-2010

Re: Opportunities - The given key was not present in the dictionary

Thanks!  That was exactly what the problem turned out to be.   I had customizations I didn't re-apply after the upgrade, and I didn't realize that would cause a problem.  The user must have had the tab as active and then failed because the tab didn't exist anymore.  Deleting the user's settings in the virtualfilesystem worked.

 

Thanks!

New Member
Posts: 3
Registered: ‎07-15-2010

Re: Opportunities - The given key was not present in the dictionary

Hi guys,

 

How do you delete the userprofile from the VFS?

 

I have the same errror when trying to override the sales potential in the opportunity snapshot.

 

Sage aren't aware of how to do this so any chance of pointing me in the right direction?

 

Thanks!

Bronze Contributor
Posts: 125
Registered: ‎12-09-2010

Re: Opportunities - The given key was not present in the dictionary

Hi John

 

There was a very good article on CustomerFX about it.  I just followed the instructions and it worked for me.

 

Clearing out web users VFS user preferences and definitions

http://customerfx.com/pages/integrationblog/2011/03/28/clearing-out-web-users-vfs-user-preferences-a...
New Member
Posts: 3
Registered: ‎07-15-2010

Re: Opportunities - The given key was not present in the dictionary

Thanks Robert, 

 

Your a star!