• Gaurav Jain 103
  • NEWBIE
  • 195 Points
  • Member since 2016
  • Consultant & Developer
  • Pulse Electronics

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 23
    Replies
I have the controller here I tried to the multiple field filterization but in the birthdatefield only not work it's give an error can any one help me to remove this error:Compile Error: Method does not exist or incorrect signature: YEAR(String) at line 124 column 46
My controller:
public class SortOfContactListController {
    public List<Contact> ContactListTable {get; set;}
    public String ExpressionOfSort = 'name';
    public String DirectionOfSort = 'ASC';
    public List<Contact> ContactResults {get; set;}
    
    public SortOfContactListController() {
        ContactListTable = new List<Contact>();
        ContactResults = new List<Contact>();
    }
    
   /* public string searchtext {
        get;
        set;
    }*/
    
    public string ContactName {
        get;
        set;
    }
    
     public string Phone {
        get;
        set;
    }
    
     public string AccountName {
        get;
        set;
    }
    // String AccountName = Apexpages.currentPage().getParameters().get('AccountName');
    public String BirthDate {
        get;
        set;   
    }
    
    /*public string BirthdateMIN {
        get;
        set;
    } 
    
    public string BirthdateMAX {
        get;
        set;   
    }*/
    
    public string Email {
        get;
        set;
    }
    
    public string MailingCity {
        get;
        set;
    }
    
    public string MailingCountry {
        get;
        set;
    }
    
    public string MailingPostalCode {
        get;
        set;
    } 
    
    
    public String ExpressionSort {
        get {
            return ExpressionOfSort;
        }
        set {
            If(value == ExpressionOfSort) {
                DirectionOfSort = (DirectionOfSort == 'ASC')? 'DESC' : 'ASC';
            }
            else {
                DirectionOfSort = 'ASC';
                ExpressionOfSort = value;
            }
        }
    
    }
    
    public String getDirectionOfSort() {
        If(ExpressionOfSort == Null || ExpressionOfSort == '') {
            return 'DESC';
        }
        else {
            return DirectionOfSort;
        }
    }
    
    public void setDirectionOfSort(String value) {
        DirectionOfSort = value;
    }
    
    public List<Contact>getContacts() {
        return ContactListTable;
    }
    
    public PageReference ViewData() {
        String FullSortExpression = ExpressionOfSort + ' ' + DirectionOfSort;
        system.debug('ExpressionOfSort:::::'+ExpressionOfSort);
        system.debug(DirectionOfSort);
        
        //String Queryitem = new String();
       String Queryitem = ' SELECT Id, Name, Account.Name, Birthdate, Phone, Email, MailingCity, MailingCountry, MailingPostalCode FROM Contact WHERE Account.Name != Null ORDER BY ' + FullSortExpression +' Limit 1000';
       system.debug(Queryitem);
       
        ContactListTable = DataBase.query(Queryitem);
        system.debug(ContactListTable);
        return Null;
    }
    
    public PageReference Search(){
    String searchquery = ' SELECT Id, Name, Account.Name, Birthdate, Phone, Email, MailingCity, MailingCountry, MailingPostalCode FROM Contact WHERE Account.Name != Null ';
    system.debug(searchquery);
    String condition = '';
    if (ContactName != null && ContactName != '')
        condition += ' and Name LIKE \'' + ContactName + '%\'';
    if (AccountName != null && AccountName != '')
        condition += ' and Account.Name LIKE \'' + AccountName + '%\'';
    if (BirthDate != null && BirthDate != '')
        condition += ' and Birthdate = \'' + YEAR(Birthdate) + '%\'' ;
    if (Phone != null && Phone != '')
        condition += ' and Phone LIKE \'' + Phone + '%\'';
    if (Email != null && Email != '')
        condition += ' and Email LIKE \'' + Email + '%\'';
        
    if (MailingCountry != null && MailingCountry != '')
         condition += ' and MailingCountry LIKE \'' + MailingCountry + '%\'';
    if (MailingCity != null &&  MailingCity != '')
         condition += ' and MailingCity LIKE \'' + MailingCity + '%\'';
    if (MailingPostalCode != null && MailingPostalCode != '')
         condition += ' and MailingPostalCode LIKE \'' + MailingPostalCode + '%\'';
    if(condition != ''){
    searchquery += condition;
    System.debug(' searchquery:::::::: '+searchquery);
    
    ContactResults = DataBase.query(searchquery);
    system.debug(' ContactResults::::::::::: '+ContactResults);
  
    }
    return Null;
    
    }
}
HI All,

The following custom component show an error.....Unknown property 'account'

<apex:component access="global">
  <h1>Account Details</h1>
  
  <apex:panelGrid columns="2">

      <apex:outputLabel for="Name" value="Name"/>
      <apex:outputText id="Name" value="{!account.Name}"/>
      
      <apex:outputLabel for="Owner" value="Account Owner"/>
      <apex:outputText id="Owner" value="{!account.Owner.Name}"/>
      
      <apex:outputLabel for="AnnualRevenue" value="Annual Revenue"/>
      <apex:outputText id="AnnualRevenue" value="{0,number,currency}">
          <apex:param value="{!account.AnnualRevenue}"/>
      </apex:outputText>
      
      <apex:outputLabel for="NumberOfEmployees" value="Employees"/>
      <apex:outputText id="NumberOfEmployees" value="{!account.NumberOfEmployees}"/>
      
  </apex:panelGrid>
