Error creating custom BO property


Author
Message
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
No problem Smile
Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Trent,

Thanks for the help.  That does it nicely.  (I'm trying to study VB syntax along with learning SF and I appreciate the clarifications.)

Larry

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
OK...first of all, the framework and VB.NET are not necessarily case sensitive, but the core of .NET is regarding a type descriptor.  Anytime that you create a type descriptor, it should always match the name of your custom property...whether you are in a case sensitive language or not, this is ALWAYS the safest thing since there are other core .NET classes that get used within the framework.

Second, how would I add a second custom property descriptor to my StaffBO?

It may be too late, but there is no need to start another thread.  But to do this, just add another item to the array:

Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _
   New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("cLastFirst", GetType(StaffBO)), _
   New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("MySecondProperty", GetType(StaffBO))}

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Not to be pushy, but I'm going to start a second thread for this second question "how to a second custom property descriptor".   May be more useful for future users and more easily addressed.

Larry

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Actually,

Maybe I do need some help... <s>.  I'm obviously new to VB and C# and looking at that cryptic and cap sensitive GetCustomBindablePropertiesDescriptors() override, I'm figuring it is C# and not VB.  If this is true, how would the function syntax read in VB?

Second, how would I add a second custom property descriptor to my StaffBO?

Thanks,

Larry

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
Never mind,

The call is apparently cap sensitive, and changing it to "CLASTFIRST" solved it.  Ugh... 2 hours wasted.  I thought VB wasn't cap sensitive, but apparently some of the guts of the framework are.

Larry

Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
I'm getting an error "Object reference not set to an instance of an object." in the FieldPropertyDescriptor code and cannot figure it out.  Maybe a second pair of eyes will help.  I'm pretty sure it is copied straight from the Help.

(This code is in my StaffBO.vb.)

Thanks,

Larry

#Region " Custom Field Properties "

''' <summary>

''' cLastFirst

''' </summary>

''' <remarks></remarks>

<Browsable(False), _

BusinessFieldDisplayInEditor(), _

Description("Staff full name, last name first"), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property [CLASTFIRST]() As System.String

Get

Return Me.CLASTNAME & ", " & Me.CFIRSTNAME

End Get

End Property

 

Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()

Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _

New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _

"cLastFirst", GetType(StaffBO))}

End Function

#End Region


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