I am relatively new to Visualforce. I am trying to change my Opportunity Edit page with a visualforce page that has rendering capabilities. Where I am getting stuck at right now is that I have some fields on there that managers can see, but normal sales people cannot.
Right now, I have the field listed on my page, and the Opportunity New and Edit buttons linked to the new visualforce page. If I create a new record while logged in as a Manager, I can see the layout exactly as I have it set. However, if I log in as a normal sales person, the fields shift because they don't have access to see the field.
How can I make the visualforce page keep the spacing and arrangement of fields so that when someone is unable to see the field, there is a blank space, and the layout doesn't shift?
Here is a snippet of the code that I have.
I edited this from the initial post to update it to show what I have now. I am still not sure if what I am doing on the Opportunity.Audited__c row and the blank row after is the best method for this.
<apex:page standardcontroller="Opportunity" >
<apex:form >
<apex:pageBlock title="Opportunity Edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection id="Detail" title="Opportunity Detail" columns="2">
<apex:outputfield Value="{!Opportunity.OwnerId}" />
<apex:inputField value="{!Opportunity.CloseDate}" />
<apex:inputfield Value="{!Opportunity.Name}" />
<apex:inputField value="{!Opportunity.Contract_Expiration__c}" />
<apex:inputfield Value="{!Opportunity.AccountId}" />
<apex:inputField id="stage" value="{!Opportunity.StageName}" >
<apex:actionSupport event="onchange" rerender="Stage1,Stage2,Stage3,Stage4,Weartest,Bid" />
</apex:inputField>
<apex:outputfield Value="{!Opportunity.Opportunity_Total__c}" />
<apex:inputField value="{!Opportunity.Reason__c}" />
<apex:inputfield Value="{!Opportunity.Audited__c}" rendered="{!$ObjectType.Opportunity.fields.Audited__c.accessible=True}"/>
<apex:outputlabel Value="" rendered="{!$ObjectType.Opportunity.fields.Audited__c.accessible!=True}"/>
<apex:inputField value="{!Opportunity.Who_Won__c}" />
</apex:pageBlockSection>
The line is the field in this section that is visible only to Managers. Their screen shows this lined up as 2 columns. However, on the sales person record, the Who Won field is moved over to the left.
I have tried looking online, but apparently my googling skills are lacking, probably because I am not searching for the correct phrase or word. If someone knows of a place that can point me in this direction, I would be most appreciative.
Thanks.