• soltrain
  • NEWBIE
  • 21 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

 The use case is the generation of an invoice from a modified Opportunity. One of the required fields on the invoice is a custom field called “Fill Date/Time” which is of the a date datatype.

 

The issue is that the user enters a Fill Date/Time on the opportunity screen in Pacific Time (eg: 9/30/2011 2:44PM), however when the invoice is generated, the Time appears as GMT (eg: 9/30/2011, 21:44:00 GMT).

 

The invoice is generated as a PDF via a Visualforce page – I have copied the relevant code below:

 

<tr>

    <td></td>

        <td width="70%">Fill Date/Time:

               <apex:outputText value="{0,date,MM'/'dd'/'yyyy, HH:mm:ss z}">

                <apex:param value="{!Opportunity.Fill_Date_Time__c}"/>

        </apex:outputText> </td>   

</tr>

<tr>

<td></td>

 

 

I'm new to coding and have referenced the pages below but still don't understand how to fix this. Do I need to save the Opportunity.Fill_Date_Time to some new variable and then format that? Thanks for your help!

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_datetime.htm

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_outputText.htm

Hi all - 

 

   I am attempting to edit a visualforce page from the "Simple Quotes" application from appexchange. My question is much like one that was asked previously here: http://boards.developerforce.com/t5/General-Development/Error-Invalid-field-Contact-for-SObject-Opportunity/td-p/160764

 

I'm attempting to use the Opportunity object to store information about orders. The object already includes a lookup for Account, but it did not include a lookup for a Contact, the person who would have placed the order. 

 

I added a lookup field for Contact in the Opportunity object and want to reference it in a visual force page that generates a printable quote. Here is the code:

 

Account Information

Account name: {!Opportunity.Account.Name}  ---> Works as expected

 

Customer Information

Customer Name: {!Opportunity.Contact__c}   ---> This displays what looks to be an internal database ID instead of a name

Customer Name: {!Opportunity.Contact.Name}  ----> This returns the error: Error: Invalid field Contact for SObject Opportunity

 

I don't understand why Opportunity.Contact.Name does not work as expected. It seems both the Account and Contact are both lookup relationships to Opportunity. The advice in the other thread was to query the OpportunityContactRole object, but I've never heard of this object - is it hidden from the list of objects viewable from the web interface? I've added a custom lookup field to Contact, if I query this OpportunityContactRole, will it return the same result as what the user selects in the lookup field?

 

Thanks for your help!

 The use case is the generation of an invoice from a modified Opportunity. One of the required fields on the invoice is a custom field called “Fill Date/Time” which is of the a date datatype.

 

The issue is that the user enters a Fill Date/Time on the opportunity screen in Pacific Time (eg: 9/30/2011 2:44PM), however when the invoice is generated, the Time appears as GMT (eg: 9/30/2011, 21:44:00 GMT).

 

The invoice is generated as a PDF via a Visualforce page – I have copied the relevant code below:

 

<tr>

    <td></td>

        <td width="70%">Fill Date/Time:

               <apex:outputText value="{0,date,MM'/'dd'/'yyyy, HH:mm:ss z}">

                <apex:param value="{!Opportunity.Fill_Date_Time__c}"/>

        </apex:outputText> </td>   

</tr>

<tr>

<td></td>

 

 

I'm new to coding and have referenced the pages below but still don't understand how to fix this. Do I need to save the Opportunity.Fill_Date_Time to some new variable and then format that? Thanks for your help!

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_datetime.htm

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_outputText.htm

Hi all - 

 

   I am attempting to edit a visualforce page from the "Simple Quotes" application from appexchange. My question is much like one that was asked previously here: http://boards.developerforce.com/t5/General-Development/Error-Invalid-field-Contact-for-SObject-Opportunity/td-p/160764

 

I'm attempting to use the Opportunity object to store information about orders. The object already includes a lookup for Account, but it did not include a lookup for a Contact, the person who would have placed the order. 

 

I added a lookup field for Contact in the Opportunity object and want to reference it in a visual force page that generates a printable quote. Here is the code:

 

Account Information

Account name: {!Opportunity.Account.Name}  ---> Works as expected

 

Customer Information

Customer Name: {!Opportunity.Contact__c}   ---> This displays what looks to be an internal database ID instead of a name

Customer Name: {!Opportunity.Contact.Name}  ----> This returns the error: Error: Invalid field Contact for SObject Opportunity

 

I don't understand why Opportunity.Contact.Name does not work as expected. It seems both the Account and Contact are both lookup relationships to Opportunity. The advice in the other thread was to query the OpportunityContactRole object, but I've never heard of this object - is it hidden from the list of objects viewable from the web interface? I've added a custom lookup field to Contact, if I query this OpportunityContactRole, will it return the same result as what the user selects in the lookup field?

 

Thanks for your help!