You need to sign in to do that
Don't have an account?
![Patrick Conner Patrick Conner](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
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:
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!
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var TskObj = new sforce.SObject("Task"); TskObj.Id = '{!Task.Id}'; TskObj.Status = 'completed'; var result = sforce.connection.update([TskObj]); location.reload(true);
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!