Custom BO field


Author
Message
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
Inside the curly braces, just separate the return objects with a comma... it adds them to the array.

This:

New FieldPropertyDescriptor() { }

Tells it to create a new array of type FieldPropertyDescriptor.  Whatever you put in the curly braces are items in the newly created array (ReflectionPropertyDescriptor is a subclass of FieldPropertyDescriptor).  So, it needs to look like this:

Return New FieldPropertyDescriptor() { New ReflectionPropertyDescriptor("Ctr", GetType(boCalc)), _
    New ReflectionPropertyDescriptor("Ftr", GetType(boCalc)) }

Any others that you add just need to be separated by commas.

Jon Olson
Jon Olson
StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)
Group: Forum Members
Posts: 15, Visits: 17
I tried adding a second custom field to the BO, I am not sure how to add the code to make it work

I tried somthing like this but doesnt work

Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("Ctr", GetType(boCalc))}

Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("Ftr", GetType(boCalc))}

End Function

 


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
Excellent, I'm glad you figured it out.  We usually post everything in VB.NET, but I think the person that that post was answering was a C# guy...

As for the Type.GetType(boCalc), it's a shared (static) method on the System.Type class, and it only accepts strings, but the GetType(boCalc) is a language keyword, so it accepts the type and knows how to compile it.

And you figured out the creating a new array rather than returinging only a single instance. Smile

Jon Olson
Jon Olson
StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)
Group: Forum Members
Posts: 15, Visits: 17

Okay I figured it out.

 

Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("Ctr", GetType(boCalc))}

End Function


Jon Olson
Jon Olson
StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)
Group: Forum Members
Posts: 15, Visits: 17
Thanks, I saw that before actually. I am just not  sure how to convert that to vb.net

This is what I have so far but it doesnt like boCalc.

Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

Return New ReflectionPropertyDescriptor("Ctr", Type.GetType(boCalc))

End Function


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
Sorry, Jon, I'm just too lazy to type it again...

http://forum.strataframe.net/FindPost3479.aspx

Jon Olson
Jon Olson
StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)StrataFrame Beginner (17 reputation)
Group: Forum Members
Posts: 15, Visits: 17
I added a Custom code to my field for a lookup but now I get an error saying I need a fieldpropertydescriptor. How do I fix this (vb.net project)
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