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



Yes, I currently have to use Custom Code overrides for each and every numeric field that I don't use as the default decimal type. But, since there are dozens (hundreds?) of fields like this, it would save considerable time to have the BOM generate the "correct" code.



Put yourself in my place: if MicroFour had to write custom code for each and every integer field in your application, what would you do? I'll bet that you would change the BOM in a hurry!







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
Why are you trying to convert this into an integer in the first place. That might help me better understand your situation. Is this just because of Oracle and you are creating Numeric data types with no decimals?
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