You need to sign in to do that
Don't have an account?
phoadesymc
Problems changing record types on custom objects via S-Control
I am trying to use an S-Control (see below) to change the record type on a custom object. reusing code that has worked in the passed for standard objects. updated to beta 3.3 but am getting the error 'uncaught exception: The property RecortTypeID is not a valid field'in Firefox debug window
Is updating record types on custom objects now supported?
Thanks
Paul
var currentRecordType = "{!Rebates_Approval_RecordType_ID}";
var newRecordType = "";
alert(currentRecordType);
// Switch record type from read/write to read only
if (currentRecordType == "012300000004nqS") {
newRecordType = "012300000004nqSAAQ";
}
sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");
var myObj = new Sforce.Dynabean("Rebates_Approval__c");
myObj.set("Id", "{!Rebates_Approval_ID}");
myObj.set("Justification__c", "yyyyyyyyy");
myObj.set("Status__c", "Submitted");
myObj.set("RecordTypeId", newRecordType);
var saveResults = sforceClient.Update([myObj]);
if (Sforce.Util.dltypeof(saveResults) != "array") {
alert ("Update Returned: " + saveResults.toString());
return false;
}
else
return true;
}
Is updating record types on custom objects now supported?
Thanks
Paul
var currentRecordType = "{!Rebates_Approval_RecordType_ID}";
var newRecordType = "";
alert(currentRecordType);
// Switch record type from read/write to read only
if (currentRecordType == "012300000004nqS") {
newRecordType = "012300000004nqSAAQ";
}
sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");
var myObj = new Sforce.Dynabean("Rebates_Approval__c");
myObj.set("Id", "{!Rebates_Approval_ID}");
myObj.set("Justification__c", "yyyyyyyyy");
myObj.set("Status__c", "Submitted");
myObj.set("RecordTypeId", newRecordType);
var saveResults = sforceClient.Update([myObj]);
if (Sforce.Util.dltypeof(saveResults) != "array") {
alert ("Update Returned: " + saveResults.toString());
return false;
}
else
return true;
}
I am experiencing the same issue...
Has a solution been found for this problem?
Thanks.
Hi Steve,
I believe I am using the same...
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
with
sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}");
Would you mind posting a snippit of code to where you issue an update for the "record type" of a record?
Thanks..
Message Edited by devNut! on 05-11-2006 05:39 AM
Code: