To do batch update or creation of data I try to run the following code:
for (var i = 0; i < this.SelectedParams.length; i++){
this.NewFamParam = {
"parent_id":null,
"family_revision_id":this.parameters.FamRevId,
"spf_content_id":this.SelectedParams[i].spf_cont_id,
"description":this.SelectedParams[i].description_en,
"formula_id":null,
"is_instance":true,
"order":i+1,
"phase_id":null
}
this.lhpg.createFamilyParameter(this.NewFamParam).subscribe(
(result: any) => {this.notificationService.notify({ severity: "success", summary: Success, detail: Parameter was added });},
(result: any) => {this.notificationService.notify({ severity: "error", summary: Error, detail: Unable to create new FamilyParameter! });});
}
But the compiler complains about the subscribe() method. If I put this code later in .ts file - everything runs as expected. Is it a bug?
What I need is a notification message at each step, so I see which of steps are successful. If I edit the resulting .ts file the application runs and built exactly with this functionality. But Radzed doesn't allow me to insert it in the original code.
I didn't understand this is what you meant. Where is this code entered in Radzen? What kind of action is that - Set property, Execute Code? You can paste a screenshot from the event editor so we can check it further.