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
Benedict Yeo 6Benedict Yeo 6 

Setting which fields are visible on the creation page

Hi, I am trying to set which fields are visible and which are not on the Orders creation page. From what I see, whatever is set in the page layout to display will be reflected in the creation page, which is not what I want. For example, there is a field that we have that will only be filled after synchronising the order with our ERP system, but it's appearing in the creation page. Also, we are going to do a workflow to pull the Billing and Shipping Addresses from the Account, so I don't want to display those fields in the creation page.

Is there any way to hide these fields? Thanks!
Suneel#8Suneel#8
You can use rendered attirbute on the outputfield attribute to dynamically change the visibility of the field on page as below
<apex:outputField value="{!opportunity.name}"  rendered="{!Country!=null}"/>

 
Benedict Yeo 6Benedict Yeo 6
Hi @Suneel#8, unfortunately I don't understand what you mean.. Can you give me an example of how it's done?
Suneel#8Suneel#8
The markup I gave applies if your creation page is a VF page,not standard page layout.If you want to prevent the user from editing the field at the time of creation,you can set a validation rule like below and throw error saying that this field cannot be set by him.If you need to make the field invisible only at the time of creation you need to override the New button on the page and add the tag I provided.But it requires more effort and is not recommended.You can achieve the same with validation rule.

AND( ISNEW(), NOT(ISBLANK(Site)) )