uBAQ update processing error with UD fields

I have a uBAQ dashboard that started throwing errors today. I fixed 2, but the remaining 2 are evading me.

This is what I get when I try to run the UBAQ by itself:

  > Output mapping expression for 'ttResult.PartBinInfo_fab_Order_Qty_c' field is invalid: 'PartBinInfoRow' does not contain a definition for 'fab_Order_Qty_c' and no accessible extension method 'fab_Order_Qty_c' accepting a first argument of type 'PartBinInfoRow' could be found (are you missing a using directive or an assembly reference?)

   Output mapping expression for 'ttResult.PartBinInfo_fab_ordered_c' field is invalid: 'PartBinInfoRow' does not contain a definition for 'fab_ordered_c' and no accessible extension method 'fab_ordered_c' accepting a first argument of type 'PartBinInfoRow' could be found (are you missing a using directive or an assembly reference?)

Saving changes to the dashboard gives me:

BPM Customization attached to the ‘Ice._200/smc_rmh_StagingQty.Update’ UBAQ query’s method contains outdated directives:
‘BASE’ (Base Processing)

Exception caught in: Epicor.ServiceModel

Error Detail

Correlation ID: d7a06636-9505-4c5f-b1cf-c398a5a47872
Description: BPM Customization attached to the ‘Ice._200/smc_rmh_StagingQty.Update’ UBAQ query’s method contains outdated directives:
‘BASE’ (Base Processing)

Regenerating the UBAQ in Updatable Query Maintenance gives a combination of the two errors.

Here is my BASE. The first 2 errors I solved were about mismatched variable types. I fixed them by changing System.String to int and bool for the relevant fields.

// <auto-generated>
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
// </auto-generated>

