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?

2
  • 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
    Commented Apr 13, 2016 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
    Commented Apr 14, 2016 at 12:40

1 Answer 1

-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.)

1
  • 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. Commented Apr 13, 2016 at 18:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .