You need to sign in to do that
Don't have an account?
Jon Foy
Need Help with Javascript Button
We have a custom object "Task_Custom__c" that I would like to add a button to. When the button is clicked, we need two fields on this object to be updated:
Completion_Stats__c = "Completed"
Completion_Percentage__c = "100"
Can that be done with on click javascript?
Completion_Stats__c = "Completed"
Completion_Percentage__c = "100"
Can that be done with on click javascript?
I Created the Custom object, fields & Custom buttom, on my org and tested it, it worked. See this screencast:
http://screencast-o-matic.com/watch/c2XZqQeYvw
Code for Detail Buttom:
All Answers
{!requirescript("/soap/ajax/26.0/connection.js")}
var taskCustom= new sforce.SObject("Task_FTA__c");
taskCustom.id = '{!Task_FTA__c.Id}';
taskCustom.Completion_Status__c= "Completed";
taskCustom.Completion_Percentage__c="100";
sforce.connection.update([taskCustom]);
window.location.reload(); //reload the window to show the updated values
However, the button, when clicked, refreshes the screen, but the values are not updated.
I Created the Custom object, fields & Custom buttom, on my org and tested it, it worked. See this screencast:
http://screencast-o-matic.com/watch/c2XZqQeYvw
Code for Detail Buttom: