Accessing BBS Instance of the Business Object


Author
Message
Ertan Deniz
Ertan Deniz
StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)StrataFrame User (177 reputation)
Group: Forum Members
Posts: 163, Visits: 493
How can I access the BBS instance that wraps my business object at runtime ?
Aaron Young
Aaron Young
StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)StrataFrame User (439 reputation)
Group: StrataFrame Users
Posts: 277, Visits: 1.1K
I doubt your question can be answered as easily as this but you can access a BBS directly in code. The following C# code allows you to call the BOs MoveFirst method through the BBS:-

myBBS.BusinessObject.MoveFirst();

A BBS points at the BO but the BO doesn't point at the BBS. So if you are trying to take an unknown BO at runtime and locate it's BBS then you could use .NET Reflection if you can work out the BBS name from the BO name. For example, if your BOs are named as "customerBO", "productBO", etc. and your BBSs are named "customerBBS", "productBBS" then you can work out the BBS name at runtime from the BO name and use .NET Reflection to access the properties on the BBS. Reflection is not as fast as accessing the BBS directly in code (as above) but it will be faster than scanning through all form objects searching for the BBS.

Aaron

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you will use the new Custom Business Binding Source the internal BO is exposed through the SourceBO property.  You must be on the most recent 1.6.6 beta build, but this will handle a vast majority of the logic that I think that you are trying to code manually at the moment.  There is a new template for this as well when you add a new item (Custom Business Binding Source).  Then in code you can access it like this:

Talking to the strong-typed properties

MyBBS.SourceBO.cust_LastName;

Talking to the standard BO methods

MyBBS.SourceBO.MoveFirst();

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