Hi,
I am trying to understand computed columns. I am working on an example that won't work for me. Let's say that I have a view consisting of InventTable. I want to add a computed column where I fetch the UnitId from InventTableModule.
I created a method that looks like this but the in my view the computed column is empty. What am I doing wrong?
private static server str unitId(int branchNum)
{
#define.ViewName(CAP_Test)
#define.DataSourceName("InventTable_1")
#define.FieldToComputeWith("ItemId")
str sReturn, sTemp99, sTemp98;
DictView dictView2;
//-------- EndOf variable declarations. ---------
dictView2 = new DictView(tableNum(#ViewName));
sTemp99 =
"(SELECT top 1 InventTableModule.UnitId"
+ " from InventTableModule "
+ " where InventTableModule.ModuleType = 0 AND "
+ " InventTableModule.ItemId = '" ;
stemp98 = dictView2.computedColumnString
(
#DataSourceName,
#FieldToComputeWith,
FieldNameGenerationMode::WhereClause,
true
);
sReturn = sTemp99 + sTemp98 + "')";
return sReturn;
}
*This post is locked for comments