• Geniuan
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 13
    Replies
i want  to update my output panel after checking the chckbox but i am unable to do it  . help me.

<apex:page controller="test2">
<apex:form >
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!country}"></apex:selectOptions>
<apex:actionSupport reRender="zip" event="onchange" action="{!test}"/>
</apex:selectCheckboxes>
<apex:outputPanel id="zip">
hello  {!name}
</apex:outputPanel>
</apex:form>
</apex:page>

--------------------------------------------
public class test2 {
public string countries{get;set;}
  public string name {get;set;}

    public test2()
    {
      counter = 0;
    }

public list<selectoption> getcountry()
{
    list<selectoption>options = new list<selectoption>();
       options.add(new selectoption('india','india'));
      
       return options;
}

   public pageReference test()
   {
     if(countries == 'India')
     {
       name= ' kumar';
      }
      return null;
   }
}

Hi, I'm creating this VF page using inlineEdit. After saving I need it to go back to the VF page so I'm using the actionfunction save instead the save button. Now something is not good because sometimes the information is saved but most of them it's not. Usually it saves the first time the page is loaded, then, it shows like the change is done but doing refresh shows that it wasn't done because the old data comes back.


<apex:page standardController="Contact" sidebar="false" showHeader="false">
<style type="text/css">
    .cols {text-align:center;}
    .col75{width:75%;text-align:left;}
    .col50c{width:50%;text-align:center;}
    .col50{width:50%;text-align:left;}
    .col25{width:25%;text-align:center;}
    .col25g{width:25%;text-align:center;background:#dddddd;}
    .rowsl {text-align:left;font-weight:bold}
    .rowsc {text-align:center;}
</style>
<apex:form >
<apex:pageblock title="" mode="inlineEdit">
      <apex:pageBlockButtons >
                <apex:actionFunction name="saveActionFunc" action="{!save}" oncomplete="redirectBack()"/>
                <apex:commandButton onclick="saveActionFunc();" id="saveButton" value="Save" style="display: none;"/>
      </apex:pageBlockButtons>
      <apex:pageBlockSection title="Tittle 1" columns="1">
<apex:panelGrid columns="3" rowClasses="rowsl,rowsc" id="box1" border="1" frame="below" rules="cols" width="100%" bgcolor="#ffffff">
<apex:outputText value="Names"/>
<apex:outputText value="Partner"/>
<apex:outputText value="Address"/>
<apex:outputfield value="{!contact.Ref_Name__c}">
<apex:inlineEditSupport showOnEdit="saveButton" hideOnEdit="" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit()"/></apex:outputField>
<apex:outputfield value="{!contact.Ref_Name_1__c}"/>
<apex:outputfield value="{!contact.Ref_Name_Direccion_1__c}"/>
 </apex:panelGrid>
      </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>

Any suggestion?

i want  to update my output panel after checking the chckbox but i am unable to do it  . help me.

<apex:page controller="test2">
<apex:form >
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!country}"></apex:selectOptions>
<apex:actionSupport reRender="zip" event="onchange" action="{!test}"/>
</apex:selectCheckboxes>
<apex:outputPanel id="zip">
hello  {!name}
</apex:outputPanel>
</apex:form>
</apex:page>

--------------------------------------------
public class test2 {
public string countries{get;set;}
  public string name {get;set;}

    public test2()
    {
      counter = 0;
    }

public list<selectoption> getcountry()
{
    list<selectoption>options = new list<selectoption>();
       options.add(new selectoption('india','india'));
      
       return options;
}

   public pageReference test()
   {
     if(countries == 'India')
     {
       name= ' kumar';
      }
      return null;
   }
}

Hi, I'm creating this VF page using inlineEdit. After saving I need it to go back to the VF page so I'm using the actionfunction save instead the save button. Now something is not good because sometimes the information is saved but most of them it's not. Usually it saves the first time the page is loaded, then, it shows like the change is done but doing refresh shows that it wasn't done because the old data comes back.


