Hi Community,
We have two different status in a section. One on the section UI (Reservation Status) and other one is DCM status. Our requirement here is, when the DCM status changes it will also change the Reservation Status.
To achieve this we have added one attribute and method on the page schema.
Attribute:
attributes: { "UsrMarketingPlansStatus": { dependencies: [{ columns: ["UsrMarketingPlansStatus"], //field to trigger change event for methodName: "changeHeaderUserStatusBasedOnDCM" //method to execute }] }, },
Method:
methods: { changeHeaderUserStatusBasedOnDCM: function(){ var DCMStatus = this.get("UsrMarketingPlansStatus").displayValue; console.log("DCMStatus: ", DCMStatus); if (DCMStatus === "Business Owner Review 1" || DCMStatus === "Business Owner Review 2" || DCMStatus === "Business Owner Review 3"){ this.set("UsrReservationStatus", {value: "b438b32a-9f74-47fc-9266-69b148a50c21", displayValue: "Submitted"}); } else if (DCMStatus === "Cancelled"){ this.set("UsrReservationStatus", {value: "164d071e-180d-467b-bfc8-18e3818f4698", displayValue: "Cancelled"}); } else if (DCMStatus === "Closed"){ this.set("UsrReservationStatus", {value: "e6296483-82c1-4ecf-a2af-049fa376438e", displayValue: "Closed"}); this.set("UsrUserStatus", {value: "6566728f-4157-4bf1-9f8d-61f043181379", displayValue: "Completed"}); } else if (DCMStatus === "On Hold"){ this.set("UsrReservationStatus", {value: "bcc1fc18-05c0-469a-a4bc-d65366c16cf1", displayValue: "More Info Required"}); } else{ this.set("UsrReservationStatus", {value: this.get("UsrReservationStatus").value, displayValue: this.get("UsrReservationStatus").displayValue}); } }, }
The issue here is, when the user manually changes the DCM status, the Reservation status is getting changed automatically. But when the DCM status changes automatically (after activity completion/approval on DCM stage), the Reservation status is not changing automatically.
Need a suggestion how we can resolve the issue (Not via Business process).
Thanks,
Sourav Kumar Samal
Like
Since the automatic changing of the DCM status happens outside of the context of the page, you won't receive any event in the page code for this. The only options are to either use a process or an entity-level subprocess/event.
Ryan
Since the automatic changing of the DCM status happens outside of the context of the page, you won't receive any event in the page code for this. The only options are to either use a process or an entity-level subprocess/event.
Ryan