</apex:component>
 

Can anyone reply please...
Hi,

 I am assigning opportunity amount to a get and set variable  public Decimal differenceamount{get;set;}

  Displaying this differenceamount in visualforce page problem am facing is amount is not formated 

<apex:outputText id="differenceamount" style="font-weight:500" label="Differnce Amount" value="${!differenceamount }"/>  

Please suggest me how to format the value it is displaying as Differnce Amount$38552.30

Thanks
Sudhir
          

 
  • September 16, 2016
  • Like
  • 0
Hello,

I want to Create a profile with NO or void access to anything. In other words, profile, should not include anything
Is there any simple way to implment my use case ?
 
Hi Team,

Can we create a custom button or Trigeer that  applied to any activity that exports data from standard report that email should send to Admin.
 
While saving the below code:

 <apex:pageBlockTable value="{!Quote__c.quote_items__r}" var="line" border="1" headerClass="headerStyle" >
            <apex:column headerValue="Product #" value="{!line.product__r.Name}" width="150px;" />
                  <apex:column breakBefore="true" colspan="8">                <apex:pageBlockTable value="{!line.Product_Items__r}" var="c" border="1" headerClass="headerStyle" >
                    <apex:column value="{!c.Id}"/>
                    <apex:column value="{!c.Name}"/>               
                </apex:pageBlockTable>
                 </apex:column>
                </apex:pageBlockTable>

I got the error:
Error: Object type not accessible. Please check permissions and make sure the object is not in development mode: SOQL statements cannot query aggregate relationships more than 1 level away from the root entity object
Hi all .
I have opportunity object which has lookup to same opportunity (simply one one opportunity has 4 opportunities) how to display the opportunity amount in column header total value?
I have the controller here I tried to the multiple field filterization but in the birthdatefield only not work it's give an error can any one help me to remove this error:Compile Error: Method does not exist or incorrect signature: YEAR(String) at line 124 column 46
My controller:
public class SortOfContactListController {
    public List<Contact> ContactListTable {get; set;}
    public String ExpressionOfSort = 'name';
    public String DirectionOfSort = 'ASC';
    public List<Contact> ContactResults {get; set;}
    
    public SortOfContactListController() {
        ContactListTable = new List<Contact>();
        ContactResults = new List<Contact>();
    }
    
   /* public string searchtext {
        get;
        set;
    }*/
    
    public string ContactName {
        get;
        set;
    }
    
     public string Phone {
        get;
        set;
    }
    
     public string AccountName {
        get;
        set;
    }
    // String AccountName = Apexpages.currentPage().getParameters().get('AccountName');
    public String BirthDate {
        get;
        set;   
    }
    
    /*public string BirthdateMIN {
        get;
        set;
    } 
    
    public string BirthdateMAX {
        get;
        set;   
    }*/
    
    public string Email {
        get;
        set;
    }
    
    public string MailingCity {
        get;
        set;
    }
    
    public string MailingCountry {
        get;
        set;
    }
    
    public string MailingPostalCode {
        get;
        set;
    } 
    
    
    public String ExpressionSort {
        get {
            return ExpressionOfSort;
        }
        set {
            If(value == ExpressionOfSort) {
                DirectionOfSort = (DirectionOfSort == 'ASC')? 'DESC' : 'ASC';
            }
            else {
                DirectionOfSort = 'ASC';
                ExpressionOfSort = value;
            }
        }
    
    }
    
    public String getDirectionOfSort() {
        If(ExpressionOfSort == Null || ExpressionOfSort == '') {
            return 'DESC';
        }
        else {
            return DirectionOfSort;
        }
    }
    
    public void setDirectionOfSort(String value) {
        DirectionOfSort = value;
    }
    
    public List<Contact>getContacts() {
        return ContactListTable;
    }
    
    public PageReference ViewData() {
        String FullSortExpression = ExpressionOfSort + ' ' + DirectionOfSort;
        system.debug('ExpressionOfSort:::::'+ExpressionOfSort);
        system.debug(DirectionOfSort);
        
        //String Queryitem = new String();
       String Queryitem = ' SELECT Id, Name, Account.Name, Birthdate, Phone, Email, MailingCity, MailingCountry, MailingPostalCode FROM Contact WHERE Account.Name != Null ORDER BY ' + FullSortExpression +' Limit 1000';
       system.debug(Queryitem);
       
        ContactListTable = DataBase.query(Queryitem);
        system.debug(ContactListTable);
        return Null;
    }
    
