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
craigt_rcsecraigt_rcse 

Change Task Status to 'Complete' using Custom Button and VF page

I've created a page that is loaded when users click a new custom button.

I want the value of the task.status field to be set to 'Complete' when the button is clicked and before the page is loaded.  I can't figure this out.

How do make the value of {!Task.status} equal to 'Complete' when the page is loaded?

Any help would be appreciated.

Edwin VijayEdwin Vijay

I believe you are using a standard controller.... For your requirement use an extension and when the page loads call a method

 

 

<apex:page standardcontroller="Account" extensions="extclass" action="{!changestatus}"/>

 

 Something like this...

 

In this method you will have to update the Status of the Task...

 

Hope this helps!!!