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
jjvdevjjvdev 

Update Button

Want to create a button that saves the current record, and returns to the current record.  Can this be done using OnClick JavaScript?

 

-Thanks

cloudcodercloudcoder

where are you trying to call your javascript from? A Visualforce page? The reason I am asking is because you have posted to the Java discussion board. If you are doing this in a visualforce page you can simply use the {!save} method of the standardcontroller.

jvolkovjvolkov

I'm wanting to call it from a new custom button with the behavior being execute JavaScript, or at least wondering if that can be done.

 

-Thanks

cloudcodercloudcoder

Check out the following docs. I think it should cover what you are asking:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_and_ajax.htm