Apex Managed Sharing support

Issue #662 new
Derek Wiers created an issue

Just dipped my hand in some Apex Managed Sharing and found that SObject__Share objects don't seem to be supported in the autocomplete - although the .Shares child relationship in queries seems to be supported. Seeing as this is the first time I'm dabbling in it in the 2 years that I've been in Apex, I can't see this as too huge an issue, but it'd be nice nonetheless (although I suspect supporting this fully might add more time to the OST generation :sadpanda: )

Comments (6)

  1. Scott Wells repo owner

    Derek, you have to regenerate the SObjects portion of your OST after you enable an object for sharing (make the sharing model private). That will include the *Share object in the OST because it's not reported by the Salesforce APIs. Please let me know if that doesn't work properly for you.

  2. Derek Wiers reporter

    Actually, I did do that - however this might be the trickier piece. The SObject in question is public r/w in the internal organization, but I've enabled the external sharing model and made it private externally (working with partner community stuff). I regenerated the SObject portion of the OST, but the object Resource__Share (Resource__c is my custom object in question) object isn't available. Interestingly, there is just one reference to it in the code. It's in Resource__c:

    global List<Resource__Share> Shares;
    
  3. Scott Wells repo owner

    Hmmmm...okay, I haven't tried that. I've only tried this with objects that have a private sharing model. I'll take a look at this a bit later since you stated that it's not critical for you right now. My guess is that I'll need to get Salesforce involved to see why that object isn't being included in the org describe.

  4. Fabio Andree Scheurel

    I have the same issue. The Som_KamAccountPlan__Share records (for Som_KamAccountPlan__c) are included in the Offline Symbol Table, however there is no autocomplete and every reference in the code is in red, stating that IC "Cannot resolve symbol 'Som_KamAccountPlan__Share'". Everything else works as expected. OST was just completely regenerated, with IDE restart under 2.0.0.6. This also applies to SOQL autocomplete/validation.

  5. Scott Wells repo owner

    Now that I have the Spring '18 update released, my next task will be to address the reported code inspection false negatives (and as appropriate, the root cause issues). I'll include this in that pass.

  6. Log in to comment