• sf.dev.ax1103
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 33
    Replies

Hi All,

 

      What is best way for a non salesforce user to enter some info on site.And also user needs to be authenticated before he enters some info.Any Idea how this can be acheived?

 

Thanks

Hi All,

 

        Custom Component Name looks different from Standard Component Name.Salesforce seems to have picked the incorrect h tag for custom home page components.  Custom component headers are rendered between <h2> tags while standard component headers use the <h3> tag.  This makes custom components look really foreign on the home page. Is there any way to make it look similar.

 

Thanks

Hi All,

 

     Any Idea of how to create pagination in custom related list.Here is my page and class. I need to display 5 oppty records.If there are more than 5 records then i need to show a link  Show More link which goes to next page and displays all records like below.

 



 

 

<apex:page standardController="Contact" extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form >
 <apex:pageMessages />
 <apex:detail relatedList="false"></apex:detail>
<apex:pageblock id="CustomList" title="Related Opportunities"  >
   <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
        <apex:column value="{!o.Name}"/>
        <apex:column value="{!o.Account.Name}"/>
        <apex:column value="{!o.Type}"/>
       <apex:column value="{!o.Amount}"></apex:column>
       <apex:column value="{!o.CloseDate}"/>
   </apex:pageBlockTable>
   <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel>
 </apex:pageblock>
</apex:form>
</apex:page>

 

 

 

public class sampleDetailPageCon {
    private List<Opportunity> oppz;
    private Contact cntact;
    public sampleDetailPageCon(ApexPages.StandardController controller) {
        this.cntact= (Contact)controller.getRecord();
    }
    public List<Opportunity> getOppz()
    {
        Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];
        if (con.Account == null)
         return null;
        oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];
        return oppz;
    }
}

 

Thanks



Hi All,

 

     Any Idea of how to create pagination in custom related list.Here is my page and class. I need to display 5 oppty records.If there are more than 5 records then i need to show a link  Show More link which goes to next page and displays all records like below.

 



 

 

<apex:page standardController="Contact" extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form >
 <apex:pageMessages />
 <apex:detail relatedList="false"></apex:detail>
<apex:pageblock id="CustomList" title="Related Opportunities"  >
   <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
        <apex:column value="{!o.Name}"/>
        <apex:column value="{!o.Account.Name}"/>
        <apex:column value="{!o.Type}"/>
       <apex:column value="{!o.Amount}"></apex:column>
       <apex:column value="{!o.CloseDate}"/>
   </apex:pageBlockTable>
   <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel>
 </apex:pageblock>
</apex:form>
</apex:page>

 

 

 

public class sampleDetailPageCon {
    private List<Opportunity> oppz;
    private Contact cntact;
    public sampleDetailPageCon(ApexPages.StandardController controller) {
        this.cntact= (Contact)controller.getRecord();
    }
    public List<Opportunity> getOppz()
    {
        Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];
        if (con.Account == null)
         return null;
        oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];
        return oppz;
    }
}

 

Thanks

Hi,

        I need to display related opportunities for first 5 records.if there are more than 5 records i need a link to show more records in next page.I need similar pagination how default salesforce provides for a related list.Can you please help me in this.

 

 

<apex:page standardController="Contact" extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form >
<apex:pageMessages />
<apex:detail relatedList="true"></apex:detail>
<apex:pageblock id="CustomList" title="Related Opportunities" >
<apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
<apex:column value="{!o.Name}"/>
<apex:column value="{!o.Account.Name}"/>
<apex:column value="{!o.Type}"/>
<apex:column value="{!o.Amount}"></apex:column>
<apex:column value="{!o.CloseDate}"/>
</apex:pageBlockTable>
<apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel>
</apex:pageblock>
</apex:form>
</apex:page>



public class sampleDetailPageCon {
private List<Opportunity> oppz;
private Contact cntact;
public sampleDetailPageCon(ApexPages.StandardController controller) {
this.cntact= (Contact)controller.getRecord();
}
public List<Opportunity> getOppz()
{
Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];
if (con.Account == null)
return null;
oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];
return oppz;
}
}



  Thanks



