You need to sign in to do that
Don't have an account?

Error while creating new record into custom object using sControl
Hi,
I am reciving the below error while inserting a record into a custom object using sControl and Ajax. Any help in resolving this is highly appreciate.
{faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'CSP_Tracking__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.', detail:{InvalidSObjectFault:{exceptionCode:'INVALID_TYPE', exceptionMessage:'sObject type 'CSP_Tracking__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.', row:'-1', column:'-1', }, }, }
-------------------------------Code---------------------
<apex:page sidebar="false" showHeader="false">
<!-- Begin Default Content REMOVE THIS -->
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/21.0/connection.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = setupPage;
function setupPage() {
//function contains all code to execute after page is rendered
var Tracking = new sforce.SObject("CSP_Tracking__c");
Tracking.Session_ID__c = __sfdcSessionId;
Tracking.CSP_Page_URL__c = parent.location.href;
Tracking.User_ID__c = "{!$User.Id}";
var result = sforce.connection.create([Tracking], {
onSuccess : success,
onFailure : failure
}
);
function success(result) {
if (result[0].getBoolean("success")) {
alert("new account created with id " + result[0].id);
} else {
alert("failed to create account " + result[0]);
}
}
function failure(error) {
//document.getElementById("output").innerHTML = error;
document.write(error);
//alert(error);
}
}
//alert(parent.location.href);
</script>
</apex:page>
Thank you very much,
Sampath
Well then you need to give read/write access to that object in the customer portal user profile.
--Sarah
All Answers
Is that object in a package with a namespace? You may need to prefix it with the namespace prefix. For example, if your namespace prefix is abc then your object would be abc__CSP_Tracking__c
Note the two underscores after the namespace prefix.
--Sarah
No, it is not part of any package. I have created a new custom object table CSP_Tracking and started developing a VF page to insert a record into that object using sControl. Below are the custom object details
Triple check that you are logging in to the correct SFDC instance. I have made this mistake many times.
Forgot to mention that the error is happening while accessing the VF page in customer portal. If i login as admin it works fine. If i login as customer and access the vf page i am receiving the above error
Well then you need to give read/write access to that object in the customer portal user profile.
--Sarah
Yes, i went into profile and granted read, edit, delete permission and it strated working !! on top of this i have to provide view permission in customer profile to the fields in my custom object
Great!