• sgupta
  • NEWBIE
  • 165 Points
  • Member since 2013
  • Technical Architect

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 28
    Replies

Hi everyone,

 

I keep getting an error with my onclick javascript button, "Unexpected identifier".

 

Would anyone mind taking a look at my syntax and letting me know what could be wrong? Thanks so much!!!!!!

 

if ( '{!Opportunity.Active__c}' == '') 

alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 

else if ('{!Opportunity.Rx_OTC__c}' == '') 
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 


else if ('{!Opportunity.Project_phase__c}' == '') 
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 


else if ('{!Opportunity.Description}' == '') 
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 


else 

window.location = "/0Q0/e?&oppid={!Opportunity.Id}&ent=Quote&Name="Placeholder - Do Not Edit" 
&00NA0000004pyaC=1&ent=Quote 
&RecordType={!Opportunity.Quote_Record_Type__c} 
&retURL=/{!Opportunity.Id}"; 
}

Hello, 
I need to generate a nicely formatted PDF document that displays data for one contact record. The problem I am having is getting at the related objects/records - I've got about 10 objects attached to the Contact object for which I have to show all record data.  According to the VF guide (page 60, "Accessing Data With A Standard Controller"), which says

 

You can traverse one level of parent-to-child relationships. For example, if using the Account standard controller, you can
use {!account.Contacts} to return an array of all contacts associated with the account that is currently in context.

 

I thought I would be able to create arrays to feed into pageblock tables with the following syntax: {!contact>.<name_of_custom_object>} but I'm getting the error: "Error: Invalid field "object name" for SObject Contact"

 

Do I have to create custom controllers to get this done or am I missing something simple?

 

Thanks in advance for any help you may have, kumulan

Hi and thanks for your help...

 

The objective is:

 

Place a related list on the Opportunity Object.  It has to show a related list from a custom object called X.  The problem is opportunity is not related to Object X, but Account is.  Since opportunities are related to Accounts, is there a way to show the parent account information on a  related list?

 

Eric

 

 

System.CalloutException: IO Exception: Detect premature EOF

 

please help me on this

thanks

Hi Guys,

 

 I want to create a pdf of my vf page ,

 

 we can create like this way

 

pdfPage = page.product_delivery;//new PageReference('/apex/product_delivery1');
pdfPage.getParameters().put('id',oppid);
pdfPage.setRedirect(false);
Blob b=pdfPage.getContentAsPDF();

 

In my vf i am displaying some records with checkbox. When i click on Selected Button , It is displaying Selected Records.

 

I want to Create PDF for Selected Records only.

 

But it is Generating PDF for my intial VF page.. 

 

 

please suggest me..

 

 

 

prem

i have a problem saving multiple records at a time. i think the problem is in the saveSeats() i just don't get it. the data display fine in the pageblocktable but it doesn't save when i click the save button. any idea what's the problem here? please help.

Apex Class:
public with sharing class NewScheduleSeatsCX {
    List<Seat__c> seatList = new List<Seat__c>();    //saving seat records
    public List<SeatsWrapper> wrappers {get;set;}        //wrapperlist
    public List<Integer> numberOfSeats {get;set;}
   
    public Schedule__c sd {get;set;}
    public Schedule__c schedule {
      get {
        if (schedule == null)
          schedule = new Schedule__c();
        return schedule;
      }
      set;
    }

    public NewScheduleSeatsCX(ApexPages.StandardController controller) {
        wrappers = new List<SeatsWrapper>();
        numberOfSeats = new List<Integer>();
      
        sd=[select id, name, Number_Of_Seats__c from Schedule__c where id =: apexPages.currentPage().getParameters().get('id')];
        for(integer i=1;i<=sd.Number_Of_Seats__c; i++){
            SeatsWrapper temp = new SeatsWrapper();
            temp.seatNum = i;
            temp.seat = new Seat__c();
            wrappers.add(temp);
        }
    }
  
/**************    Wrapper    *************/
    public class SeatsWrapper {
 public Seat__c seat {get;set;}
 public Integer seatNum {get;set;}
    }
/**************    /Wrapper    *************/

//------------------------------   Save Seats     ------------------------------//
    public pageReference saveSeats() {
        try {
            for(SeatsWrapper  s : wrappers ) {
                    Seat__c newSeats = new Seat__c();
   
                    String seatName = newSeats.Name;
                    Integer sN = Integer.valueOf(seatName);
                   
                    sN = s.seatNum;
                    newSeats.Schedule__c = schedule.Id;
                    newSeats.Taken__c = s.seat.Taken__c;
                   
                    seatList.add(newSeats);
                }
                insert seatList;            //save all seats
          
        } catch(Exception e) {
            apexPages.addMessages(e);
        }
        return null;
    }
//------------------------------   /Save Seats     ------------------------------//
}