using (var updater = this.getDataUpdater("Erp", "Part"))
{
    var resultQuery = queryResultDataset.Results
        .Where(row => !string.IsNullOrEmpty(row.RowMod) && row.RowMod != "P");

    foreach (var ttResult in resultQuery)
    {
        var ds = new Erp.Tablesets.UpdExtPartTableset();

        // Query to object mapping
        {
            var Part = new Erp.Tablesets.PartRow
            {
                Company = Constants.CurrentCompany,
                GrossWeight = ttResult.Part_GrossWeight,
                GrossWeightUOM = ttResult.Part_GrossWeightUOM,
                NetWeight = ttResult.Part_NetWeight,
                NetWeightUOM = ttResult.Part_NetWeightUOM,
                PartDescription = ttResult.Part_PartDescription,
                PartHeight = ttResult.Part_PartHeight,
                PartLength = ttResult.Part_PartLength,
                PartNum = ttResult.PartBinInfo_PartNum,
                PartWidth = ttResult.Part_PartWidth,
            };

            ds.Part.Add(Part);

            var PartBinInfo = new Erp.Tablesets.PartBinInfoRow
            {
                AttributeSetID = ttResult.PartBinInfo_AttributeSetID,
                BinNum = ttResult.PartBinInfo_BinNum,
                Company = ttResult.PartBinInfo_Company,
                KBQty = ttResult.PartBinInfo_KBQty,
                MaximumQty = ttResult.PartBinInfo_MaximumQty,
                MinimumQty = ttResult.PartBinInfo_MinimumQty,
                OnhandQty = ttResult.PartBinInfo_OnhandQty,
                PartNum = ttResult.PartBinInfo_PartNum,
                Plant = Constants.CurrentPlant,
                SafetyQty = ttResult.PartBinInfo_SafetyQty,
                WarehouseCode = ttResult.PartBinInfo_WarehouseCode,
            };

            PartBinInfo.SetUDField<System.DateTime?>("Fab_Order_Date_c", ttResult.PartBinInfo_Fab_Order_Date_c);
            PartBinInfo.SetUDField<int>("fab_Order_Qty_c", ttResult.PartBinInfo_fab_Order_Qty_c);
            PartBinInfo.SetUDField<bool>("fab_ordered_c", ttResult.PartBinInfo_fab_ordered_c);

            ds.PartBinInfo.Add(PartBinInfo);
        }

        BOUpdErrorTableset boUpdateErrors = updater.Update(ref ds);
        if (this.BpmDataFormIsPublished()) return;

        ttResult.RowMod = "P";

        // Object to query mapping
        {
            var Part = ds.Part.FirstOrDefault(
                tableRow => tableRow.Company == Constants.CurrentCompany
                    && tableRow.PartNum == ttResult.PartBinInfo_PartNum);
            if (Part == null)
            {
                Part = ds.Part.LastOrDefault();
            }

            var PartBinInfo = ds.PartBinInfo.FirstOrDefault(
                tableRow => tableRow.BinNum == ttResult.PartBinInfo_BinNum
                    && tableRow.Company == ttResult.PartBinInfo_Company
                    && tableRow.PartNum == ttResult.PartBinInfo_PartNum
                    && tableRow.Plant == Constants.CurrentPlant
                    && tableRow.WarehouseCode == ttResult.PartBinInfo_WarehouseCode);
            if (PartBinInfo == null)
            {
                PartBinInfo = ds.PartBinInfo.LastOrDefault();
            }

            if (Part != null)
            {
                ttResult.Part_GrossWeight = Part.GrossWeight;
                ttResult.Part_GrossWeightUOM = Part.GrossWeightUOM;
                ttResult.Part_NetWeight = Part.NetWeight;
                ttResult.Part_NetWeightUOM = Part.NetWeightUOM;
                ttResult.Part_PartDescription = Part.PartDescription;
                ttResult.Part_PartHeight = Part.PartHeight;
                ttResult.Part_PartLength = Part.PartLength;
                ttResult.Part_PartWidth = Part.PartWidth;
            }

            if (PartBinInfo != null)
            {
                ttResult.PartBinInfo_AttributeSetID = PartBinInfo.AttributeSetID;
                ttResult.PartBinInfo_BinNum = PartBinInfo.BinNum;
                ttResult.PartBinInfo_Company = PartBinInfo.Company;
                ttResult.PartBinInfo_Fab_Order_Date_c = PartBinInfo.UDField<System.DateTime?>("Fab_Order_Date_c", throwIfNull:false);
                ttResult.PartBinInfo_KBQty = PartBinInfo.KBQty;
                ttResult.PartBinInfo_MaximumQty = PartBinInfo.MaximumQty;
                ttResult.PartBinInfo_MinimumQty = PartBinInfo.MinimumQty;
                ttResult.PartBinInfo_OnhandQty = PartBinInfo.OnhandQty;
                ttResult.PartBinInfo_PartNum = PartBinInfo.PartNum;
                ttResult.PartBinInfo_SafetyQty = PartBinInfo.SafetyQty;
                ttResult.PartBinInfo_WarehouseCode = PartBinInfo.WarehouseCode;
            }

            ttResult.PartBinInfo_fab_Order_Qty_c = PartBinInfo.UDField<int>("fab_Order_Qty_c");
            ttResult.PartBinInfo_fab_ordered_c = PartBinInfo.UDField<bool>("fab_ordered_c");
        }

        if (boUpdateErrors?.BOUpdError?.Count > 0)
        {
            queryResultDataset.Errors
                .AddRange(
                    boUpdateErrors.BOUpdError
                        .Select(
                            e => new ErrorsUbaqRow
                            {
                                TableName = e.TableName,
                                ErrorRowIdent = ttResult.RowIdent,
                                ErrorText = e.ErrorText,
                                ErrorType = e.ErrorType
                            }));
        }
    }
}

var resultsForDelete = queryResultDataset.Results
    .Where(row => row.RowMod != "P")
    .ToArray();

foreach (var ttResult in resultsForDelete)
{
    queryResultDataset.Results.Remove(ttResult);
}

foreach (var ttResult in queryResultDataset.Results)
{
    ttResult.RowMod = "";
}

@rhardiman I get outdated messages when the fields are not found in the schema. Have you tried regenerating the schema? What fields are you updating? Are you also adding?

If it is a simple update I have a routine I use that is much simpler for UD fields.

I got on with Epicor support and we tried several things, but what fixed it was removing and re-adding the 3 UD fields in Query Editor. Truly strange.

1 Like