• Chief__c
  • 0 Points
  • Member since 2009

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2

Hi all -

I'm struggling with how to set a date field to today() using a custom button's on click javascript.


I'm using the button to set the value of two picklist values, set a date field to Today() and set a second date field to Today()+180.


When I first wrote it and tested it earlier in the week, it was executing but was setting the wrong dates. Today it just errors out.



{!requireScript("/soap/ajax/13.0/connection.js")} var QR= new sforce.SObject("Quote_Request__c"); QR.id = "{!Quote_Request__c.Id}"; var temp_dev_date=new Date(); temp_dev_date.setDate({!TODAY()}) var temp_val_date=new Date(); temp_val_date.setDate({!TODAY()}+180) QR.Delivered_Date__c=temp_dev_date; QR.Validity_Date__c=temp_val_date; QR.Customer_Requirements__c="Test update of auto close button."; QR.Status__c="Closed - Completed"; QR.Stage__c="Delivered"; var result = sforce.connection.update([QR]); if (result[0].getBoolean("success")) { // Refresh window window.location.reload(); } else { alert("something broke"); }


Appreciate any guidance or other approaches that could be used to accomplish this.


I have created a table in VF page(rendered as PDF),  where it displays certain records with header info.

I am not able to fix the length of the Column in a static manner.


<apex:column width="200px">

<apex:facet name="header"><b>{!$ObjectType.account.fields.Customer_Rating__c.label}</b></apex:facet>

<apex:outputText value="{!accounts.Customer_Rating__c }" styleClass="title"/>



Here even if I mention the width as 200px, the header should be limited to 200 only and not being increased since the retrieved label is more than 200.

If the retrieved header is more than 200, it should display in the next line. 

Any kind of pointers would really help me.



  • April 06, 2009
  • Like
  • 0