VF Page:
               <apex:pageBlockTable value="{!wrappers}" var="sched">
                         <apex:column headerValue="Seat #" style="padding: 0px 20px;">
                                     <apex:outputText value="{!sched.seatNum}"/>
                         </apex:column>
                         <apex:column headerValue="Taken" style="padding: 0px 20px;">
                                     <apex:inputField value="{!sched.seat.Taken__c}"/>
                         </apex:column>
                </apex:pageBlockTable>

  • January 02, 2014
  • Like
  • 0

Hi everyone,

 

I keep getting an error with my onclick javascript button, "Unexpected identifier".

 

Would anyone mind taking a look at my syntax and letting me know what could be wrong? Thanks so much!!!!!!

 

if ( '{!Opportunity.Active__c}' == '') 

alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 

else if ('{!Opportunity.Rx_OTC__c}' == '') 
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 


else if ('{!Opportunity.Project_phase__c}' == '') 
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 


else if ('{!Opportunity.Description}' == '') 
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated'); 


else 

window.location = "/0Q0/e?&oppid={!Opportunity.Id}&ent=Quote&Name="Placeholder - Do Not Edit" 
&00NA0000004pyaC=1&ent=Quote 
&RecordType={!Opportunity.Quote_Record_Type__c} 
&retURL=/{!Opportunity.Id}"; 
}

The following code compiles and then blows up on execution.  What I'm trying to do is filter out the lines that have a field Contract_Line_Item_Status__c = 'Do Not Renew'.

 

What ever I'm doing this VF page does not like the <apex:outputPanel tags.

 

Please let me know if you have any ideas on how to best resolve this.  Kudos to the person that helps me figure this one out.

 

<table border="1" style="border-color: #3B5E91" cellspacing="0" cellpadding="1" width="100%" id="table4">

<tr>
       <td bgcolor="#d7dee9" align="Left"><font face="Arial">Quantity</font></td>      
       <td bgcolor="#d7dee9" align="Center"><font face="Arial">APS Part No.</font></td>             
       <td bgcolor="#d7dee9" align="center"><font face="Arial">Product(s) Covered</font></td>
</tr>
<tr>
    
       <apex:repeat value="{!Contract.Service_Contract_Line_Items__r}" var="line">
       <apex:outputPanel rendered="{!IF(line.Contract_Line_Item_Status__c = 'Do Not Renew',false,true)}">
       
          <tr>
             <td align="Right">{!(ROUND(line.Quantity__c,0))}</td>
             <td align="Center">{!line.APS_Part_Number__c}</td>

             <td align="Left">{!line.Product_LU__r.name}</td>
          </tr>
       </apex:outputPanel>
       </apex:repeat>  
    
</tr>
</table>

 

Hello, 
I need to generate a nicely formatted PDF document that displays data for one contact record. The problem I am having is getting at the related objects/records - I've got about 10 objects attached to the Contact object for which I have to show all record data.  According to the VF guide (page 60, "Accessing Data With A Standard Controller"), which says

 

You can traverse one level of parent-to-child relationships. For example, if using the Account standard controller, you can
use {!account.Contacts} to return an array of all contacts associated with the account that is currently in context.

 

I thought I would be able to create arrays to feed into pageblock tables with the following syntax: {!contact>.<name_of_custom_object>} but I'm getting the error: "Error: Invalid field "object name" for SObject Contact"

 

Do I have to create custom controllers to get this done or am I missing something simple?

 

Thanks in advance for any help you may have, kumulan