Hi All,

 

       I need to get export of all attachments from Case Object where Case Status is closed.Any Help plz.

 

 

Thanks

Hi All,

 

        I need to get the zip file of all attachments from case object where case status is closed.I tried using export wizard but no hope. Any help of how to extract zip file of all attachments.

 

Thanks

Hi All,

 

          I am using list button of opportunity from console view.This list button does mass update on selected opportunities.On click of list button from console opens vf page and does some operation and save of vf page has to refresh my console.I am using javascript to refresh.It works fine from list view but not from console view.

 

parent.window.opener.location.href = url

 

Any help.

 

Thanks

Hi All,

 

         My class is not getting covered in below red lines.Any help in fixing in test class

 

public class Web2LeadExtension {

 
  
    public Lead wlead{
    get {
      if (wlead== null)
        wlead= new Lead ();
        return wlead;
    }
    set;
  }
  
    public Web2LeadExtension(ApexPages.StandardController
                                stdController) {
       wlead = (Lead)stdController.getRecord();
     }

     public PageReference saveLead() {
       try {
       insert(wlead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.mypage;
       return p;
     }
}

 

 

 

@isTest private class testLeadClass{


static testmethod void saveLeadTest(){
        
     
         Lead l = new Lead(company='test company',lastname='xyz');
         test.starttest();

 


         Web2LeadExtension ext = new Web2LeadExtension(new ApexPages.StandardController(l));

 

PageReference p = ext.saveLead();
         test.stoptest();

 

system.assertEquals(Page.mypage.getUrl(),p.getUrl());
        
      }

}

Thanks

Hi All,

 

     I have similar requirement   http://success.salesforce.com/ideaview?id=08730000000BqvrAAC

  I think dependency can be done using javascript.Any help on code plz?

Hi All,

 

       Has anyone been able to implement dependent picklists on either web to case or web to lead pages? 

 

Thanks

Hi All,

 

     I need to display standard help text on force.com sites.Any Help plzz?

 

<apex:page standardController="Request__C" extensions="RequestCtrl" showHeader="false" sidebar="false" >
<apex:pagemessages />
<apex:form >
<apex:pageBlock >

<apex:pageBlockSection title="INFORMATION" columns="2">
<apex:inputField value="{!Request__c.What_is_your_age__c}"/>

<apex:pageBlockSectionItem HelpText="{$ObjectType.Request__c.fields.Name__c.inlineHelpText}">

<apex:inputText value="{!Request__c.Name__c}"/>
</apex:pageBlockSectionItem>


</apex:pageBlockSection>

<apex:pageBlockSection columns="2">
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>
</apex:page>





Hi All,

  

               I am trying to use sites to post my web to lead form.Is it possible to convert below html code to visualforce  Any help plz. Below is my web to lead form

 

 


<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="00DT0000000KVU">
<input type=hidden name="retURL" value="http://">

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: These fields are optional debugging elements.  Please uncomment   -->
<!--  these lines if you wish to test in debug mode.                          -->
<!--  <input type="hidden" name="debug" value=1>                              -->
<!--  <input type="hidden" name="debugEmail"                                  -->
<!--  value="sai@sftech.com">                               -->
<!--  ----------------------------------------------------------------------  -->

<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>

<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="company">Company</label><input  id="company" maxlength="40" name="company" size="20" type="text" /><br>

<label for="city">City</label><input  id="city" maxlength="40" name="city" size="20" type="text" /><br>

<label for="state">State/Province</label><input  id="state" maxlength="20" name="state" size="20" type="text" /><br>

<input type="submit" name="submit">

</form>

 

 

Thanks

Hi All,

        

    I need to get the count of closedcases with an attachments. so for this I tried using following query but no hope.

 

        Select a.Id,a.ParentId From Attachment a where a.ParentId like '500%' 

 

Any help plz

Hi,

 

     I need to create multiple contact records from vf page.Any code plzz?

 

Thanks

Hi All,

 

     Any Idea of how to create pagination in custom related list.Here is my page and class. I need to display 5 oppty records.If there are more than 5 records then i need to show a link  Show More link which goes to next page and displays all records like below.

 



 

 

<apex:page standardController="Contact" extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form >
 <apex:pageMessages />
 <apex:detail relatedList="false"></apex:detail>
<apex:pageblock id="CustomList" title="Related Opportunities"  >
   <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
        <apex:column value="{!o.Name}"/>
        <apex:column value="{!o.Account.Name}"/>
        <apex:column value="{!o.Type}"/>
       <apex:column value="{!o.Amount}"></apex:column>
       <apex:column value="{!o.CloseDate}"/>
   </apex:pageBlockTable>
   <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel>
 </apex:pageblock>
</apex:form>
</apex:page>

 

 

 

public class sampleDetailPageCon {
    private List<Opportunity> oppz;
    private Contact cntact;
    public sampleDetailPageCon(ApexPages.StandardController controller) {
        this.cntact= (Contact)controller.getRecord();
    }
    public List<Opportunity> getOppz()
    {
        Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];
        if (con.Account == null)
         return null;
        oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];
        return oppz;
    }
}

 

Thanks

Hi,

        I need to display related opportunities for first 5 records.if there are more than 5 records i need a link to show more records in next page.I need similar pagination how default salesforce provides for a related list.Can you please help me in this.

 

 

<apex:page standardController="Contact" extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form >
<apex:pageMessages />
<apex:detail relatedList="true"></apex:detail>
<apex:pageblock id="CustomList" title="Related Opportunities" >
<apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
<apex:column value="{!o.Name}"/>
<apex:column value="{!o.Account.Name}"/>
<apex:column value="{!o.Type}"/>
<apex:column value="{!o.Amount}"></apex:column>
<apex:column value="{!o.CloseDate}"/>
</apex:pageBlockTable>
<apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel>
</apex:pageblock>
</apex:form>
</apex:page>



public class sampleDetailPageCon {
private List<Opportunity> oppz;
private Contact cntact;
public sampleDetailPageCon(ApexPages.StandardController controller) {
this.cntact= (Contact)controller.getRecord();
}
public List<Opportunity> getOppz()
{
Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];
if (con.Account == null)
return null;
oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];
return oppz;
}
}



  Thanks



Hi, I have a field in contact which is URL. I want to display button instead of Link in realted list. Like if contact has URL field, then in Account page in the contact related list, that field should show up as button rather than link

 



 

This is something new , I dont have any idea how to do this.

 

 

 Thanks Shailu

  • October 05, 2011
  • Like
  • 0

Hi All,

 

        I need to get the zip file of all attachments from case object where case status is closed.I tried using export wizard but no hope. Any help of how to extract zip file of all attachments.

 

Thanks

 
I wonder how I could turn one or more worflows from the time I saved an object.
The rule must be obeyed is solely the existence of this object, or so it is saved I want to trigger a workflow with email saying the creation of the object.
Thank you.



Hi All,

 

         My class is not getting covered in below red lines.Any help in fixing in test class

 

public class Web2LeadExtension {

 
  
    public Lead wlead{
    get {
      if (wlead== null)
        wlead= new Lead ();
        return wlead;
    }
    set;
  }
  
    public Web2LeadExtension(ApexPages.StandardController
                                stdController) {
       wlead = (Lead)stdController.getRecord();
     }

