• John Smith
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies

Can we search on Multiple fields in SOSL, for example:


FIND {MyProspect} IN NAME OR PHONE
 

I'm trying to build a SOSL query, but unable to figure out to incoporate "Where"Statement in the SOSL. 

My SOSL is as follows: 

 

string query = 'Find \'' + ContactSearch +'\' RETURNING contact(AccountId,Account.AccountNumber,Account.Name,' ;
query+= 'Id, Name, Phone, Email, CS_Support_Contact__c, RecordTypeId)';

 

I need to add the Where conditions,

Account.Status__c ="Active' and Inactive_Contact__c = false.

 

Please advise me in this issue.

First, Let me explain my scenario. We are replacing the customer portal with a VF page.  What i did first is created a home page component  and gave the code as below

 

<iframe src="/apex/portalhome" frameborder="0" height="640" scrolling="yes" width="100%"></iframe>

 

The VF Page Portalhome has some components which are iframes(Child Iframe). One of the child component/iframe is as below:

<apex:outputPanel id="getAdvancedReportPanel" style="width:750px;height:400px;" rendered="{!$CurrentPage.parameters.page == 'getAdvancedReports'}">
               <apex:iframe src="apex/casesearchfilter" scrolling="False" height="1000px">
               </apex:iframe>
          </apex:outputPanel>

 

The Child Iframe height might vary, and the requirement is the child iframe shouldn't have a scroll bar. And the parent iframe height should get resized automatically bsed on child iframe. In other words, we are designing a iframe in a iframe. Can you please guide me in this issue?? 

 

Cant we use directly a VF page, rather than using iframe as a homepage component?

Hello All,

Salesforce doesn't allow to change the ownership of the record owned by the person in the same role. For example, a person A in Role 1 cannot change the ownership of the record owned by the person B in Role 1. I'm trying to change the ownership of the custom object.

Could you please guide me how can i achieve this functionality. Do i need to configure sharing settings?

Cannot give "Modify All" prevelige to the profile, as it gives them full access.  Could you please guide me in this issue in configuring the sharing settings.

 

<apex:page standardController="Contact" extensions="CandidateController"  >
    <apex:form >
        <apex:pageBlock >
             <apex:pageBlockTable value="{!Data}" var="c">
               
                 <apex:column headerValue="Name" value="{!c.Candidatename}"> </apex:column>  
                 <apex:column headerValue="Candidate Stage" value="{!c.Candidatestage}"  />
                 <apex:column headerValue="Status" value="{!c.status}" />
                 <apex:column headerValue="Approval Status" value="{!c.contactname}" />
             </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
   	
</apex:page>

 

public with sharing class CandidateController {
    
    public Contact contacts;
    public List<TimeVO> myList {get; set;}
    public  List<Contact> cont = new List<contact>();
    public TimeVO temp {get;set;}
    
    public CandidateController(apexpages.standardcontroller controller) {
        contacts = (Contact) controller.getRecord();
        
    }
    
    

    public class TimeVO {
     	public String Candidatename{get;set;}
        public Date PSactualdate {get;set;}
        public Date PSSceduledate {get;set;}
        public String Candidatestage{get;set;}
        public String status{get;set;}
        public String Contactname{get;set;}
        
            
    }
  
 
    public List<TimeVO> makeData()
    
    {
       // TimeVO temp = new TimeVO();
        cont = [select id,Name From Contact];
        for(Contact c: cont)
        {
            temp.Contactname = c.Name;
            system.debug(c.Name);
        
        List<Candidate__c> cand = [select Name, candidate_stage__c,phone_screen_actual_date__c,phone_screen_scheduled_date__c from Candidate__c where contact__c =: c.id];
        
        for(candidate__c i: cand)
        {
        	system.debug(i.Name);
            temp.candidatename = i.Name;
            temp.Candidatestage = i.Candidate_Stage__c;
            temp.PSactualdate = i.phone_screen_actual_date__c;
            temp.PSSceduledate = i.phone_screen_scheduled_date__c;
            if(temp.Candidatestage == 'Phone Screen' && temp.PSSceduledate == NULL )
                {
                    temp.status = 'This is Phone screen actual date' + temp.PSactualdate + '';
                }
            if(temp.Candidatestage == 'Phone Screen' && temp.PSSceduledate != NULL)
                {
                    temp.status = 'Phone Screen scheduled date is  ' + temp.PSSceduledate + '';
                }
            
            
        }  
          
            myList.add(temp);  
        }
   
        	return myList;
        }
        
          public List<TimeVO> getData()
   	{
   	return myList;
   }
    
    }

 

