• Jason Smith 2
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have created a custom button the Case object to create a record on a custom object. The button works correctly in my full sandbox but does not work in production. And yes, I have made sure I updated the ID's I have in my code. Any help? The button does not generate an error, just does not do anything.

{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}

getDate = function(dateObj){
var day = dateObj.getDay() < 9 ? '0'+dateObj.getDay() : dateObj.getDay();
var month = dateObj.getMonth() < 9 ? '0'+dateObj.getMonth() : dateObj.getMonth();

return dateObj.getFullYear()+'-'+month+'-'+day;
}

var Request = new sforce.SObject('Request__c');

Request.Release_Management__c = 'a2W70000001RSwq';
Request.Related_Case__c = '{!Case.Id}';
Request.RecordTypeId ='012700000005v8J';
Request.Name = '{!Case.Subject}';
Request.Description__c = '{!Case.Description}';
Request.Case_Owner__c = '{!Case.OwnerId}';


result = sforce.connection.create([Request]);

if(result[0].success == 'true'){
    window.open("/" + result[0].id);
}
I have created a custom button the Case object to create a record on a custom object. The button works correctly in my full sandbox but does not work in production. And yes, I have made sure I updated the ID's I have in my code. Any help? The button does not generate an error, just does not do anything.

{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}

getDate = function(dateObj){
var day = dateObj.getDay() < 9 ? '0'+dateObj.getDay() : dateObj.getDay();
var month = dateObj.getMonth() < 9 ? '0'+dateObj.getMonth() : dateObj.getMonth();

return dateObj.getFullYear()+'-'+month+'-'+day;
}

var Request = new sforce.SObject('Request__c');

Request.Release_Management__c = 'a2W70000001RSwq';
Request.Related_Case__c = '{!Case.Id}';
Request.RecordTypeId ='012700000005v8J';
Request.Name = '{!Case.Subject}';
Request.Description__c = '{!Case.Description}';
Request.Case_Owner__c = '{!Case.OwnerId}';


result = sforce.connection.create([Request]);

if(result[0].success == 'true'){
    window.open("/" + result[0].id);
}