function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Patrick ConnerPatrick Conner 

How to redirect to related object after completing task with custom button

I've created the following simple custom button on tasks to complete the task:
var TskObj = new sforce.SObject("Task");
TskObj.Id = '{!Task.Id}';
TskObj.Status = 'completed';
var result = sforce.connection.update([TskObj]);

Of course the location simply reloads. I've attempted to create a window.location.href command to force load of the WhatId, but I'm not having any luck. Is there a way to do this without setting any triggers? I'm sure the solution is easier than I'm thinking. Thank you!