Issues to Override the Property "PrimaryKeyField"


Author
Message
Sven Heitmann
Sven Heitmann
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 2
Hi



I'm using the Pre-Release of your Application Framework (1.4.0) and I get an error when I want to start the Visual Basic WinForms-Example or Tutorials:

"Public ReadOnly Property PrimaryKeyField() As String" wurde nicht als "Overridable" deklariert und kann daher nicht von "Public Overrides ReadOnly Property PrimaryKeyField() As String" überschrieben werden.   C:\Programme\MicroFour\StrataFrame\VB.NET Tutorial\Tutorial_WinVB_14\OrdersBO.Designer.vb





I have the german version of Visual Studio... so I am sorry for non-english errormessages...



The problem is that the Property PrimaryKeyField was not declared as Overridable, so I can not override it in the subclass...



Shall I download version 1.3.0 instead or is there some quick solution?



Best regards

Sven
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
Sven,

Yes, sorry about this.  The tutorials on the pre-release have not bee updated so you are getting the error because the PrimaryKeyField is now an array instead of a String.  THis was added to support compound primary keys.  You can resolve this error yourself if you would like by changing the line in error to something like this:

Me.PrimaryKeyField = New String() {"TheFieldname"}

ALso, we will have the official 1.4 release available next week and the tutorials will be updated as well Wink  Let me know if this doesn't answer your question.

Jerry Carter
Jerry Carter
StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)
Group: StrataFrame Users
Posts: 11, Visits: 91
I'm having the same problem and your suggested solution gets rid of one of the errors but I am unable to run the sample. I have two different errors. I suppose I can wait until 1.4 is official but after seeing a demo over the weekend, I'm anxious to start using it. My first error repeats itself in all four business objects.

Public Overrides ReadOnly Property PrimaryKeyField() As String
    Get
       
Return "cust_pk"
    End Get
End Property

The error is on "PrimaryKeyField". VS help suggests that I use Overload or Shadow instead of Overrides.

The other error I get I believe you address in your post but I just wanted to make sure.

BusinessParentRelationship1.ForeignKeyField = "orit_or_pk"
BusinessParentRelationship1.ParentBusinessObjectType = "StrataFrameSample.OrdersBO"
BusinessParentRelationship1.ParentPrimaryKeyField = "or_pk"

The error is on "orit_or_pk" in the first line and "or_pk" in the third line. These errors occur in the Order Items business object. I have similar errors in the Orders business object.

I'm pretty new to VS so this may be an obvious fix for a veteran. I hope you dont mind helping out a "newbie" 


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
Jerry,

Never feel bad for asking a question!  That's what a forum is about.  Besides, this is a very valid question.  The problem is that we have added some functionality in version 1.4 to support compound primary keys which in turn supports compound foreign keys.  This means that each of the errors requires that the definition is an array instead of a string.  To do this, the definition would be like this:

BusinessParentRelationship1.ForeignKeyField = New String() {"orit_or_pk"}
BusinessParentRelationship1.ParentBusinessObjectType = "StrataFrameSample.OrdersBO"
BusinessParentRelationship1.ParentPrimaryKeyField = New String() {"or_pk"}

Let me know if this doesn't clear things up.  Also, the official 1.4 release will be released this week and the tutorials will be fixed as well.  Sorry for any trouble this may have caused.

Jerry Carter
Jerry Carter
StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)
Group: StrataFrame Users
Posts: 11, Visits: 91
Hi Trent

That cleared up 4 of the 8 errors that I am getting. How do I apply what you told me to the first set of errors?

Public Overrides ReadOnly Property PrimaryKeyField() As String
    Get
       
Return "cust_pk"
    End Get
End Property

Jerry Carter
Jerry Carter
StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)StrataFrame Beginner (11 reputation)
Group: StrataFrame Users
Posts: 11, Visits: 91
Hey Trent--

No need to reply here. I went and rebuilt the business objects in the BO Mapper and these errors corrected themselves. Thanks for your help.

Jerry

Sven Heitmann
Sven Heitmann
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 2
Thank you for your help. Smile
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
Glad you got it going.  Smile  Let me know if you have another other issues.
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