• Mahesh G 15
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}
getDate = function(dte){
var day = dte.getDay() < 9 ? '0'+dte.getDay() : dte.getDay();
alert(day);
var month = dte.getMonth() < 9 ? '0'+dte.getMonth() : dte.getMonth();
alert(month);
alert(month+'/'+day+'/'+dte.getFullYear());
return month+'/'+day+'/'+dte.getFullYear();


}
 

 
var Vendor= new sforce.SObject('Vendor__c');
 
Vendor.Name = '{!Interview__c.First_Name__c} {!Interview__c.Last_Name__c}';
Vendor.Primary_Contact__c = '{!Interview__c.First_Name__c} - {!Interview__c.Last_Name__c}';
Vendor.Primary_Contact_Phone__c = '{!Interview__c.Phone_Number__c}';
Vendor.Phone__c = '{!Interview__c.Phone_Number__c}';
Vendor.Primary_Contact_Email__c = '{!Interview__c.Email__c}';
Vendor.Address__c = '{!Interview__c.Home_Address__c}';
Vendor.Emergency_Contact_Name__c = '{!Interview__c.Emergency_Contact_Name__c}';
Vendor.Emergency_Contact_Number__c     = '{!Interview__c.Emergency_Contact_Number__c}';
Vendor.Emergency_Contact_Relationship__c = '{!Interview__c.Emergency_Contact_Relation__c}';
Vendor.SS_or_Tax_ID__c = '{!Interview__c.Tax_ID__c}';
Vendor.Labor_Company__c = true;

var dte='{!Interview__c.Birthday_plus_1__c}';

var dat =new Date(dte).toISOString();

 
Vendor.DOB__c = dat;

Vendor.recordtypeid ='012G0000001YaqwIAC';


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

var c = new sforce.SObject("Interview__c");
c.id = "{!Interview__c.Id}";
c.Application_Status__c = 'Hired';
c.Vendor__c=result[0].id;
result1 = sforce.connection.update([c]);
document.location.reload(true)


 
if(result[0].success == 'true'){
    alert('An New Vendor with Name - ' + Vendor.Name + ' was Created Successfully.');
}
{!REQUIRESCRIPT('/soap/ajax/27.0/connection.js')}
getDate = function(dte){
var day = dte.getDay() < 9 ? '0'+dte.getDay() : dte.getDay();
alert(day);
var month = dte.getMonth() < 9 ? '0'+dte.getMonth() : dte.getMonth();
alert(month);
alert(month+'/'+day+'/'+dte.getFullYear());
return month+'/'+day+'/'+dte.getFullYear();


}
 

 
var Vendor= new sforce.SObject('Vendor__c');
 
Vendor.Name = '{!Interview__c.First_Name__c} {!Interview__c.Last_Name__c}';
Vendor.Primary_Contact__c = '{!Interview__c.First_Name__c} - {!Interview__c.Last_Name__c}';
Vendor.Primary_Contact_Phone__c = '{!Interview__c.Phone_Number__c}';
Vendor.Phone__c = '{!Interview__c.Phone_Number__c}';
Vendor.Primary_Contact_Email__c = '{!Interview__c.Email__c}';
Vendor.Address__c = '{!Interview__c.Home_Address__c}';
Vendor.Emergency_Contact_Name__c = '{!Interview__c.Emergency_Contact_Name__c}';
Vendor.Emergency_Contact_Number__c     = '{!Interview__c.Emergency_Contact_Number__c}';
Vendor.Emergency_Contact_Relationship__c = '{!Interview__c.Emergency_Contact_Relation__c}';
Vendor.SS_or_Tax_ID__c = '{!Interview__c.Tax_ID__c}';
Vendor.Labor_Company__c = true;

var dte='{!Interview__c.Birthday_plus_1__c}';

var dat =new Date(dte).toISOString();

 
Vendor.DOB__c = dat;

Vendor.recordtypeid ='012G0000001YaqwIAC';


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

var c = new sforce.SObject("Interview__c");
c.id = "{!Interview__c.Id}";
c.Application_Status__c = 'Hired';
c.Vendor__c=result[0].id;
result1 = sforce.connection.update([c]);
document.location.reload(true)


 
if(result[0].success == 'true'){
    alert('An New Vendor with Name - ' + Vendor.Name + ' was Created Successfully.');
}