<apex:page standardController="Contact" sidebar="false" showHeader="false">
<style type="text/css">
    .cols {text-align:center;}
    .col75{width:75%;text-align:left;}
    .col50c{width:50%;text-align:center;}
    .col50{width:50%;text-align:left;}
    .col25{width:25%;text-align:center;}
    .col25g{width:25%;text-align:center;background:#dddddd;}
    .rowsl {text-align:left;font-weight:bold}
    .rowsc {text-align:center;}
</style>
<apex:form >
<apex:pageblock title="" mode="inlineEdit">
      <apex:pageBlockButtons >
                <apex:actionFunction name="saveActionFunc" action="{!save}" oncomplete="redirectBack()"/>
                <apex:commandButton onclick="saveActionFunc();" id="saveButton" value="Save" style="display: none;"/>
      </apex:pageBlockButtons>
      <apex:pageBlockSection title="Tittle 1" columns="1">
<apex:panelGrid columns="3" rowClasses="rowsl,rowsc" id="box1" border="1" frame="below" rules="cols" width="100%" bgcolor="#ffffff">
<apex:outputText value="Names"/>
<apex:outputText value="Partner"/>
<apex:outputText value="Address"/>
<apex:outputfield value="{!contact.Ref_Name__c}">
<apex:inlineEditSupport showOnEdit="saveButton" hideOnEdit="" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit()"/></apex:outputField>
<apex:outputfield value="{!contact.Ref_Name_1__c}"/>
<apex:outputfield value="{!contact.Ref_Name_Direccion_1__c}"/>
 </apex:panelGrid>
      </apex:pageBlockSection>
    </apex:pageBlock>
  </apex:form>
</apex:page>

Any suggestion?

Hello

 

I have a Visualforce page embedded in an iframe into another visualforce page (see below), the iframed page is a PDF.

When I click the custom button, the fields in the PDF are empty, but when I save the PDF into "Notes & Attachments", the PDF is populated with the information from the record...

I know that I need to pass variable from the parent, but what needs to be done? 

 

Custom Button: /apex/PdfGeneratorTemplate?id={!Monthly_Cloud_Bill__c.Id}

 

Class:

 

public with sharing class PdfGeneratorController {


  String parentId = ApexPages.currentPage().getParameters().get('id');


  Monthly_Cloud_Bill__c MCB = [SELECT Account__r.Id, Account__r.Name from Monthly_Cloud_Bill__c WHERE Id = :parentId];
  Account acc = MCB.Account__r;
  String AccountName = acc.Name;
  String AccountId = acc.Id;
  
   
 public PageReference savePdf() {
 
    //PageReference pdf = Page.PdfGeneratorTemplate;
    PageReference pdf = Page.InvoicePDF2;
    // add parent id to the parameters for standardcontroller
    pdf.getParameters().put('id',parentId);
 
    // create the new attachment
  Attachment attach = new Attachment();
 
    // the contents of the attachment from the pdf
    Blob body;
 
    try {
 
        // returns the output of the page as a PDF
        body = pdf.getContent();
 
    // need to pass unit test -- current bug    
    } catch (VisualforceException e) {
        body = Blob.valueOf('Some Text');
    }
 
    attach.Body = body;
    // add the user entered name
    attach.Name = AccountName + '.pdf';  
    attach.IsPrivate = false;
    // attach the pdf to the account
    attach.ParentId = parentId;
    insert attach; 
        
 
    // send the user to the account to view results
    //return new PageReference('/'+parentId);
    return new PageReference('/'+'flow/Email_Cloud_Invoice?MBCID='+parentId + '&AccountID='+AccountId + '&AttachmentID='+doc.id+ '&retURL='+parentId);
 
  }    
 
}

 

Iframe PDF:

<apex:page standardController="Monthly_Cloud_Bill__c" showHeader="false" renderas="pdf"> 

<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
    <td align="right">       <img src='{!URLFOR($Resource.Logo)}' title="logo" />
     <br/>
     <img src='{!URLFOR($Resource.InvoiceLogo)}' title="logo" />
       </td>
    
</tr>



</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>    <td>
        <font face="Arial" >

        <apex:outputText value="{!Monthly_Cloud_Bill__c.Company_Address__c}" escape="false"/> 
        
        </font></td> 
        <td width="50%"></td>
   <td ><font face="Arial">Invoice Date:<apex:OutputField value="{!Monthly_Cloud_Bill__c.Create_Date__c}"/> <br/>
        Invoice #: {!Monthly_Cloud_Bill__c.Name}<br/> 
        Billing Period: {!Monthly_Cloud_Bill__c.Billing_Period__c}  <br/> 
        Customer ID: {!Monthly_Cloud_Bill__c.Account__r.Customer_ID__c} <br/>
       </font>
     </td>
</tr>
</table>

<p><b><font face="Arial" color="#000080">Customer Information</font></b></p>

<table border="0" width="100%" id="table2">
<tr>
       <td colspan="3">
           <font face="Arial">{!Monthly_Cloud_Bill__c.Account__r.Name} <br/></font>
       </td>
</tr>
<tr>
       <td>          
           <font face="Arial">Attn: {!Monthly_Cloud_Bill__c.Contact__r.Name}<br/>
           
                             {!Monthly_Cloud_Bill__c.Account__r.BillingStreet}<br/>
                             {!Monthly_Cloud_Bill__c.Account__r.BillingCity}, {!Monthly_Cloud_Bill__c.Account__r.BillingState} {!Monthly_Cloud_Bill__c.Account__r.BillingPostalCode} <br/>
                             {!Monthly_Cloud_Bill__c.Account__r.BillingCountry} <br/>
                             Tel: {!Monthly_Cloud_Bill__c.Contact__r.Name}
           </font>
        </td>

</tr>    
</table>

<p><b><font color="#000080" face="Arial">Order Description</font></b></p>
<table border="1" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Product</font></td>
       <td bgcolor="#C0C0C0" align="center"><font face="Arial">Price</font></td>
       <td bgcolor="#C0C0C0" align="center"><font face="Arial">Units</font></td>       
       <td bgcolor="#C0C0C0" align="center"><font face="Arial">Amount</font></td> 
</tr>
<tr>
       
             <td>Product</td>
             <td align="center"> {!Monthly_Cloud_Bill__c.Price__c}</td>  
             <td align="center">{!Monthly_Cloud_Bill__c.Net_Usage_For_Billing__c}</td>             
             <td align="center"><apex:OutputField value="{!Monthly_Cloud_Bill__c.Billing_Amount__c}"/></td> 
          </tr>
         

<tr>
       <td bgcolor="#C0C0C0" align="right" colspan="6">
       <font face="Arial"><b>Total Due:</b><apex:OutputField value="{!Monthly_Cloud_Bill__c.Billing_Amount__c}"/></font></td>
</tr>
</table>

<p><b><font color="#000080" face="Arial">Payment Instructions</font></b></p>
<table border="0" width="100%" id="table3">
 <tr>
       <td><font face="Arial">
        
             1. Payment is due in full 30 days from the INVOICE DATE <br/>
             2. Overdue payments will be subject to a charge of 1% per month <br/>
             3. Payment is accepted by wire transfer, check or credit card: 
            </font>
        </td>
   
   <br/>

</tr> 



<table border="0" width="100%" id="table4">
<!--<tr>
       <td colspan="3">
           
       </td>
</tr> -->
<tr>
       <td>          
           <font face="Arial"><b>Wire transfer instructions:</b><br/>
                             
                           <apex:OutputField value="{!Monthly_Cloud_Bill__c.Wire_transfer_instructions__c}"/>
           </font>
        </td>
    <!--    <td width="1%"></td> -->
        
        <td>
           <font face="Arial"><b>Check payment instructions:</b><br/>
                            <apex:OutputField value="{!Monthly_Cloud_Bill__c.Check_payment_instructions__c}"/>
           </font>
        </td>
        
      
</tr>    
</table>

</table>

<hr/>
<p align="center"><font face="Arial">If you have any question about this invoice, please contact. <br/>
{!Monthly_Cloud_Bill__c.Account__r.Owner.FirstName} {!Monthly_Cloud_Bill__c.Account__r.Owner.LastName}, {!Monthly_Cloud_Bill__c.Account__r.Owner.Phone}, {!Monthly_Cloud_Bill__c.Account__r.Owner.Email} <br/> <br/>
<b>Thank You For Your Business!</b>
</font></p>

</apex:page>

 

Parent Visualforce:

<apex:page controller="PdfGeneratorController">

   <apex:form >  
    
   <apex:pageBlock title="PDF Input">  
 
      <apex:pageBlockButtons >
        <apex:commandButton action="{!savePdf}" value="Save PDF"/>
      </apex:pageBlockButtons>
      <apex:pageMessages />
 
 <iframe height="600px" id="Page" name="InvoicePDF" src="/apex/InvoicePDF2" width="100%"></iframe>
 
    </apex:pageBlock> 
  </apex:form>
    
    
</apex:page>

 

Many Thanks!

 

Itay

how exactly paypal and salesforce integrates???

Here is a requrement from client: 

 

 

In one line I need: field name, filed itself, and button.

This must be fitted inside one column of: <apex:pageBlockSection columns="2" >

 

So I came up with this:

 

<apex:pageBlockSectionItem >
    <apex:inputField label="Activation Counter" id="activationCounter" value="{!object.field__c}"/>
    <apex:commandButton value="Reset"/>
</apex:pageBlockSectionItem>

 which results in missing label:

 

So I wanted to add field label like this:

 

<apex:pageBlockSectionItem >
    <apex:outputLabel value="Activation Counter" for="activationCounter"/>
    <apex:inputField label="Activation Counter" id="activationCounter" value="{!object.field__c}"/>
    <apex:commandButton value="Reset"/>
</apex:pageBlockSectionItem>

 an now getting error:

 

Error: <apex:pageBlockSectionItem> may have no more than 2 child components

 

Is there a way to get it working together?

I'm trying to use ISPICKVAL to conditionally render part of my visualforce page. I want to show a pageBlockSectionItem if the value of Asset_Type__c is "Publications". Here is my code:

 

<apex:inputField required="true" value="{!Digital_Asset__c.Asset_Type__c}" />
<apex:pageBlockSectionItem rendered="{!ISPICKVAL(Asset_Type__c, 'Publications')}"><apex:inputField required="true" value="{!Digital_Asset__c.Publication_Title__c}" /></apex:pageBlockSectionItem>

 

 

The error I'm getting is:

Error: Unknown property 'Digital_Asset__cStandardController.Asset_Type__c' 

 

I've also tried using {!ISPICKVAL(Digital_Asset__c.Asset_Type__c, 'Publications')} in the rendered block, but then I get: Error: Incorrect parameter for function 'ISPICKVAL()'. Expected Picklist, received Text.

 

What am I missing here?

 

I need to get a integer value with leading zero in apex code
decimal Suff=20.0;
list <string> ListS = new String[2];
ListS[0]='{###}';
ListS[1]='{000}';
system.debug(' -- DEBUG '+string.format(string.valueof(Suff),ListS));

 

printed in system console  "20.0"  

 

  • January 26, 2011
  • Like
  • 0

Hi,

 

Is it possible to use multiple standard controller in a VF page..

 

i.e. something like this..

<apex:page standardController="Quote" standardController="Account"

 

 

 

Thanks,

Del

Hi Guys,

 

I am using windows7 - 64 bit and office 2010 beta .. just check out the error and suggest what can be done ...

 

Error is as follows: The code in this project must be updated for use on 64 bit system.Please review and update Declare statements and then mark them with the PtrSafe attribute.

 

 

 

Thanks in Advance

Has anyone come up with a way to automatically generate a user activity, upon having a lead assigned to them.
I can see where this could get out of control in a firm that generates large numbers of leads.
We do not.
Rather than have my inside sales people constantly monitor their leads page, I would like a new high-prioriy activity to follow-up be created.