     public PageReference saveLead() {
       try {
       insert(wlead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.mypage;
       return p;
     }
}

 

 

 

@isTest private class testLeadClass{


static testmethod void saveLeadTest(){
        
     
         Lead l = new Lead(company='test company',lastname='xyz');
         test.starttest();

 


         Web2LeadExtension ext = new Web2LeadExtension(new ApexPages.StandardController(l));

 

PageReference p = ext.saveLead();
         test.stoptest();

 

system.assertEquals(Page.mypage.getUrl(),p.getUrl());
        
      }

}

Thanks

setup a site and a custom object. The site public access guest user profile has full permissions to the custom object.

 

setup a controller and a page to show a record from the custom object. The site guest user also has access to the apex class and the visualforce page.

 

when i load the page as the site guest user i can see any standard fields for the custom object, but it does not show any custom fields for the custom object.

 

no error message just shows nothing.

 

what am i doing wrong?

Hi Team, I want to display the help text in visualforce page but i tried the below code but i am getting so error message.
{!$ObjectType.Request__c.fields.Name__c.InlineHelpText}
Please let me know why I am getting so many error message and please let me know the solution to display help text in visualforce page. Thanks in advance.
  • August 01, 2011
  • Like
  • 0

Hey all,

 

I am having issues creating a testClass for a sample code from the Cookbook.

http://developer.force.com/cookbook/recipe/creating-a-web-to-lead-form-for-your-force-com-site

 

The controller is very simple and can be seen here:

public class myWeb2LeadExtension {

    private final Lead weblead;

    public myWeb2LeadExtension(ApexPages.StandardController
                                stdController) {
       weblead = (Lead)stdController.getRecord();
    }

     public PageReference saveLead() {
       try {
       insert(weblead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.thankyou_getinvolved;
       p.setRedirect(true);
       return p;
     }
}

 

I have written the testClass to insert all required fields for the Lead, but it is still not validating the class. What am I missing?

 

Thank you for your help!

 

Hi All,

 

I have a requirement to add my cases component on home page layout.

How can i go about it without creating a complete visualforce page ?

Hello!

 

I am new to Apex / Visualforce, so will appreciate any help with the following. I have created a custom list using visual force to display all child accounts in a related list. I would like to repeat the same for Contacts of child accounts in the page for parent account.

 

Now, having done that, how do I implement pagination - if the number of contacts / child accounts is significant?

 

See my apex code below:

 

<apex:page standardController="Account" extensions="childAccount">

<style>

.fewerMore { display: none;}

</style>

<apex:form >

 <apex:pageMessages />

 <apex:detail relatedList="true"></apex:detail>

<apex:pageblock id="CustomList" title="Child Accounts"  >

   <apex:pageBlockTable value="{!acctz}" var="o" rendered="{!NOT(ISNULL(acctz))}">

        <apex:column headerValue="Action" >

            <apex:outputLink value="/{!o.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="color:blue; text-decoration:none">Edit</apex:outputLink>

        </apex:column>       

        <apex:column headerValue="Name"> <apex:outputLink value="/{!o.id}">{!o.Name}</apex:outputLink> </apex:column>

        <apex:column value="{!o.Address_Street__c}"/>

        <apex:column value="{!o.Address_City__c}"/>

    <apex:column value="{!o.Office__c}"/>

        <apex:column value="{!o.Type}"/>

   </apex:pageBlockTable>

   <apex:outputLabel value="No records to display" rendered="{!(ISNULL(acctz))}"></apex:outputLabel>

 </apex:pageblock>

 

</apex:form>

</apex:page>

 

 

 

 

public class childAccount {

   

    private List<Account> acctz;

    private Account acct;

 

    public childAccount(ApexPages.StandardController controller) {

        this.acct= (Account)controller.getRecord();

    }

 

    public List<Account> getAcctz()

    {

        Account act = [Select id FROM Account where id = :acct.id];

        acctz = [Select id, Name, Address_Street__c, Address_City__c, Office__c, Type from Account where parentid = :act.id];

    return acctz;

    }

}

 

 

Hello.

Our organization doesn't want our sales reps to see the leads of other reps... but they do want the reps the ability to just check and see if a lead exists in the system before they can enter it in themselves, to prevent competition.

I wasn't able to accomplish this with the Sharing Settings in the UI. I did put together a trigger that, upon actual entering of the lead, it will prevent the lead from being entered if a lead with the same email address already exists. But, they want the reps to be able to do a quick search and see if the lead exists (and what rep it belongs to) before they enter in all of the additional Lead information.

I put together a Visualforce page that has three fields: Last Name, Company, and Email, and will issue a SOQL query to see if any Leads exist that match those values. It will then display the Lead name, company, email and owner to the rep so they know not to enter it themselves (I plan to update the trigger to prevent entry as well). If it doesn't exist, a link will be provided to go ahead and finish entering the Lead details, picking up the last name, company, and email address that they already put in.

This page is basically functional at this point. It needs some tweaking and CSS, but it's working. I'm new to Visualforce, and when I attempted to actually override the "New" button on the Lead tab, I learned that I can only override that button with a Visualforce page that uses the standard Lead controller.

The code for the page and the class is below. Any help would be very much appreciated.

Page:
Code:
<apex:page controller="ProspectDupeSearch" tabStyle="Lead">
    <apex:form >
        <apex:pageBlock title="Prospect Duplicate Search">
                <strong>Enter the last name, company, and/or email address for a new prospect you are looking to add.</strong>
                <br/><br/>
                Last Name<br /><apex:inputText id="searchName" value="{!searchName}"/>
                <br/><br/>
                Company<br /><apex:inputText id="searchCompany" value="{!searchCompany}"/>
                <br/><br/>
                Email<br /><apex:inputText id="searchEmail" value="{!searchEmail}"/>
                <br/><br/>
                <apex:commandButton value="Check for Duplicates" action="{!doSearch}" rerender="resultPanel"/>
        </apex:pageBlock>

        <apex:pageBlock title="Search Results">
            <apex:outputPanel id="resultPanel" layout="block">
                <apex:outputLink value="/00Q/e—name_lastlea2={!searchName}&lea3={!searchCompany}&lea11={!searchEmail}&retURL=%2F00Q%2Fo">Create new Prospect</apex:outputLink> 
                <apex:dataTable value="{!results}" var="r" cellPadding="4" border="1">
                    <apex:column >{!r.Name}</apex:column>
                    <apex:column >{!r.Company}</apex:column>
                    <apex:column >{!r.Email}</apex:column>
                    <apex:column >{!r.Owner.Name}</apex:column>
                </apex:dataTable>

                <apex:outputText id="sOutput" value="{!results}"/>
            </apex:outputPanel>
        </apex:pageBlock>
   
    </apex:form>
</apex:page>

Class:
Code:
public class ProspectDupeSearch {

    String searchName;
    String searchCompany;
    String searchEmail;
    List<Lead> results;

    public String getSearchName() { return searchName; }
    public void setSearchName(String s) { searchName = s; }

    public String getSearchCompany() { return searchCompany; }
    public void setSearchCompany(String s) { searchCompany = s; }
    
    public String getSearchEmail() { return searchEmail; }
    public void setSearchEmail(String s) { searchEmail = s; }
    
    // Return info
    public List<Lead> getResults() { return results; }

    public PageReference doSearch() {
        String queryString = 'SELECT Id,Name,Company,Email,Owner.Name FROM Lead WHERE IsConverted=False';
        queryString = queryString + ' AND Lead.Name LIKE \'%' + String.escapeSingleQuotes(searchName) + '%\'';
        queryString = queryString + ' AND Lead.Company LIKE \'%' + String.escapeSingleQuotes(searchCompany) + '%\'';
        queryString = queryString + ' AND Lead.Email LIKE \'%' + String.escapeSingleQuotes(searchEmail) + '%\'';
        queryString = queryString + ' ORDER BY LastName ASC';
        results = Database.query(queryString);
        return null;
    }
}


Thanks in advance.

-Greg

 

Friends,
I would like to export the bugs as CSV report from SF. I am not able to export the Notes and Attachments with the Bugs. Is there any specific way to export the notes and attachments along with the bugs please help me informed. Also,if there is any alternate way say, an ApI call any such thing to get the notes and attachments of the corresponding bugs please guide me in the process.
 
Thanks
Juli
  • January 08, 2008
  • Like
  • 0