Browse Dialog does not show Custom Property in ListView


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Luiz,



Look again in the SF help on how to create a Custom Field Property, somewhere you have it wrong.



Here is a sample of several CFPs I have in one of my BO:





Protected Overrides Function GetCustomBindablePropertyDescriptors() As FieldPropertyDescriptor()

' Create and return a new array of FieldPropertyDescriptor objects that contains

' the ReflectionPropertyDescriptor for the Custom Fields.

Return New FieldPropertyDescriptor() _

{New ReflectionPropertyDescriptor("cfp_CardName", GetType(bizTransactionItems)), _

New ReflectionPropertyDescriptor("cfp_CardLotNumberWithPrefix", GetType(bizTransactionItems)), _

New ReflectionPropertyDescriptor("cfp_CardEndSerialNumber", GetType(bizTransactionItems)), _

New ReflectionPropertyDescriptor("cfp_CardDescription_ForListView", GetType(bizTransactionItems)), _

New ReflectionPropertyDescriptor("cfp_CardEndSerialNumber_ForListView", GetType(bizTransactionItems)), _

New ReflectionPropertyDescriptor("cfp_CardLotNumberWithPrefix_ForListView", GetType(bizTransactionItems))}

End Function





'''

''' Combines the CardLotNoPrefix with the CardLotNumber.

'''


'''

''' The Lot Number formatted with a prefix if not empty.

'''


BusinessFieldDisplayInEditor(), _

Description("Combines the CardLotNoPrefix with the CardLotNumber."), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public Overridable ReadOnly Property [cfp_CardLotNumberWithPrefix_ForListView]() As String

Get

If _CardBOLookup.Count = 0 Then

_CardBOLookup.FillByActiveRecordsAndITemType(BusinessEditingState.Idle, bizItems.bizItemsFieldNames.ItemIsInactive.ToString, Enumerations.ItemType.CallingCard)

End If



If _CardBOLookup.Count > 0 AndAlso _CardBOLookup.SeekToPrimaryKey(Me.FK_Items) Then

If Not String.IsNullOrEmpty(_CardBOLookup.CardLotNoPrefix) Then

Return String.Format("{0}-{1}", _CardBOLookup.CardLotNoPrefix, Me.CardLotNo.Trim)

Else

Return Me.CardLotNo

End If

Else

Return Me.CardLotNo

End If

End Get

End Property




BusinessFieldDisplayInEditor(), _

Description("Card Lot Number with any Prefix if exist."), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public Overridable ReadOnly Property [cfp_CardLotNumberWithPrefix]() As String

Get

Return CType(Me.CurrentRow.Item("cfp_CardLotNumberWithPrefix"), System.String)

End Get

End Property







In the CFP definition you can have any code you want to return the proper value, or like in the case of "cfp_CardLotNumberWithPrefix" here you can simply return the column from the CurrentRow which is what I do when using a SELECT statement with a JOIN table to return the FK field description I need, so in reality you DO NOT NEED A VIEW, you can use a stored procedure to get the data for any BO and have any JOIN condition in your SP and then use a CFP like "cfp_CardLotNumberWithPrefix" and when the BO is filled, its data table will have that column "cfp_CardLotNumberWithPrefix" available which the CFP will read.



I know this could be confusing at first, but at the end is very simple and it works.

Edhy Rijo

Luiz Lima
Luiz Lima
StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)
Group: Forum Members
Posts: 66, Visits: 724
Ed,

Now it´s working, CFP appears on BD Editor.
Tomorrow I will test the performance and I tell you ok?

The problem was solved with these imports inside BO file.

Imports MicroFour.StrataFrame.UI.Windows.Forms
Imports System.ComponentModel

Tks a lot!

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
Good to hear! Smile
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Luiz,



Glad you are moving forward, you will be surprise how nice this is handle by SF Hehe

Edhy Rijo

Luiz Lima
Luiz Lima
StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)
Group: Forum Members
Posts: 66, Visits: 724
Ed,

Tks a lot again... surprise? no man, i´m ecsticallyw00t
I came from Cobol, Delphi, Centura... but now.. SF... o GOSH!!!!! (Tks Trent!!!!!! :coolSmile

Let´s come back to my problem..Tongue

1-) CFP was so slowly (I will implement view)
2-) There´s no way to search by CFP (the error is: The given key was not present in the dictionary), normal because the field does not exist in Sql table.
3-) I will implement a view to obtain performance, but I have problems with copy from BoView to FormBo because views has more columns than the original BO (boForm)

Can you help me?

Tks

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

The BrowseDialog control has two properties that allow you to override the table (or view in this case) that will be used to retrieve the records. They are the OverrideSearchTableName and OverrideSearchTableSchema (I think BigGrin).  Anyway, these two properties allow you to query a view or another table.  This feature gives you the ultimate flexibility in what to query server side including joining in tables, etc.  I have posted a link below on the forum to a thread I think you should read as well as a sample that may help.

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

Luiz Lima
Luiz Lima
StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)
Group: Forum Members
Posts: 66, Visits: 724
Trent,

The overidetable  property are available on version 1.6.6.0?

Tks

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Luiz!

You are sticking to an older version?

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
I will have to go back and look to see what version that was implemented, but I would strongly suggest moving to 1.7.0.6. There have been many new features and fixes since 1.6.6!
Luiz Lima
Luiz Lima
StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)StrataFrame User (134 reputation)
Group: Forum Members
Posts: 66, Visits: 724
Ivan and Trent,

I should to move to new version but I have a lot of work to do in this moment, and also we use a USB NIC to share the same license Blush
Sincerly, I´m afraid to change to new version, if my project stop it? (please don´t laught... but in other framework, this is a reallity).

PS: Sorry again by my english... rs

See ya

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