• Hanimi Reddy
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 11
    Replies
Hi  everyone,

I am getting error "Unknown property 'SearchController.Loc__c' " in VisualForce Page.Please review the code .
Let me know where i did mistake.

Thanks in advance

Apex Code :

public with sharing class SearchController {
  private String soql {get;set;}
  public List<Loc__c> Searchlocation {get;set;}
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }
  public String sortField {
    get  { if (sortField == null) {sortField = 'location'; } return sortField;  }
    set;
  }
  public void runQuery() {
    try {
      Searchlocation = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
    }}
  public PageReference runSearch() {
    String location = Apexpages.currentPage().getParameters().get('location');
    soql = 'select  Comp__c,Client__c, Competitor__c, Type__c,Event_Name__c, Et_Desc__c , Et_Addr__c, Dt_Ti__c, Ct_person__c,Ph_Num__c, from loc__C where loc__c != null';
    runQuery();
    return null;
  }
}

VF Code:

<apex:page controller="SearchController" sidebar="false">
  <apex:form >
  <apex:pageBlock title=" Find a Location" mode="edit">

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">
      <apex:pageBlock title="Parameters" mode="edit" id="criteria">
      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("location").value,
          
          );
      }
      </script> 
      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results">
          <apex:param name="location" value="" />
      </apex:actionFunction>

      <table cellpadding="1" cellspacing="1">
      <tr>
        <td style="font-weight:bold;">Location<br/>
        <input type="text" id="location" onkeyup="doSearch();"/>
        </td>
      </tr>        
      </table>
      </apex:pageBlock>
    </td>
    <td valign="top">
    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{! Loc__c}" var="location">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Company Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Comp__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Comp__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Client Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Client__C" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Client__C}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Competitor Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Competitor__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Competitor__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Type" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Type__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Type__c}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Event Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Event_Name__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Event_Name__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Event Description" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Event_Desc__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Event_Desc__c}"/>
            </apex:column>
              <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Date and Time" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Dt_Ti__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Dt_Ti__c}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Contact Person" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Ct_person__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Ct_person__c}"/>
            </apex:column>
              <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Phone Number" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Ph_Num__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Ph_Num__c}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
    </td>
  </tr>
  </table>
  </apex:pageBlock>
  </apex:form>
</apex:page>  
Hi everyone,
I'm developping an automatic email in an apex class.

I'm trying to link my email to a quote with the methode setWhatId, but it don't work with quote...

Can you help me or give me another solution plese ?

This is my code:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
List<String> sendTo = new List<String>();
sendTo.add('XXXX@XXXX.XXX');
mail.setToAddresses(sendTo);
mail.setTargetObjectId(quote.ContactId);
mail.setReplyTo('XXXX@XXXX.XXX');
mail.setTemplateId('XXXXXXXXXXXX');
mail.setwhatid(quote.Id);
mail.setSaveAsActivity(true);
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});

Thanks.
Hi All,

I want to share the case records(OWD -- Private) to all community users based on one check box which is on case record. how to achieve this .
I tried to configure criteria based sharing rules to all community users. but its not working.

Regards,
Honey
Hi ,

As per privarcy policy ,client doesn't want email logs. Whenever we send an email from salesforce , client don't want to track in email log.

Please help me on this , how to disable this feature.

Thanks.
Hi All,

Can you suggest me the way to parse the excel attachment or convert the CSV to Excel using Apex code.


 
Hi All, 

I have implemented community with custom header and custom footer by calling vfpage's using XMLhttpRequest. When i open chatter page ,few features are not working like TO Me, Bookmarks,Mute.

getting following exception in console.

Failed to load resource: the server responded with a status of 400 (Bad Request)
/chatter/handlers/feed//ME?_dc=1451743060565&feedType=ME&showFeedItemsOnly=true&isDropDownFiltersVisible=false&isFullRefresh=false&isCompactFeed=false


What i observe userid is not populating in above url. UID has to be b/w feed/UID/ME.

/chatter/handlers/feed/userID/ME?_dc=1451743060565&feedType=ME&showFeedItemsOnly=true&isDropDownFiltersVisible=false&isFullRefresh=false&isCompactFeed=false.

Please help me on this.
Unexpected text is displaying in vf page.

User-added image
Hello All,

Is Force.com light user licence supports salesforce one app?
Hello All,

I have two scenarios.

1) I am generating the excel from vf page,which have button. Right now on button click its redirecting to page and downloading the excel.
  After that its not redirecting to the orginal page? 
