Custom property problem (I think).


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Guys,

I wonder if you can throw a bit of light into this problem which I believe has something to do with custom fields in a BO. I have the following error in business object "boPUN_New" when I open up the form in the IDE that contains the BO. I can close the form and generally mess around until the form opens and I can see it the designer. boPUN_New is the datasource in a grid and I can see all the fields except my custom fields. I've used custom fields before so I have a template to follow and, as best as I can see, I've created them in this BO in the same manner as I've created them in other BO's. I've been messing around with this all day now and I'm getting no where - hopefully you can offer an insight that will help me make some progress...

TIA - Peter

Object reference not set to an instance of an object.
Hide    

at MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor..ctor(String PropertyName, Type PropertyOwner)
at BOInventory.boPUN_New.GetCustomBindablePropertyDescriptors() in C:\TMSRedevelopment\TMS\BOInventory\boPUN_New.vb:line 202
at MicroFour.StrataFrame.Business.BusinessLayer.InternalGetAdditionalPropertyDescriptors()
at MicroFour.StrataFrame.Business.BusinessLayer..ctor()

The variable 'BoPUN_New1' is either undeclared or was never assigned.

Hide    Edit

at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

Replies
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Trent,

Thanks for the prompt feedback and information - I will await your further comments.

Greg - well spotted - a "copy and paste" typo I'm afraid but fixing it didn't change anything.

A comment I should have made in my original post is that in your sample code Trent the GetType funtion doesn't have a value, e.g.

             New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _
            "INIDescription", GetType(*** This is empty in the sample ***)), _

however, if I leave it empty in my code, I get an error in the IDE of "Type expected".

Cheers, Peter


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
Ah the fun with GetType...

"GetType" is both a keyword and a method of System.Object (at least it is in VB.NET... in C#, the keyword is typeof).  So, if you leave the value out of the parentheses in an instance method, the compiler is supposed to pick up on that fact and consider it to be Me.GetType() (which is the System.Object.GetType() call) which returns the type of the current object.  If you place a value in there, it's supposed to consider it to be the keyword call and pull the type that you placed in the parentheses.

But if the GetType is blue (the keyword color), then you know it's expecting the value to be placed in the parentheses like "GetType(MyBo)".  Otherwise, just put a Me. in front of it like this: Me.GetType() to force it to use the current object for the method call.

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