I am trying to capture an element from an external webpage and display it on a visualforce page whenever the text value in a field exists as a value for the external webpage. For example, if I type "GOOG" in the text field, then the page should render the current price for Google's stock.

 

Here are the details of the task:

1. Create a field to enter the ticker symbol of a stock.

2. Use the inputted ticker symbol to render a call to Google Finance or Yahoo! Finance.

3. Return the quoted price on the webpage to the visualforce page in a field.

4. The page should rerender the current price every 10 seconds.

 

I currently have the following object and fields:

Object: Stock_SC__c

 

Fields:

1. Ticker_Symbol_SC__c = text field to capture the desired ticker symbol.

2. Google_Finance_Link_SC__c = formula field that concatenates the base website URL (http://www.google.com/finance?q=) and Ticker_Symbol_SC__c text field.

3. Yahoo_Finance_Link_SC__c = formula field that concatenates the base website URL (http://finance.yahoo.com/q?s=) and Ticker_Symbol_SC__c text field.

 

The element of Google finance that stores the current price is "<span id="ref_694653_l">1,033.89</span>." For Yahoo! Finance, the element is "<span id="yfs_l84_z">73.06</span>."

 

Any help is appreciated!

  • November 25, 2013
  • Like
  • 0

Hi and thanks for your help...

 

The objective is:

 

Place a related list on the Opportunity Object.  It has to show a related list from a custom object called X.  The problem is opportunity is not related to Object X, but Account is.  Since opportunities are related to Accounts, is there a way to show the parent account information on a  related list?

 

Eric

 

 

Hi,
I have created a visualforce email template. The body of this template contains some text and few merge fields linked to custom object. I am able read the data using merge fields successfully.


But this custom object also allows users to attach files. So I need to send those attached files (if any) with the same email.


I have tried different options but none of them worked for me. Now for time being what i did is that i added a custom component in my mail body and that custom component has a apex:repeat control that gives the link and content type of attachments in a tabular format. Below is my custom component:


<table cellpadding="1" cellspacing="0" width="100%" border="1">

    <tr><td colspan="2"><b>Attachments</b></td></tr>

    <tr><td><b>File Name</b></td>         <td><b>Content Type</b></td></tr>

    <apex:repeat value="{!attachments}" var="attachment">

     <tr>

         <td><apex:outputLink value="https://c.cs17.content.force.com/servlet/servlet.FileDownload?file={!attachment.Id}">          {!attachment.name}</apex:outputLink></td>

         <td>{!attachment.contentType}</td>

     </tr>

    </apex:repeat>

</table>


But the above solution requires the user to be connected to the internet and login to salesforce to access the attachments since the files are not physically attached to mail.


Do we have any way through which we can read attachments from attachment table and send as attachments using visualforce email templates. Also there may be 1 or more than one attachment.

 

Thanks,

Vicky

Hi,

I have overriden the delete link of a custom object to redirect to a custom vf page. The custom page shows the members associated with the custom object. When members are associated delete is not possible - user has to remove members and then delete the record of custom object. The problem is when there are no members associated with the object even then user is redirected to custom page. I need to have a control on redirect such that, only when members are associated, redirect happens and when members are not associated redirect should not happen and selected record should be deleted.

Any solution would be appreciated.

System.CalloutException: IO Exception: Detect premature EOF

 

please help me on this

thanks

Hi Guys,

 

 I want to create a pdf of my vf page ,

 

 we can create like this way

 

pdfPage = page.product_delivery;//new PageReference('/apex/product_delivery1');
pdfPage.getParameters().put('id',oppid);
pdfPage.setRedirect(false);
Blob b=pdfPage.getContentAsPDF();

 

In my vf i am displaying some records with checkbox. When i click on Selected Button , It is displaying Selected Records.

 

I want to Create PDF for Selected Records only.

 

But it is Generating PDF for my intial VF page.. 

 

 

please suggest me..

 

 

 

prem

Hi I am new to salesforce, so think this will be an elementary question.

 

The scenario is On Saving a VF form page a pop up has to populate having a value (which was entered in one of the field of VF form). Need help how to get this dynamic value in popup message?