1

I need to have a lookup field on a Visualforce page which will allow the user to select an Account. Then I pass the Id into a URL parameter.

At the moment, I am using a field on a custom object, however we have now decided that no-one other than System Administrators will have Create/Read permission on that object. Is there a way to detach this from any object so this doesn't matter?

  • What do you mean by "detach this from any object so this doesn't matter"? What is the end result you are trying to produce? – JaredT Apr 13 '16 at 16:42
  • I would like the user to be able to select from a list of accounts, so I can get the Id for a URL parameter. – fred Apr 14 '16 at 12:40
-1

You do not need to create or read the object that includes the Account reference but the object and the field need to be editable/updatable for the lookup field to render and presumably they are not?

As there is no representation of a field that is separate from an SObject, you will need to create a new custom object and an Account referencing field on it and use that custom object in your code. Then ensure your users have the right permissions on that custom object and field. (Instances of that custom object will never saved or read.)

| improve this answer | |
  • 1
    So to be clear: you can use a "dummy" sObject on the page regardless of Object CRUD permissions. But the user does need Field Level Security access to the Account lookup field you are using. – Jeremy Nottingham Apr 13 '16 at 18:14

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.