I'm trying to display the child object fields(filtered) on the parent object layout.

I've developed a controller class where I'm writing the business logic, and then displaying the VF page on the top of parent object layout by editing the "View" with Visual force page and adding detail tag to the VF page.

The problem I'm facing is I couldn't the populate the pageblock table with the List I've generated. The table is displayed empty. I might be missing small thing, could you please let me know about the mistake. I'm attaching the code and screenshot of VF page.

In this case, parent object:contact Child obj: candidate relationship: candidates_r

Hey folks,

I'm trying to access the child object fields in the visual force page with standard controller as parent. In my case, parent object is student__c, child object is merchandise__c . I'm trying to access the price field in merchandise, But I'm getting the error "unknown property 'Student__cStandard controller.stud' ". Should i use both student and merchandise as standard controllers in VF page? Please guide me in this issue. 

 

CODE:

 

 

public with sharing class StudentController {
    
    public Student__c student; 
  
    private List<TimeVO> stud = Null; 
    public StudentController(apexpages.standardcontroller controller)
        
    {
        student= (Student__c) controller.getRecord();
    }
   
    
    public void TimeVO()
    {
    stud = [select ID,STUDENTNAME__C, (Select Price__c From Merchandise__r) from Student__C order by STUDENTNAME__C];
    }
    
    public List<TimeVO> getstud()
    {
    return stud;
    }
     
}

 

 

VF page:

 

 

<apex:page standardController="Student__c" extensions="StudentController" action="{!TimeVO}" >

    <apex:form >

    <apex:pageBlock title="StudentList" >    

    <apex:pageBlockSection >

 

       <apex:pageBlockTable value ="{!Stud}" var = "p">

        <apex:column headervalue="StudentName"><apex:outputLink value="/apex/StudentForm?id={!p.id}">{!p.StudentName__c}</apex:outputLink></apex:column>

        <apex:column headervalue="price">{!p.Price__c}</apex:column>

</apex:pageBlockTable>    

</apex:pageBlockSection>

 

 

    </apex:pageBlock>

        </apex:form>

</apex:page>

 

Hello,

I'm trying to change the ownership. I want the notification email of ownership change to both previous owner and new oner of the record. But salesforce provides email notification to only new owner, not the previous owner. Here in my case, a third person in higher role in role hierarchy may change the ownership. Could you please guide me in this issue, how should i proceed?

Can we search on Multiple fields in SOSL, for example:


FIND {MyProspect} IN NAME OR PHONE
 

I'm trying to build a SOSL query, but unable to figure out to incoporate "Where"Statement in the SOSL. 

My SOSL is as follows: 

 

string query = 'Find \'' + ContactSearch +'\' RETURNING contact(AccountId,Account.AccountNumber,Account.Name,' ;
query+= 'Id, Name, Phone, Email, CS_Support_Contact__c, RecordTypeId)';

 

I need to add the Where conditions,

Account.Status__c ="Active' and Inactive_Contact__c = false.

 

Please advise me in this issue.

 

<apex:page standardController="Contact" extensions="CandidateController"  >
    <apex:form >
        <apex:pageBlock >
             <apex:pageBlockTable value="{!Data}" var="c">
               
                 <apex:column headerValue="Name" value="{!c.Candidatename}"> </apex:column>  
                 <apex:column headerValue="Candidate Stage" value="{!c.Candidatestage}"  />
                 <apex:column headerValue="Status" value="{!c.status}" />
                 <apex:column headerValue="Approval Status" value="{!c.contactname}" />
             </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
   	
