Skip to main content
Dalig Nadlaw 님이 #Integration에 질문했습니다
Hi, I'm trying to retrieve all the sharing rules that are set in my org using SOQL/REST, as described in https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingrules.htm but I'm always an error code "NOT_FOUND", "The requested resource does not exist" although there are sharing rules set in my org. I'd appreciate it if someone can share a code snippet for that.
답변 2개
  1. 2021년 2월 3일 오전 8:22
    Hi,

    Greetings!

    You should be able to retrieve the sharing rules if you specify the Object to retrieve the related rules as below:

     

    <?xml version="1.0" encoding="UTF-8"?>

    <Package xmlns="http://soap.sforce.com/2006/04/metadata">

    <types>

    <members>ObjA__c.*</members>

    <name>SharingCriteriaRule</name>

    </types>

    <types>

    <members>ObjA__c.*</members>

    <name>SharingOwnerRule</name>

    </types>

    <version>51.0</version>

    </Package>

    Please try the above package.xml and retrieve to see,if still see the same error.

    Kindly mark it as best answer if it helps so that it can help others in the future.

    Warm Regards,

    Shirisha Pathuri