You need to sign in to do that
Don't have an account?
Jas Salesforce
Added visualforce page to lightning tab but field columns are not aligned and formatting looks bigger.
I added a visualforce page into lightning tab, and want page to look like same as lightning detail page, but it doent fit properly. Beginer developer and need help please. Also not able to get inline editing
my code
<apex:page standardController="Opportunity" lightningStylesheets="true"> <apex:form > <apex:pageblock mode="maindetail"> <style> body .bPageBlock .pbBody .grey .pbSubheader{ background-color:grey; } </style> <apex:outputPanel styleClass="light grey" layout="block" > <apex:pageBlockSection title="Opportunity Basic Information" > <apex:InputField value="{!Opportunity.What_s_happening_today__c}"/> <apex:InputField value="{!Opportunity.What_do_I_want_to_achieve__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Opportunity Goal/Size" > <apex:inputField value="{!Opportunity.Stretegic_Objective__c}"/> <apex:inputField value="{!Opportunity.Quantity__c}"/> <apex:inputField value="{!Opportunity.Product__c}"/> <apex:inputField value="{!Opportunity.Amount}"/> </apex:pageBlockSection> </apex:outputPanel> <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> <apex:commandButton action="{!save}" value="Save" Style="margin-left: 350px;"/> <apex:commandButton action="{!Cancel}" value="Cancel" Style="margin-left: 20px;"/> </apex:pageblock> </apex:form> </apex:page>
would like page to look like as below (stabdard detail page)
my code
<apex:page standardController="Opportunity" lightningStylesheets="true"> <apex:form > <apex:pageblock mode="maindetail"> <style> body .bPageBlock .pbBody .grey .pbSubheader{ background-color:grey; } </style> <apex:outputPanel styleClass="light grey" layout="block" > <apex:pageBlockSection title="Opportunity Basic Information" > <apex:InputField value="{!Opportunity.What_s_happening_today__c}"/> <apex:InputField value="{!Opportunity.What_do_I_want_to_achieve__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Opportunity Goal/Size" > <apex:inputField value="{!Opportunity.Stretegic_Objective__c}"/> <apex:inputField value="{!Opportunity.Quantity__c}"/> <apex:inputField value="{!Opportunity.Product__c}"/> <apex:inputField value="{!Opportunity.Amount}"/> </apex:pageBlockSection> </apex:outputPanel> <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> <apex:commandButton action="{!save}" value="Save" Style="margin-left: 350px;"/> <apex:commandButton action="{!Cancel}" value="Cancel" Style="margin-left: 20px;"/> </apex:pageblock> </apex:form> </apex:page>
would like page to look like as below (stabdard detail page)
Remove the below line in your code. That is a custom css that is making the ui looks absurd
You can use apex:detail for inline editing.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_detail.htm
Or If you want only few specific fields in your detail page than you can use lightning out
Note : This will be major code change
Aura Component OpportuityDetail
Aura App OpportuityDetailApp
Use lightning out on your vf page
When some uses the /apex/yourpagename?id=OpportunityId
Your output be like this
After Edit
Hope this helps!