• Prashanth Kapparapu
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hello  Guys,
                 I  am having a trouble while running a JS on my button . I have a button name Make Available on my detail page and there is a pick list name status which is by-default Pending. Whenever user click on Make Available button then the status would automatically change from pending to Available. Following is my code :-
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
var pro = new sforce.SObject('SPBE__Property__c'); 
pro.Id = '{!SPBE__Property__c.Id}'; 
pro.SPBE__Status__c= 'Available'; 
var result = sforce.connection.update([pro]); 
if(result[0].success=='true'){ 
    alert('The Status Updated Successfully'); 
} 
else{ 
    alert('The Status Updated Unsuccessfully'); 
} 
window.location.reload(true);
}


 
  • March 04, 2015
  • Like
  • 0