Trent L. Taylor (08/13/2009)
4.) How can a "view-only" column be introduced into the BD's listView?
Just include the column in your query. If you want to have the ability to query, then you will need to create a custom property (just like you would for any other custom BO property) and you will be able to search on it. If it is for reference only, this approach would still work, but technically you should just be able to add the column (type it in versus selecting from list) and then it will pull from the result set.
Hey Trent -
Ok, I must be missing something, as I am getting different (conflicting) behavior.
If you want to have the ability to query, then you will need to create a custom property (just like you would for any other custom BO property) and you will be able to search on it.
Actually, I am able to have the columns that only exist in the view as search columns in the Browse Dialog without the CFP! They do look a bit odd in that the Advanced Options DropDown initially has no default selected (e.g., Equals), but other than that they work. And, when I dropdown the Advanced Option for these columns I get the appropriate options for the (overridden) datatype I specified.
If it is for reference only, this approach would still work..
Now trying to add a Custom Field Property (in order to have a column that exists in the view only appear in the Browse Dialog's listview), thing fall apart very quickly. If I add the following to the main business object that's tied to a SQL Server table (i.e., not to the denormalized view that drives the BrowseDialog)..
[Browsable(false),
BusinessFieldDisplayInEditor(),
Description("CompanyName"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public System.String CompanyName
{
get
{
return this.CompanyName;
}
}
protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
{
return new FieldPropertyDescriptor[]
{
new ReflectionPropertyDescriptor("Validation_Status_Short_Description", typeof(boIRSComponentTransactions)) ,
new ReflectionPropertyDescriptor("CompanyName", typeof(boIRSComponentTransactions))
};
}
then try to add CompanyName to the BD's BrowseResultsLayout, I get the following error as soon as I try to execute a search on in the BD.
The given item name could not be evaluated. The item 'CompanyName' does not exist on the business object.
The code in the CFP seems wrong to me, but I don't see how to reference a column from the BD's internal datatable (i.e., from the view) in the main BO. When I first read your reply I thought you might be referring to adding the CFP to the BD's BO, but I don't see how that would be referenced (and it's just a datatable, not a BO). HELP!
, but technically you should just be able to add the column (type it in versus selecting from list) and then it will pull from the result set.
Tried this too, just typing CompanyName in the BrowseResultsLayout dialog, but got the same error as above.
By the way, have been running the last beta, but we just go the distribution files for 1.7.0.1 and will be installing shortly. Don't expect that to make a difference, but wanted to disclose it.
TIA.
________________
_____/ Regards,
____/ al