0

Please help in understanding below points

  • I am using Territory 2.0 and I can use SOQL but not SOSL. Why?
  • Below 2 URL is conflicting in using DML operation. Please help in understanding. Please note 1st URL with list of objects that dont support and 2nd URL about Territory 2.0 object.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_non_dml_objects.htm

https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_territory2.htm

Please let me know any issues.

0

The first reference indicates the SObjects where an APEX class can not perform DML statements like insert, update, delete, upsert or the equivalent Database.insert(..), etc method calls. Territory2 and UserTerritory are excluded from APex DML.

The second reference is a list of all SObjects available for manipulation by the SFDC SOAP or REST API

However, an APEX class can use the SOAP or REST API via Apex HTTP callouts upon the same org and do the DML operations permitted in the second reference. In your example, for SObject Territory2

create(), delete(), describeLayout(), describeSObjects(), query(),
retrieve(), update(), upsert()

That said, you won't be able to mock any testdata for these SObjects in a testclass; instead, you'll have to mock SObjects in memory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.