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.
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.
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
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