Browse Dialog does not show Custom Property in ListView


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
Good to hear! Smile
Luiz Lima
Luiz Lima
StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 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!

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K 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 (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)StrataFrame User (214 reputation)
Group: Forum Members
Posts: 66, Visits: 724
Edhy,

First of all, I can´t see CFP in BD (Design Mode), it only shows fields from database table.
I made a test with BD RowPopulate Event, gosh.. so slow.. I thought if CFP would work like that.
If performance working almost like a Subquery. Ok... I will continue trying to use CFP.

What do you tell me?

Tks a lot


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



Let's clear one thing, are you able to see the CFP in the BD type editor? that would be the first thing to fix, then if so let see how to incorporate the data using a view or something else, but first let me know if you can see the CFP?

Edhy Rijo

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

I read your post today before post my replies here, in a future I will implement incremental search with thread on my system, but at this point my problem is the time that I will spend to implement the change.
Maybe BO View will be the solution, not simple to implement but faster than another.

PS: Sorry by my english

Tks

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

I am not sure what you are trying to accomplish at this point.  But I know that the custom property will work if there is data to back it up.  Also, is this a scenario where an incremental search could work for you?  I posted a sample of how to perform a threaded incremental search today.  You can find it here:

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

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

I´m still with the problem, but I was thinking.... it will be slow because the tables sometimes have thousand of records.
Using view for me it´s a very hard work, imagine that I have 20 bd to handle?
The whole process is:

- create a view with DDT
- generate the BOs with BOM
- make changes on BD after close event to copy the whole content of a view (not only one record) to PrimaryBo of the Form.

Very hard, insn´t it?
I´ve tried to use copydatafrom() but it return errors because my View has more fields than BO
Is there another way?

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



Did you override the GetCustomBindablePropertyDescriptors and add your new property to the array returned there? If you have not done that, it will not show up within any binding segment of the code.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Luiz,



I don't see any problem with your code.



Now keep in mind that CFP could be an slow solution when you are returning many records because of the Scalar method being called per each record/row.



In case of many records, a view will be easier to manage and much more faster. If you use the SF DDT you can create your view definition in DDT and use the BO with the view to get the table structure correct.



There are many other approaches you can use. Do a search in the forum using the word "slow" and you will find many threads.

Edhy Rijo

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