I have a customization that uses BLC code to obtain the results of a Generic Inquiry and use that data to run a process.
The generic inquiry has several fields that are formulae and, for some reason, the returned results show null when they do, in fact, contain an amount - calculated by the formula:
Here's the BLC code to loop through the GI rows:
GIDesign gi = PXSelectReadonly<GIDesign, Where<GIDesign.name, Equal<Required<GIDesign.name>>>>.Select(this.Base, "ACAllocationBranches");
if (gi != null)
{
//Creates Generic Inquiry Graph for the specified inquiry
PXGenericInqGrph graph = PXGenericInqGrph.CreateInstance(gi.DesignID.Value);
//Set the filter...
graph.Caches[typeof(GenericFilter)].SetValueExt(graph.Filter.Current, "RefNbr", apinv.RefNbr);
//Loops through each returned result row of Generic Inquiry
foreach (GenericResult resultRow in graph.Views["Results"].SelectMulti())
{
GIMap.Clear();
//Loops through objects returned from one - not an object per field
foreach (string key in resultRow.Values.Keys)
{
//Loops through list of each object and the fields we need values from for each data key
foreach (GIResult resultMap in PXSelectReadonly<GIResult, Where<GIResult.designID, Equal<Required<GIResult.designID>>, And<GIResult.objectName, Equal<Required<GIResult.objectName>>>>>.Select(graph, new object[] { gi.DesignID.Value, key }))
{
//retrieves field value from data object specified
var result = graph.Caches[resultRow.Values[key].GetType()].GetValue(resultRow.Values[key], resultMap.Field);
//Load up the GIMap dictionary...
if(resultMap.IsActive == true)
GIMap.Add(key + "." + resultMap.Field, result);
}
}
}
}
Here's what the GI formula field looks like:
Unfortunately, these formula fields, like I mentioned, return null as a value in the Code, where the actual Generic Inquiry has numeric values.
Is it possible - or is there another way, through that BLC code example, to obtain those formula values?
Thanks much...


