Error Creating NewRow()


Author
Message
Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
We are getting the attached error (Cannot perform '=' operation on System.String and System.Int32)  when performing BO.NewRow() on a child business object. Strange thing is that it works fine in our development and testing environment but not at one of our customer sites.  (I attached the stacktrace).

Any Idea's why we are getting this error.

Thanks,

Tim

Attachments
SF-NewRowError.png (139 views, 55.00 KB)
Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
By the way, I did check the filter and sort properties.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
It appears that though there is a test occuring that is stuffing either a string or integer into the data table and then testing on the two types.  You cannot directly compare a string and an integer.  If your property is String, then for whatever reason you have integer data in the column.  This would be my first guess. 

Be sure to check the SetDefaultValues and any place else that you can think of that may have placed data in this field and then work backwards.  That would be the first thing I would look at.

Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
I did some more investigation, built the SF project in debug mode, and found that the source of the error. It is coming from the DataBasics InitializeNewRow method. I attached a screenshot.

Any help you can offer us would be great as this is causing problems at a number of customers.

Thanks

Tim

Attachments
SF_DataLayerError.png (142 views, 33.00 KB)
Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
I was able to isolate what field is causing the problem but have no idea why an error is being generated, so I was wondering if you guys had any thoughts on the following explaination...

We have a scheduling detail table. One of the fields in this table is called sd_JobNumber. It's defined as a VarChar(20) in the DTK so it is definitely a string field. Our job numbers can be prefixed with [0-9] or [A-Z]. (We call this a job stream).

When we schedule a job prefixed with an alpha job stream, like 'T0123', everything works perfectly. No errors occur when creating new rows in the schedule detail table, and our applications functions properly.

When we schedule a job prefixed with a numeric job stream, like '90123', we get the errors in the InitializeNewRow Method in the DataBasics class, when creating new rows in the schedule detail table. It executes the 'String' condition, so it should know it's a string field,  but it errors out trying to set the field 'sd_JobNumber' to an empty string.(See above post).  I'm not certain why an error occurs, since we haven't even populated the job number yet so it doesn't know what value I am going to use. It must be something going on internally.

This is a huge problem for us and any assistance you can offer would be much appreciated. I can step you through the code via a remote session to show you the error. It's very strange.

Regards,

Tim

Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
The problem has been resolved.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
I'm glad you got it fixed... was it something firing from a changed handler that was causing the issue, or maybe something in your SetDefaultValues?
Tim Dol
Tim Dol
Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)Advanced StrataFrame User (666 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
neither... We built a helper function to create SQL Queries and filter expression in a way that makes it immume to SQL injection attacks. We assumed that 'IsNumeric' returned True if its parameter was of a numeric type, however we discovered it also returned True if it is a string or char that is entirely of numeric form. We added the appropriate 'type' checks which solved our problem.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search