Login / Register  search  syndication  about

          Kris Halsrud's Blog

Kris Halsrud on development and Integration with CRM and Development

SalesLogix 7.5.2 Web - Invalid Index X for this OleDBParameterCollection Error

 

I recently ran into an error on an upgraded SalesLogix 7.5.2 web client when attempting to save changes to an entity using the standard entity.Save() method.  The error looked like:

Saving Error

I found that the cause of the problem was that for some business logic reasoning we had been setting an entity property’s relationship ID via code on the result of a lookup control’s change action.  Let me explain that a little better.  The entity ( I will call Widgets) has a relationship to another entity.  That relationship is expressed with a property called Widget.Role.  The entity itself has a property called Widget.RoleId which is the field where the ID is stored that actually creates the relationship to the other entity.  Hopefully that makes sense.

 Now when you use a lookup control, what happens when you perform a lookup to an entity, SalesLogix automatically creates the relationship (Widget.Role) but does not populate the ID field (Widget.RoleId) until after the save event.

 Back to my scenario, we had been using in code calls to Widget.RoleId to get values.  Now this worked fine for existing entities with the relationships established but when inserting a new Widget the RoleId property was empty, even after using the lookup control to populate it.  For this reason we had mistakenly added code to the lookup change event to set Widget.RoleID = Widget.Role.Id.

 I say mistakenly, because this led to the error I mentioned above.  Apparently SalesLogix, when saving a record attempts to identify how many fields have changed on the entity in order to issue the underlying database commands.  By us having manually updated both the Widget.Role (via the lookup) and Widget.RoleID (via the code) the system saw 2 fields having been updated even though it was in fact an update to really only one field.  This caused the creation of the array used by the underlying database update to have an invalid array. 

 We resolved this by changing our code from checking the Widget.RoleId property to checking the SalesLogix generated Widget.Role.Id property and all was back to blissfulness.

What's This?
Bookmark and Share

About Kris Halsrud

   Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.


Related Content
   SalesLogix Cloud- Administration Options- Using Roles
In this webinar the user will learn to manage roles in the SalesLogix Web Client. These options are onl
Posted on Aug 20, 2010 by Dale Richter to Free SalesLogix Training
 
   SalesLogix 7.5.2 Speed Issues - How To Find the Slowdown
At times I have been asked how can I increase the performance of SalesLogix. For systems using SQL2005
Posted on Aug 13, 2010 by Mark Duthoy to SalesLogix Support
 
   SalesLogix Cloud- Administration Options- Creating a New Department
In this webinar we will look at the Administration Options in the SalesLogix Cloud. In this specific webi
Posted on Aug 13, 2010 by Dale Richter to Free SalesLogix Training
 
   SalesLogix Cloud- Administration Options- Creating a New Team
This Administrative webinar will show the user how to create a new Team for ownership of records. This is
Posted on Aug 13, 2010 by Dale Richter to Free SalesLogix Training
 
   Relating Assets to Tickets in SalesLogix Web and SalesLogix Cloud [Video]
In this SalesLogix Training webinar the user will learn how to relate an Asset to a Ticket in SalesLogix
Posted on Aug 12, 2010 by Dale Richter to Free SalesLogix Training
 
Comments

 

Twitter Trackbacks for SalesLogix 7.5.2 Web - Invalid Index X for this OleDBParameterCollection Error - Kris Halsrud's Blog [customerfx.com] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 SalesLogix 7.5.2 Web - Invalid Index X for this OleDBParameterCollection Error - Kris Halsrud's Blog         [customerfx.com]        on Topsy.com

January 7, 2010 7:15 AM

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2010 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register