function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SampathNamburiSampathNamburi 

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

Error

Best Answer chosen by Admin (Salesforce Developers) 
saraha@groupesci.comsaraha@groupesci.com

Well then you need to give read/write access to that object in the customer portal user profile.

 

--Sarah

All Answers

saraha@groupesci.comsaraha@groupesci.com

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

SampathNamburiSampathNamburi

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

 

Singular LabelCSP Tracking EntryDescriptionFor Sampath
Plural LabelCSP Tracking EntriesEnable ReportsChecked
Object NameCSP_TrackingTrack ActivitiesChecked
API NameCSP_Tracking__cAvailable for Customer PortalNot Checked
  Track Field HistoryNot Checked
  Deployment StatusDeployed
  Help SettingsStandard salesforce.com Help Window
Created ByWard Geis, 3/15/2011 5:27 PMModified BySampath Namburi, 3/18/2011 5:02 PM
saraha@groupesci.comsaraha@groupesci.com

Triple check that you are logging in to the correct SFDC instance. I have made this mistake many times.

SampathNamburiSampathNamburi

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

saraha@groupesci.comsaraha@groupesci.com

Well then you need to give read/write access to that object in the customer portal user profile.

 

--Sarah

This was selected as the best answer
SampathNamburiSampathNamburi

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

saraha@groupesci.comsaraha@groupesci.com

Great!