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

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>
| improve this answer | |
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>
| improve this answer | |
  • Awesome! I'm glad it helped. – Brad B Dec 3 '14 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.