Using Custom Fill Methods on BO


Author
Message
Richard Keller
Richard Keller
StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)
Group: Forum Members
Posts: 84, Visits: 324
 When creating a Custom Fill Method does the Data Retrieval order have to match the Business Object Definition order or will the BO auto map the fields to the properties based on the column names?

Thanks for your help.

Richard

Replies
Gary Wynne
Gary Wynne
StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)StrataFrame Beginner (16 reputation)
Group: Forum Members
Posts: 10, Visits: 40

Hi

> When creating a Custom Fill Method does the Data Retrieval order have to match the Business Object Definition order or will the BO auto map the fields to the properties based on the column names?

I assume you are referring to the order of the columns in your returned result set? If so, it doesn't matter to the SF business object. It will read and write the data to the column in the inner DataTable (referenced by the CurrentDataTable property). As long as they are named the same and are of the same datatype/precision, you will be good to go.

HTH

-=Gary

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
Gary is correct.  The order of the columns in the returned result set does not matter.  Also, the columns returned to not have to exactly match the field properties on the business object.  On a per-column basis, what Gary said is correct... the name and the data type have to match.  But, you can have more or fewer columns in the return result set than the strong typed field properties on the business object.  If you have a property that doesn't have a corresponding column in the DataTable, you cannot access it (because there's no data behind the property), so don't touch it in code if the field is not in the DataTable.  However, if you have a column in the table that doesn't have a field property, you can access it through the .Item (default/indexer) property like this (comes in handy for joins and aggregate fields like COUNTs and such):

myBO("MyField") = "some value" '-- VB

myBO["MyField"] = "some value"; //-- C#

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Richard Keller - 19 Years Ago
Gary Wynne - 19 Years Ago
StrataFrame Team - 19 Years Ago
Bradley Marston - 19 Years Ago
StrataFrame Team - 19 Years Ago
Bradley Marston - 19 Years Ago
StrataFrame Team - 19 Years Ago
Bradley Marston - 19 Years Ago
StrataFrame Team - 19 Years Ago
StrataFrame Team - 19 Years Ago
Bradley Marston - 19 Years Ago
Bradley Marston - 19 Years Ago
StrataFrame Team - 19 Years Ago
Bradley Marston - 19 Years Ago
Trent L. Taylor - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search