BO.GetEnumerable in web page


Author
Message
Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Hi,

I am trying to use GetEnumerable with a Business Object in a web page like this:

foreach ( Serv_ClosedBO mBO in Serv_Closed.GetEnumerable())

but when I try to build the web site, I get an error that says:

" The type of namespace name 'Serv_CLosedBO' could not be found (are you missing  a using directive or an assembly reference?)  "

 

The BO is declared in the corresponding applicationbasepage,

 

 Can I use GetEnumerable in web pages? what am I missing?

 

 

 

 

 

 


Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Hugo,



I think the problem is that GetEnumerable isn't a shared (static) method. It is an instance method. Thus you need to call it on the BO you want to enumerate, not on the BO Type itself. I.e.



// This won't work, calling GetEnumerable on type

foreach ( Serv_ClosedBO mBO in Serv_Closed.GetEnumerable())



// Use something like this instead

Serv_ClosedBO mainBO = new Serv_ClosedBO();

foreach ( Serv_ClosedBO mBO in mainBO.GetEnumerable())





Obviously, you would use the approriate BO to enumerate that you've setup in your master page. This is just a sample to demonstrate that you call GetEnumerable on an instance.



Hope that helps!



Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
I am lost now .

BOs are not supposed to be instantiated in applicationbasepage and so be available in my page?

Crying

Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Well now I am "using" the namespace where the business objects are, and problem solved (at least I can compile).
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Yep, 'using' the namespace of your BOs would help! Tongue



I didn't read your original post closely enough and thought you had used the type (Serv_ClosedBO) with GetEnumerable(), but in fact you hadn't... oops Blush



Glad you got it going! BigGrin
Hugo R. Figueroa
Hugo R. Figueroa
StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)StrataFrame User (165 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 3.1K
Thank you
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