When is an activity considered closed?

If we change the status of an activity to closed, it still shows up in the related account as not completed (in the DCM part). How do we make the system see these activities as closed? 

 

Right now they only dissapear when they go to the account and click complete.

 

I tried looking at the complete request in the network console, but all I see is that it sets the activity status to the same status it had before: https://prnt.sc/rj40so 

Like 0

Like

5 comments

Hi Jonas!

 

How are your completing activities? Can you record a video of this behaviour? 

Angela Reyes,

Not really. We have created a second lookup that is more granular and maps to the Activity.Status in client code. When they select a value from this lookup, we set Activity.Status behind the scenes. However, when I check the database after these operations, Activity.Status is set to Closed.

 

This is the same status that I can see being used by the Dcm module. We want to have the same behaviour as when you would click the complete button in this screen: https://prnt.sc/rj5a24 and then click save.

Jonas Van der Aa,

and how is the status changed to Closed then? 

Angela Reyes,

This code in ActivityPageV2

 

syncActivityAndVisitStatus: function() {
				if (this.isVisit() === false) {
					return;
				}
 
				var visitStatus = this.get("UsrVisitStatus").value;
 
				this.console.trace("Visit status = " + this.get("UsrVisitStatus").displayValue);
				const tracePrefix = "Set activity status to ";
 
				switch (visitStatus) {
					case "33e7d31f-9e8b-4e36-b716-8b49370a6b1e": //Visit Scheduled
						this.set("ActivityStatus", this._createLookup("Not started", "384d4b84-58e6-df11-971b-001d60e938c6"));
						this.console.trace(tracePrefix + "Not Started");
						break;
					case "3e023a20-474d-426d-9a3e-73e25db47ea3": //Close & Notify
						this.set("ActivityStatus", this._createLookup("Completed","4bdbb88f-58e6-df11-971b-001d60e938c6"));
						this.console.trace(tracePrefix + "Completed");
						break;
					default: // everything else
						this.set("ActivityStatus", this._createLookup("In Progress", "394d4b84-58e6-df11-971b-001d60e938c6"));
						this.console.trace(tracePrefix + "In Progress");
				}
			},

This method is triggered by the following attribute:

			"ActivityStatus": {
				dependencies: [{
					columns: ["UsrVisitStatus"],
					methodName: "syncActivityAndVisitStatus"
				}]
			},

 

Dear Jonas,

 

In order to provide you with a proper solution, please tell us how the “_createLookup” function works. I could not find the source code of the function, so it should be your custom function. Looking forward to your reply.

 

Best regards,

Norton

Show all comments