Login / Register  search  syndication

          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
   Creating Pretty Prefixes and Suffixes in the SalesLogix web client
In the SalesLogix web client you may run across a reason you need to generate a “Pretty Key”. This is wh
Posted on Mar 17, 2010 by Kris Halsrud to Kris Halsrud's Blog
 
   SalesLogix Web Client- Working with Activities
In this webinar the user will learn to work with Activities from the Activities entity. This feature all
Posted on Mar 16, 2010 by Dale Richter to SalesLogix Training
 
   Adding an assembly reference to code files in the SalesLogix Application Architect
Often when adding custom code to SalesLogix you need to reference Assemblies that are not included by def
Posted on Mar 15, 2010 by Kris Halsrud to Kris Halsrud's Blog
 
   SalesLogix Web Client- Marketing Campaigns Part I [Video]
In this video webinar the Marketing Professional will learn how to create a New Marketing Campaign in Sal
Posted on Mar 15, 2010 by Dale Richter to SalesLogix Training
 
   Launching a report from a button in the SalesLogix web client
Starting in SalesLogix 7.5.1, Sage released an undocumented Reporting enhancement that allowed for intera
Posted on Mar 12, 2010 by Kris Halsrud to Kris Halsrud's Blog
 
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