Is UpdateExt updated to updater?

Just upgraded to 10.2.500.12 Noticed that in the Updatable BAQ, there is this updater object. Is this object available in method BPM? How do I use it?

using (var updater = this.getDataUpdater("Erp", "Project"))
{
    var ttResultQuery = ttResults
        .Where(row => !string.IsNullOrEmpty(row.RowMod) && row.RowMod != "P");

    foreach (var ttResult in ttResultQuery)
    {
        var ds = new Erp.Tablesets.UpdExtProjectTableset();

        // Query to object mapping
        {
            var Project = new Erp.Tablesets.ProjectRow
            {
                Company = Constants.CurrentCompany,
                ProjectID = ttResult.Project_ProjectID,
            };

            ds.Project.Add(Project);

            var ProjPhase = new Erp.Tablesets.ProjPhaseRow
            {
                Company = Constants.CurrentCompany,
                Level = ttResult.ProjPhase_Level,
                PhaseID = ttResult.ProjPhase_PhaseID,
                ProjectID = ttResult.ProjPhase_ProjectID,
            };

            ds.ProjPhase.Add(ProjPhase);
        }

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

        ttResult.RowMod = "P";

        // Object to query mapping
        {
            var ProjPhase = ds.ProjPhase.FirstOrDefault(
                tableRow => tableRow.Company == Constants.CurrentCompany
                    && tableRow.PhaseID == ttResult.ProjPhase_PhaseID
                    && tableRow.ProjectID == ttResult.ProjPhase_ProjectID);
            if (ProjPhase == null)
            {
                ProjPhase = ds.ProjPhase.LastOrDefault();
            }

            var Project = ds.Project.FirstOrDefault(
                tableRow => tableRow.Company == Constants.CurrentCompany
                    && tableRow.ProjectID == ttResult.Project_ProjectID);
            if (Project == null)
            {
                Project = ds.Project.LastOrDefault();
            }

            if (Project != null)
            {
                ttResult.Project_ProjectID = Project.ProjectID;
            }

            if (ProjPhase != null)
            {
                ttResult.ProjPhase_Level = ProjPhase.Level;
                ttResult.ProjPhase_PhaseID = ProjPhase.PhaseID;
                ttResult.ProjPhase_ProjectID = ProjPhase.ProjectID;
            }
        }

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

It appears this is a “shotcut” to get the UpdateExt logic. Did you check if it is still using UpdateExt as the actual Method Call?

There is nothing special inside this updater class. It just calls UpdateExt method of the specified service (business object).