BOM enhancement for custom type fields


Author
Message
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)
Group: Forum Members
Posts: 41, Visits: 259
Hi All



I'm using SF in an Oracle environment, which converts all numeric values returned from the database into a. Net decimal type. Many times I want to use the value as an int, so I set the BOM to use a custom type of "int" which generates the following code...



return (int)this.CurrentRow["OBJECTID"];




which causes a runtime cast violation (i.e. unboxing from a decimal to an int is not allowed.)



If instead, BOM would generate the following...



return (int)((decimal)this.CurrentRow["OBJECTID"]);




all would be well.



I'd like BOM to generated custom type fields using the following template...



return (custom-type)((native-db-type)this.CurrentRow[fieldName]);




Thanks!
Replies
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)StrataFrame Novice (95 reputation)
Group: Forum Members
Posts: 41, Visits: 259
Hi Trent



I use integers for the same reason anyone uses them. By having a BO show certain values as integers conveys a particular meaning and use. For example, a field representing "count of things" is naturally an integer; a value of "1.5" is unmeaningful. But, I'm sure you know these things.



In Oracle, I can declare a field of type NUMBER(9,0) -- which naturally is treated as an integer. However, the .NET Oracle driver returns the value as a decimal. I have no choice or control over this conversion.



In SQLServer you're fortunate because you can declare an integer value in the database and have it returned as an integer; not so in Oracle.



Have pity on us SF Oracle users, even though we are few in numberSmile
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
This could actually require a very significant change to the BO Mapper, which is already slated to happen in the next update. So this is something that we will consider for the next version of the BO Mapper. I will look into this and think about it for a while, but I am not going to make a quick change here as it could result in many other problems outside of the Oracle user base.
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