Dear friends,
I would like to ask some help about View. When I create a view that in its data sources there are 2 tables in same level and then each has child data source of same table like the common InventDim table, how to create the display string using SysComputedColumn, which the result should choose first If the 1st InventDim is empty then show the 2nd InventDim ?
The View's structure is something like this :

This is actually for a Data Entity, so in the methods I should create some method for the computed column using SysComputedColumn, right ? And later I can use it as my Data Entity's field. But I don't how it works to have those selection in the computed column's method, for lets say I want to display InventLocationId.
Like mentioned, I would like to show InventLocationID, if not from the InventDim related to CustInvoiceTrans, if it is empty, then take from InventDim related to CustPackingSlipTrans.
I thought can be something like this :
private static server str MyInvenLocation()
{
TableName viewName = tableStr(View1);
str ret;
str InventLoc = SysComputedColumn::returnField(viewName, tableStr(InventDim), fieldStr(InventDim, InventLocationId));
str InventLoc1 = SysComputedColumn::returnField(viewName, tableStr(InventDim1), fieldStr(InventDim, InventLocationId));
return strFmt("CASE WHEN %1 = '' THEN ISNULL(%2, '') ELSE %1 END", InventLoc, InventLoc1);
}
But error when Build. It says the 'InventDim1' is unknown.
Please help.
Thanks in advance.