    public PageReference Search(){
    String searchquery = ' SELECT Id, Name, Account.Name, Birthdate, Phone, Email, MailingCity, MailingCountry, MailingPostalCode FROM Contact WHERE Account.Name != Null ';
    system.debug(searchquery);
    String condition = '';
    if (ContactName != null && ContactName != '')
        condition += ' and Name LIKE \'' + ContactName + '%\'';
    if (AccountName != null && AccountName != '')
        condition += ' and Account.Name LIKE \'' + AccountName + '%\'';
    if (BirthDate != null && BirthDate != '')
        condition += ' and Birthdate = \'' + YEAR(Birthdate) + '%\'' ;
    if (Phone != null && Phone != '')
        condition += ' and Phone LIKE \'' + Phone + '%\'';
    if (Email != null && Email != '')
        condition += ' and Email LIKE \'' + Email + '%\'';
        
    if (MailingCountry != null && MailingCountry != '')
         condition += ' and MailingCountry LIKE \'' + MailingCountry + '%\'';
    if (MailingCity != null &&  MailingCity != '')
         condition += ' and MailingCity LIKE \'' + MailingCity + '%\'';
    if (MailingPostalCode != null && MailingPostalCode != '')
         condition += ' and MailingPostalCode LIKE \'' + MailingPostalCode + '%\'';
    if(condition != ''){
    searchquery += condition;
    System.debug(' searchquery:::::::: '+searchquery);
    
    ContactResults = DataBase.query(searchquery);
    system.debug(' ContactResults::::::::::: '+ContactResults);
  
    }
    return Null;
    
    }
}
HI All,

The following custom component show an error.....Unknown property 'account'

<apex:component access="global">
  <h1>Account Details</h1>
  
  <apex:panelGrid columns="2">

      <apex:outputLabel for="Name" value="Name"/>
      <apex:outputText id="Name" value="{!account.Name}"/>
      
      <apex:outputLabel for="Owner" value="Account Owner"/>
      <apex:outputText id="Owner" value="{!account.Owner.Name}"/>
      
      <apex:outputLabel for="AnnualRevenue" value="Annual Revenue"/>
      <apex:outputText id="AnnualRevenue" value="{0,number,currency}">
          <apex:param value="{!account.AnnualRevenue}"/>
      </apex:outputText>
      
      <apex:outputLabel for="NumberOfEmployees" value="Employees"/>
      <apex:outputText id="NumberOfEmployees" value="{!account.NumberOfEmployees}"/>
      
  </apex:panelGrid>
</apex:component>
 

Can anyone reply please...
Hi,

We have the requirement to pull data from SF into SAP BW through the SF SOAP API.
Is there any documentation on this from a Salesforce side?
I can use the API's successfully using a third party tool (SOAP UI) no problem but the BW side is quite indepth.
Was just wondering if there are any good documents on this situation?
Can Saleforce 'push' data to BW or will BW have to pull it?

Any help appreciated..
Hi,

 I am assigning opportunity amount to a get and set variable  public Decimal differenceamount{get;set;}

  Displaying this differenceamount in visualforce page problem am facing is amount is not formated 

<apex:outputText id="differenceamount" style="font-weight:500" label="Differnce Amount" value="${!differenceamount }"/>  

Please suggest me how to format the value it is displaying as Differnce Amount$38552.30

Thanks
Sudhir
          

 
  • September 16, 2016
  • Like
  • 0
Hi

how to integrate dot net with salesforce and brief information about dot net installation ? 
How to install dot net and instructions after installation?

Thanks
Hello,

I want to Create a profile with NO or void access to anything. In other words, profile, should not include anything
Is there any simple way to implment my use case ?
 
I have a custom page.There is a link lookup field.On click of that link popup appears then i select a field to be used it is not able to fetch on button click.Did i miss anything?
Here is my code below:-
JAVASCRIPT
<script type="text/javascript">
        function OpenServicePopup(winUrl)
        {
            var searchBoxValue = document.getElementById('lksrch').value;
            var finalUrl = winUrl+"&lksrch="+searchBoxValue;
            var newwindow=window.open(finalUrl,'popup','height=400,width=400,scrollbars=yes');
            newwindow.focus();
            return false; 
        }
    </script>
VISUALFORCE PAGE
<apex:commandLink value="Add" style="width:100px;" onclick="OpenServicePopup('/apex/lookuppage?woID='+'{!parentWoId}');"/> 
Right now cases are getting created when email are sent to support group copied in CC but we won't want to create cases for cced emails .Please suggest 
Hello,

I'm trying to fix a formula on my quote page. I created a field called annual fee and I want it to divide the Grand Total by 3. If I enter the sum manually, it will not be on the pdf-sheet, so I guess I need a formula that works, but I keep getting error. Can someone help me with that?

Thx! Edwin
Hi all,

I want to know how to set quarterly and monhtly targets in salesforce dashboards.
Can you please help. Its urgent
I am trying to find seasoned salesforce technical leads, who might be interested in becoming a Salesforce Delivery Manager in Noida, India for an established consulting partner based in USA. If interested, please forward your resume and cover letter to edwardmcqueencameron@gmail.com.

Thanks!