function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jingli Hu 3Jingli Hu 3 

user who don't have create permission create record from VF page

Hi,

We have a profile which we don't want to grant create permission to it. since we don't want them to use New button in the object tab to create record. instead , they should click some detail button which will open VF page, and then create record from there. since the apex is running in system mode, we thought it should work. but I keep having problem. in the VF Page controller's constructor, we create a custom object new instance. and in the VF page, we want to display fields by using <apex:inputfield > tab. but none of the field is shown up. we have tried the standard controller extension and custom controller. none of them working. Any suggestions?

Thanks,
Pankaj PPankaj P

Hi,

As per my knowledge the apex i.e. controller classes runs in system mode but the <apex:inputfield > is a visual orce tag which implies the field integrity things from salesforce such as field format(text/phone number/large text area) and required and field visibility also. So that might be the reason you are not seeing any fields on VF page. Another thing to check is if you have removed Edit access too for that profile along with Create that can also be a reason.

If those profile changes does not work then you can use other visualforce tags for fields such as <apex:inputText > (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputText.htm). This will not imply salesforce's field integrity things.

Hope this helps you.

Thanks,
Pankaj.

Jingli Hu 3Jingli Hu 3
Profile does have edit permission on the object and filed level as well. Jingli
Pankaj PPankaj P
So you need to provide that permission in order to get your <apex:InputField> tag show that field on VF page or else use <apex:InputText> tags to bind the fields on VF page.