2) Also i m generating the pdf from standard detail page on clicking of custom button.
    same thing here also after genrating the pdf its not redirecting to the orginal page.

Please help on these things.....
Hi All,
Below is the usecase for salesforce 1 APP.
UseCase :
             Manger want to see his sales peoples location in google map.
             There should be provision for sales users, to allow his location tracking.

Please help me on this ,how can i achive the above usecase?
Hi All,

I want to share the case records(OWD -- Private) to all community users based on one check box which is on case record. how to achieve this .
I tried to configure criteria based sharing rules to all community users. but its not working.

Regards,
Honey
Aloha! 

Long story short, I am working on an application (using SFDC as the platform). I have groundwork done and have multiple [paid] parties interested in concept. I am looking to complete the proof of concept with a help of someone who is highly skilled with Visualforce & Apex & Mobile. 

I have some investment seed money lined up as long as the app is in working order. So far, it's only me but am looking for a long term partner/co-founder that can help launch this company off the ground with me.

I don't have any money to offer as I am bootstrapping this app and my life =)

Let me know if this is something you'd like to help me out with. I'd prefer someone local (I am in the bay area...San Jose to be exact). 

Thanks and have a great day.

1Block 
I want to display the Approval or Rejection Comment on the VF email template.

Can someone help me how to do that WITHOUT CHANGING THE relatedToType="ahm__Interaction__c"


Below is my code.

<messaging:emailTemplate subject="Action Required: Speaker Alliance Request {!relatedTo.name} has been approved" recipientType="User" relatedToType="ahm__Interaction__c"> <messaging:plainTextEmailBody >
Dear {!relatedTo.Owner.FirstName} {!relatedTo.Owner.LastName},

Your Interaction request {!relatedTo.name} has been approved by {!relatedTo.ahm__Owner_s_Manager_Name__c}. You will receive an email from your assigned meeting planner within 1 business day. 

Interaction Details
<c:InteractionDetailComponent InteractionId="{!relatedTo.Id}" />

If you have any questions or require further assistance, please contact AHM at {!$Setup.Customer_Service__c.Phone_Number__c}.

Thank You,
Mangement

</messaging:plainTextEmailBody>
</messaging:emailTemplate>
Hi  everyone,

I am getting error "Unknown property 'SearchController.Loc__c' " in VisualForce Page.Please review the code .
Let me know where i did mistake.

Thanks in advance

Apex Code :

public with sharing class SearchController {
  private String soql {get;set;}
  public List<Loc__c> Searchlocation {get;set;}
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }
  public String sortField {
    get  { if (sortField == null) {sortField = 'location'; } return sortField;  }
    set;
  }
  public void runQuery() {
    try {
      Searchlocation = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 20');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
    }}
  public PageReference runSearch() {
    String location = Apexpages.currentPage().getParameters().get('location');
    soql = 'select  Comp__c,Client__c, Competitor__c, Type__c,Event_Name__c, Et_Desc__c , Et_Addr__c, Dt_Ti__c, Ct_person__c,Ph_Num__c, from loc__C where loc__c != null';
    runQuery();
    return null;
  }
}

VF Code:

<apex:page controller="SearchController" sidebar="false">
  <apex:form >
  <apex:pageBlock title=" Find a Location" mode="edit">

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">
      <apex:pageBlock title="Parameters" mode="edit" id="criteria">
      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("location").value,
          
          );
      }
      </script> 
      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results">
          <apex:param name="location" value="" />
      </apex:actionFunction>

      <table cellpadding="1" cellspacing="1">
      <tr>
        <td style="font-weight:bold;">Location<br/>
        <input type="text" id="location" onkeyup="doSearch();"/>
        </td>
      </tr>        
      </table>
      </apex:pageBlock>
    </td>
    <td valign="top">
    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{! Loc__c}" var="location">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Company Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Comp__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Comp__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Client Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Client__C" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Client__C}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Competitor Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Competitor__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Competitor__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Type" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Type__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Type__c}"/>
            </apex:column>
            
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Event Name" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Event_Name__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Event_Name__c}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Event Description" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Event_Desc__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Event_Desc__c}"/>
            </apex:column>
              <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Date and Time" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Dt_Ti__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Dt_Ti__c}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Contact Person" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Ct_person__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Ct_person__c}"/>
            </apex:column>
              <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Phone Number" action="{!toggleSort}" rerender="results">
                        <apex:param name="sortField" value="Ph_Num__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!Loc__c.Ph_Num__c}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
    </td>
  </tr>
  </table>
  </apex:pageBlock>
  </apex:form>
</apex:page>  
Hi everyone,
I'm developping an automatic email in an apex class.

I'm trying to link my email to a quote with the methode setWhatId, but it don't work with quote...

Can you help me or give me another solution plese ?

This is my code:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
List<String> sendTo = new List<String>();
sendTo.add('XXXX@XXXX.XXX');
mail.setToAddresses(sendTo);
mail.setTargetObjectId(quote.ContactId);
mail.setReplyTo('XXXX@XXXX.XXX');
mail.setTemplateId('XXXXXXXXXXXX');
mail.setwhatid(quote.Id);
mail.setSaveAsActivity(true);
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});

Thanks.
I have written a test class for trigger.the result is pass,but 0% coverage.how to achieve more than 85%?
Trigger:
trigger Rfleet_DeleteRecords_Draft on Opportunity_car_set__c(before delete) {
    set < id > BId = new set < id > ();
    set < id > OpId= new set <id>();
    if (Trigger.isDelete && Trigger.isBefore) {
        Id devRecordTypeId = Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get('RFLEET-OPP-Algeria-RT').getRecordTypeId();

        for (Opportunity_car_set__c rec: trigger.old) {
            BId.add(rec.Opportunity__c);
            OpId.add(rec.id);
            List < Opportunity > ListOpp = [select StageName, RecordTypeId from Opportunity where id = : BId];
           for (Opportunity opp: ListOpp) {
                if (opp.RecordTypeId == devRecordTypeId) {
                    if (opp.StageName == 'Qualification' || opp.StageName == 'Prospecting') {
                        rec.adderror('You cannot delete this record!');
                    }
                }
            }
        }
      
    }
     delete [SELECT id FROM Service__c where Opportunity_car_set__c =:OpId]; 
}

Test class:
@isTest
private class  Rfleet_DeleteRecords_Draft_Test{
  static testMethod void Rfleet_DeleteRecords_Draft(){
       test.startTest();    
    
        Opportunity opp= new Opportunity();
        opp.name='Prabu';
        opp.stagename='Qualification';
        opp.CloseDate=system.Today();
        insert opp;
        opp.name='kiran';
        //opp.StageName = 'Prospecting';
        update opp;
      system.assertEquals('kiran',opp.name);
      
    
        Opportunity_car_set__c oppCarSet = new Opportunity_car_set__c();
        oppCarSet.name='Opp';
        oppCarSet.Opportunity__c =opp.id;
        oppCarSet.Quantity__c =2;
        insert oppCarSet;
        oppCarSet.Quantity__c =3;
      update oppCarSet;
      system.assertEquals(3,oppCarSet.Quantity__c);
     
        
        Service__c ser = new Service__c();
        ser.Opportunity_car_set__c = oppCarSet.id;
        ser.Quantity__c = 1;
        ser.Price_HT__c = 10;
        insert ser;
      ser.Price_HT__c = 20;
      delete ser;
      
      system.assertEquals(20,ser.Price_HT__c);
      test.stopTest();
      
        
    }
}
i get an error while trying to obtain the access token im using golang to develop this oauth process but anyhow once the acess token is requested it gives an error back saying error got 400 {"error":"unsupported_grant_type","error_description":"grant type not supported"} User-added image
this is my url to obtain the token https://login.salesforce.com/services/oauth2/token
below image shows the paramters that are being sent 
User-added image

am i missing something in here ? please do help me in any means mostly it would suit if you could solve it using golang 
thanks 
 
Formula field in the roll up summary filter. I am trying to rollup the current quarter opportunity amount rollup at account level and created formula to check if the opportunity is falling in current quarter. Now I am not able to see the field in the filter criteria on the roll up summary. Interestingly there is one more field formula (number) which is appearing on filter, seeing that I created a number filter with 1 or 0 value to identify the current auarter opportunity filter, but my new field is also not appearing in the filter. 

Roll up summary problem

Thanks,
Yogesh
Hello All,

Is Force.com light user licence supports salesforce one app?
Hi ,
Here i have a requirement please help me the scenario :i have 3 vf pdf documents ,when i insert a record as well i have to insert this 3 pdf's into the object?i want it through trigger any help is appreciable
Hello folks,

When Master is set to private the associated child also defaultly set to Private.
Now i have one parent record and 3 associated child records are there.
So whoever are the owners for those child records, they have to see all 3 records among themselves. So how can i achieve this situation, hope that we can achieve it by apexsharing but how it can be??

Actually, when we set as Private people cannot see others records..they can see only their records(i.e, whoever created they can see thier records). But how to achieve above scenario??

Please update me with your valuable solution :)