• Hansel Pena 4
  • NEWBIE
  • -1 Points
  • Member since 2014
  • Saleforce Developer
  • Newtech

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi, 

I need to do the following. I have an object in which I have a lookup to User field and also a lookup to Account. That field (The user one) when the record is going to be inserted I need check if the user in that field has access to the associated account to the record.
I know that could be used  UserRecordAccess object for this purpose. for one use is great, but the problem is that I need the code to work in bulk mode and if I use UserRecordAccess I am sure I will hit the SOQL limit in that process. 

So my question is, is there a way to check for several users in which each of them has a related account record that I need to verify its access to that account(I only need to check if the user with the matched account has at least read access to the record)?

I thought in checking the users and Accounts on AccountShare object and then if the user wasn't found there then check if the user belongs to any of the Groups that have access to the specific account, but by now it is kind of struggling process to do this. So might be helpful any ideas. 

Hope my question is clear. If it is not let me know.

Thanks for reading this.

 

I have a lookup field and would like to create a default value. There are only two values that I have for the lookup. Here's the code I have so far

trigger AccountName on Opportunity (before insert) {
    
    List<Account> accLu = new List<Account>(); 
    
    for(Opportunity fieldLU: Trigger.new){
             
   Opportunity Account_Name__c = [SELECT ID (NAME FROM ACCOUNT) from Opportunity where Id =:accLu];
        
    }

}
  • August 03, 2017
  • Like
  • 0
I'm starting to work through the Lightning Components Developer Guide working my own developer org where I've created a name space.

But I'm confused about how to do this in our real development stream.  We have a production org and some sandboxes we do development in.  (We develop in sandboxes instead of individual developer orgs as we need common data that is setup for all developers and there's no way we could maintain it in several individual developer's org.)

In out production org and in our sandboxes, there is no "Edit" button to allow specification of Namespace on the Packages page.

So I'm unclear how to reserve a namespace.  Any clue? 

We do have a domain name registered.  Does it have something to do with that?