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
Jerry Xu 1Jerry Xu 1 

"The requested resource does not exist" error when inserting a new custom object

Hi,
Under Account, we created an Analytics Group object (so parent children relationship), from the WSDL, I can see it is called Analytics_Groups__r. From salesforce web interface, the object name is Analytics_Group.
I tried to insert a new Analytics_Group by using the toolkit api:
dynamic c = new ExpandoObject();//
 c.Account__c = key;  //this is the account id
  c.Account_Limit__c = group.AccountLimit;
 c.Concurrent_Limit__c = group.ConcurrentLimit;
 c.Group_ID__c = group.GroupID.ToString();
 c.Display_Name__c = group.DisplayName;
 if (group.ExpiryDate.HasValue)
  {
        c.Expiry_Date__c = group.ExpiryDate.Value.ToString("dd/mm/yyyy");
   }
     c.Notes__c = group.Notes;
     c.Version_ID__c = group.VersionId.ToString();
     c.Version_Name__c = group.VersionText;
 
      var insertResult = fclient.CreateAsync("Analytics_Group", c);
      insertResult.Wait();

I then got "The requested resource does not exist" error. Can someone help? I tried to create with "Analytics_Groups__r", but no difference.

Many Thanks
David ZhuDavid Zhu
In Apex, __r means relationship. in your master-detail relationship query, you use __r. for example.
select id,name, select (id,name from Analytics_Groups__r) from account

but the actually object is called Analytics_Groups__c.

If you cast the object to Analytics_Groups__c, it would work.