You can create custom button in object without go for visualforce page . and u can use javascript for that button juz ill give small example to update field value using custom button (javascript button)
open oppurtunity obejct - Custom Button or Link - create new button - on click javascript option will be tere .!!!! after use below code to update field value while click that button.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Opportunity"); c.id ="{!Opportunity.Id}"; c.CloseDate = new Date(); newRecords.push(c);
Hi, I have created custom button on Account page In OnClick JavaScript write this code: window.location = 'apex/updatefield'; updatefield is the name of vf page. vf page:
You can create custom button in object without go for visualforce page . and u can use javascript for that button juz ill give small example to update field value using custom button (javascript button)
open oppurtunity obejct - Custom Button or Link - create new button - on click javascript option will be tere .!!!! after use below code to update field value while click that button.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Opportunity");
c.id ="{!Opportunity.Id}";
c.CloseDate = new Date();
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.reload();
regards
suriya.
I have created custom button on Account page
In OnClick JavaScript write this code:
window.location = 'apex/updatefield';
updatefield is the name of vf page.
vf page:
Hope this helps.