2

On my account layout, one of the sections has a visualforce component in there that will only appear if another field on the account layout has a value in it. When there is no value it displays a HTTP 400 error because there is no data to grab. Is there a way that this section could be hidden or have a custom message if that field is empty?

I tried the following:

<apex:page standardController="Account" sidebar="false" >

IF({"!Account.Most_Recent_Order_Updated__c != null")
<Script>
window.onload = function AutoPostForm(){
  document.forms['Submit_Post'].submit()

  }
   </script>


    <form action="https://atlas.localedge.com/workflowbanner/rest/orderstatus" method="POST" Name="Submit_Post"  id="Submit_Post" rendered="{!Account.Most_Recent_Order_Updated__c!=null}">


<input name="apiKey" value="LocalEdge"/>
<input name="orderId" value="{!Account.Most_Recent_Order_Updated__c}"/>
  <input type="submit" value="Submit" />




 </form>
</apex:page>

2 Answers 2

2

Have you tried the following...

<apex:page standardController="Account" sidebar="false" >

    <apex:outputPanel layout="block" rendered="{!Account.Most_Recent_Order_Updated__c != null}">

        <!-- your form here -->

    </apex:outputPanel>

</apex:page>
0
0

@BradBumbalough that worked. Here was my final page:

<apex:page standardController="Account" sidebar="false" >


 <apex:outputPanel layout="block" rendered="{!Account.Most_Recent_Order_Updated__c != null}">

 <Script>
window.onload = function AutoPostForm(){
  document.forms['Submit_Post'].submit()

  }
   </script>

    <form action="https://atlas.localedge.com/workflowbanner/rest/orderstatus" method="POST" Name="Submit_Post"  id="Submit_Post" >


<input name="apiKey" value="LocalEdge"/>
<input name="orderId" value="{!Account.Most_Recent_Order_Updated__c}"/>
  <input type="submit" value="Submit" />




     </form>
 </apex:outputPanel>
</apex:page>
1
  • Awesome! I'm glad it helped.
    – BradByte
    Dec 3, 2014 at 20:07

You must log in to answer this question.

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