JSDO Using Relationship (Angular 2) - ERROR #7211 - Forum - Mobile - Progress Community

JSDO Using Relationship (Angular 2) - ERROR #7211

 Forum

JSDO Using Relationship (Angular 2) - ERROR #7211

This question is answered

Hi everyone !

I`m having some issue doing CUD (Create, Update, Delete) using relationship tables.

Everytime I do a request in those operations I get an error: 

ERROR condition: Unable to call SAVE-ROW-CHANGES(). Failed to create query for BEFORE-TABLE. (7211)

Following code:

JSDO Class Update sample code ->

public update(record: progress.data.JSRecord, tableChild?: string) {

let childDataset: progress.data.JSTableRef = this._jsdo[tableChild] || null;

let promise = new Prom ise((resolve, reject) => {

let afterUpdate = (jsdo: progress.data.JSDO, record: any, success: boolean) => {

//ommited return resolve(data)

}

if (this._jsdo) {

this._jsdo.subscribe('AfterUpdate', afterUpdate, this);

if (childDataset) {

childDataset.assign(record)

} else {

this._tableRef.assign(record);

}
this.save().catch((err) => {

reject(err);

});

} else {

throw new Error("JSDO is not initialized.");

}

});

let result = Observable.fromPromise(promise);

return result;

}

Record code service =>

public update(record: any) {

let jsRecord = this.getById(record.Id);

jsRecord.assign(record);

return this._jsdo.update(jsRecord);

}

The Record arg is passing nested elements, but when I get the JSDORecord, just the data without the relationship.

My mainlly question is: I'm not sure what the backend expected as a payload

There's an example available?

Verified Answer
  • Hi Renato,
     
    If you are using OpenEdge 11.6.3 environment, as a quick verification can you please check if the Business Entity that is being used as backend has SUBMIT method/operation defined in it.  There is an outstanding issue in 11.6.3 environment where CUD (Create, Update and Delete) operations result in an error (ERROR condition: Unable to call SAVE-ROW-CHANGES(). Failed to create query for BEFORE-TABLE) when the Business Entity is configured with multiple tables without SUBMIT operation.
     
    As a workaround please add SUBMIT operation to Business Entity, regenerate the service and publish to respective server.
     
    Note: A fix for above mentioned problem is available in hotfix – 11.6.3.004.
     
    Regarding the JSDO update() or assign() operation, we need to perform separate updates to related table. When we have a JSDO with multi-table dataset, we need to use JSDO API methods at table reference level. Please notice that the JSDO API (and internal representation) for a multi-table dataset is independent of whether the data is returned nested or not nested.
     
    Please find sample(s) in following location(s):
                   
                    HTML client with JSDO
     
    Mobile App sample built using Telerik Platform:
     
    Web App built using Kendo UI Builder:
                    Working Example:            oemobiledemo.progress.com/.../
    Sources:                               github.com/.../hierarchical-grid
     
    Hope this helps.
     
    Thanks and Regards,
    Anil Kumar.
     
All Replies
  • Hi Renato,
     
    If you are using OpenEdge 11.6.3 environment, as a quick verification can you please check if the Business Entity that is being used as backend has SUBMIT method/operation defined in it.  There is an outstanding issue in 11.6.3 environment where CUD (Create, Update and Delete) operations result in an error (ERROR condition: Unable to call SAVE-ROW-CHANGES(). Failed to create query for BEFORE-TABLE) when the Business Entity is configured with multiple tables without SUBMIT operation.
     
    As a workaround please add SUBMIT operation to Business Entity, regenerate the service and publish to respective server.
     
    Note: A fix for above mentioned problem is available in hotfix – 11.6.3.004.
     
    Regarding the JSDO update() or assign() operation, we need to perform separate updates to related table. When we have a JSDO with multi-table dataset, we need to use JSDO API methods at table reference level. Please notice that the JSDO API (and internal representation) for a multi-table dataset is independent of whether the data is returned nested or not nested.
     
    Please find sample(s) in following location(s):
                   
                    HTML client with JSDO
     
    Mobile App sample built using Telerik Platform:
     
    Web App built using Kendo UI Builder:
                    Working Example:            oemobiledemo.progress.com/.../
    Sources:                               github.com/.../hierarchical-grid
     
    Hope this helps.
     
    Thanks and Regards,
    Anil Kumar.
     
  • Hi, Anil!

    Thanks for your reply, helped a lot and it worked!