You need to sign in to do that
Don't have an account?
beachbum50
setting object value in code
i have created a visualforce page. when some clicks a customised button - i want to set
an object's value eg pseudo code would look like:
OnClick event (in visualforce page):
my_object_record.my_field_value = "new status";
Can anyone point to me to a code example that shows me how to do this.
I dont want to use standard 'save' button as i don't always want to do this action on
a general save event.
tia.
You can do this easily through a CommandButton. These are linked to an action method in your controller. E.g.
<apex:commandButton value="Search" action="{!doSearch}" status="searchStatus"/>
In this case, I have a button labelled search that invokes the doSearch method in my controller.
thanks bob - understand that bit and can call an action method inmy controller extension class.
(my extension class - OppOperations - extends a standard opportunity controller).
In the 'opcancel' method - I want to set my opportunity.status=cancelled and then save the
opportunity record - any pointers? I have read the manuals (honest) but cant find any code examples.