</apex:page>

 

public with sharing class CandidateController {
    
    public Contact contacts;
    public List<TimeVO> myList {get; set;}
    public  List<Contact> cont = new List<contact>();
    public TimeVO temp {get;set;}
    
    public CandidateController(apexpages.standardcontroller controller) {
        contacts = (Contact) controller.getRecord();
        
    }
    
    

    public class TimeVO {
     	public String Candidatename{get;set;}
        public Date PSactualdate {get;set;}
        public Date PSSceduledate {get;set;}
        public String Candidatestage{get;set;}
        public String status{get;set;}
        public String Contactname{get;set;}
        
            
    }
  
 
    public List<TimeVO> makeData()
    
    {
       // TimeVO temp = new TimeVO();
        cont = [select id,Name From Contact];
        for(Contact c: cont)
        {
            temp.Contactname = c.Name;
            system.debug(c.Name);
        
        List<Candidate__c> cand = [select Name, candidate_stage__c,phone_screen_actual_date__c,phone_screen_scheduled_date__c from Candidate__c where contact__c =: c.id];
        
        for(candidate__c i: cand)
        {
        	system.debug(i.Name);
            temp.candidatename = i.Name;
            temp.Candidatestage = i.Candidate_Stage__c;
            temp.PSactualdate = i.phone_screen_actual_date__c;
            temp.PSSceduledate = i.phone_screen_scheduled_date__c;
            if(temp.Candidatestage == 'Phone Screen' && temp.PSSceduledate == NULL )
                {
                    temp.status = 'This is Phone screen actual date' + temp.PSactualdate + '';
                }
            if(temp.Candidatestage == 'Phone Screen' && temp.PSSceduledate != NULL)
                {
                    temp.status = 'Phone Screen scheduled date is  ' + temp.PSSceduledate + '';
                }
            
            
        }  
          
            myList.add(temp);  
        }
   
        	return myList;
        }
        
          public List<TimeVO> getData()
   	{
   	return myList;
   }
    
    }

 

I'm trying to display the child object fields(filtered) on the parent object layout.

I've developed a controller class where I'm writing the business logic, and then displaying the VF page on the top of parent object layout by editing the "View" with Visual force page and adding detail tag to the VF page.

The problem I'm facing is I couldn't the populate the pageblock table with the List I've generated. The table is displayed empty. I might be missing small thing, could you please let me know about the mistake. I'm attaching the code and screenshot of VF page.

In this case, parent object:contact Child obj: candidate relationship: candidates_r

Hey folks,

I'm trying to access the child object fields in the visual force page with standard controller as parent. In my case, parent object is student__c, child object is merchandise__c . I'm trying to access the price field in merchandise, But I'm getting the error "unknown property 'Student__cStandard controller.stud' ". Should i use both student and merchandise as standard controllers in VF page? Please guide me in this issue. 

 

CODE:

 

 

public with sharing class StudentController {
    
    public Student__c student; 
  
    private List<TimeVO> stud = Null; 
    public StudentController(apexpages.standardcontroller controller)
        
    {
        student= (Student__c) controller.getRecord();
    }
   
    
    public void TimeVO()
    {
    stud = [select ID,STUDENTNAME__C, (Select Price__c From Merchandise__r) from Student__C order by STUDENTNAME__C];
    }
    
    public List<TimeVO> getstud()
    {
    return stud;
    }
     
}

 

 

VF page:

 

 

<apex:page standardController="Student__c" extensions="StudentController" action="{!TimeVO}" >

    <apex:form >

    <apex:pageBlock title="StudentList" >    

    <apex:pageBlockSection >

 

       <apex:pageBlockTable value ="{!Stud}" var = "p">

        <apex:column headervalue="StudentName"><apex:outputLink value="/apex/StudentForm?id={!p.id}">{!p.StudentName__c}</apex:outputLink></apex:column>

        <apex:column headervalue="price">{!p.Price__c}</apex:column>

</apex:pageBlockTable>    

</apex:pageBlockSection>

 

 

    </apex:pageBlock>

        </apex:form>

</apex:page>