Not able to update parent for all PortfolioItem/Feature which I copied for particular PortfolioItem/MMF

六月ゝ 毕业季﹏ 提交于 2020-01-25 11:05:10

问题


I am trying to set parent for features which I copied for particular MMF, but parent is getting set for only last feature.

Below line of code to set the parent Record is new feature object _newParent is the MMF object, where I am doing wrong

record.set("Parent", _newParent.get("_ref")),

Need help please.Any suggestions?

Whole is method is this

           _genericInnerCopy: function(_childObj) {
                that = this;
                model = that.model;
                var record = Ext.create(model, {
                    Name: _childObj.get('Name'),
                    //Parent: _newParent.get("_ref");,
                });
                record.save({
                    callback: function(result, operation) {
                        if(operation.wasSuccessful()) {
                            console.log("Done");
                            //that._copyChild();
                        } else {
                            console.log("error");
                        }
                    }
                })
                that._all_pis.push(record);
                console.log("all pis values", that._all_pis);
                var store = Ext.create('Rally.data.custom.Store', {
                    data: that._all_pis,
                    listeners: {
                        load: that._updateAll,
                        scope: that
                    },     
                });
                //console.log("record values", that._all_pis);
            },  
            _updateAll: function(store,data) {
                console.log("store values", store);
                console.log("data values", data);
                Rally.data.BulkRecordUpdater.updateRecords({
                    records: data,
                    propertiesToUpdate: {
                        Parent: _newParent.get("_ref")
                    },
                    success: function(readOnlyRecords){
                        //all updates finished, except for given read only records
                    },
                    scope: that
                });
                //that._createNewItems(that._all_pis);
            },

回答1:


The problem in your original question was that your code wasnt spitting out the errors in the callback. To see the errors you can console.log(operation.getError()) or console.log(operation) and inspect the output.



来源:https://stackoverflow.com/questions/26097883/not-able-to-update-parent-for-all-portfolioitem-feature-which-i-copied-for-parti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!