I am capturing privious Recordtypeid and status in different text fields once the recordtype is changed(As different recordtype has different status), on click of button it should change the record with the earlier recordtype(RecordTypeId is present in a text field) with the status (Captured in different text field) dedicated to that recordtype.
The code for button is mentioned below.
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var appObj = new sforce.SObject("Application__c");
appObj.Id = '{!Application__c.Id}';
appObj.RecordTypeId = '************'; // Id present in test field RectypeId__c
appObj.Application_Status__c = '*******';// status present in AppStatus__c
var result = sforce.connection.update([appObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}
Kindly help on this.
답변 2개
So what you want essentially is that - Clicking this button should swap the RecordType values between the previous and the Current ?