• Venkata Sravan Kumar Bandari
  • NEWBIE
  • 95 Points
  • Member since 2014
  • Sr Software Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 34
    Questions
  • 35
    Replies
can anyone please give me the Regex code for the phone number format (XXX)XXX-XXXX 
while deploying using ANT i'm getting this error. What is it exactly. Anyone plz help me.User-added image
when i editing the record by clicking edit link in the related list then it will navigate to custom vf page with standard controller and extension and then i have multiselect picklist in that page. 
My problem is when the page loaded by default the values in that multi slect picklist need to be highligted with blue colour means as selected value
Database.getQueryLocator('select id, name, email, birthdate from contact where calendar_Month(birthdate) =: System.today().month() AND day_In_Month(birthdate) =: SYstem.today().day()');

i have tried in many ways from anonymus also but its not working
ERROR: System.QueryException: unexpected token: '('
I have arequiremnt that i want to take a photo from vf page using mobile/tablet
I am generating class from wsdl but i am getting the above error....I tried with different browsers and different systems but getting the same error.
Here is soql i want get ids of attachments as follows and how can i retrieve ids from the list
 
list<Account> accs = [select (select id from attachments where createddate < last_N_days:10) from account where is_read__c = true]

Now i want ids of attachments into a seperate list how it is possible..

Thanks in advance
i want to retrieve the attachments of SObject Account and also i was created a custom field(checkbox) named as is_read__c. 
Now, using SOQL is it possible to get attachments of Account from attachment SObject where condition is is_read__c = true
<apex:pageblocktable value="{!students}" var="student">
                      <apex:column >
                          <apex:facet name="Header">
                              <apex:commandlink value="Name" action="{!toggleSort}" reRender="block2">
                              <apex:param name="sortField" value="name" assignTo="{!sortField}"/>
                              </apex:commandlink>
                          </apex:facet>
                          <apex:outputText value="{!student.name}"/>
                      </apex:column>
                      <apex:column >
                          <apex:facet name="Header">
                              <apex:commandlink value="Id" action="{!toggleSort}" reRender="block2">
                              <apex:param name="sortField" value="studentId" assignTo="{!sortField}"/>
                              </apex:commandlink>
                          </apex:facet>
                          <apex:outputText value="{!student.Student_ID__c}"/>
                      </apex:column>
</apex:pageblocktable>

soql = 'select name, student_id__c, qualification__c, email__c from name__c where name LIKE :'+String.escapeSingleQuotes(studentName)+'%';
<apex:repeat value="{!pages}" var="page">
      <apex:commandlink value="{!page}" action="{!displayPage}">
      <apex:param value="page" name="number" assignTo="{!pageNumber}"/>
      </apex:commandLink>&nbsp;&nbsp;
  </apex:repeat>
Here i am displaying commandlinks 1 2 3 ......when i click on the link respective number will pass to controller..is it possible....?
Thanks in advance 
Here is the code....Image is not displaying

<apex:page controller="Task_Picklist_onChange">
<apex:form id="show">
  <apex:pageblock >
  <apex:pageblockSection >
      <apex:outputPanel >
          <apex:selectList value="{!colors}" size="1">
              <apex:actionSupport event="onChange" action="{!display}" reRender="show" />
              <apex:selectOptions value="{!images}"/>
          </apex:selectList>
      </apex:outputPanel>
  </apex:pageblockSection>
  </apex:pageblock>
  <apex:outputPanel >
  <apex:image rendered="{!colors = 'Green'}" value="{!$Resource.Green}" width="200" height="200"/>
  <apex:image rendered="{!colors = 'Red'}" value="{!$Resource.Red}" width="200" height="200"/>
  <apex:image rendered="{!colors ='Yellow'}" value="{!$Resource.Yellow}" width="200" height="200"/>
  <apex:image rendered="{!colors ='Orange'}" value="{!$Resource.Orange}" width="200" height="200"/>
  </apex:outputPanel>
</apex:form>
</apex:page>



public with sharing class Task_Picklist_onChange {

    String Color;
   
    public PageReference display() {
        return null;
    }

    public String images { set; }
    
    public list<selectoption> getimages() {
    
        list<selectoption> image = new list<selectoption>();
        image.add(new selectoption('None','No'));
        image.add(new selectoption('Green','Green'));
        image.add(new selectoption('Red','Red'));
        image.add(new selectoption('yellow','Yellow'));
        image.add(new selectoption('Orange','Orange'));
        return image;
    }

    public String colors { get; }
    
    Public String setcolors(String colors) {
    System.debug(colors);
    color = colors;
    return color;
}
}
can anyone please give me the Regex code for the phone number format (XXX)XXX-XXXX 
Hello , 

I am trying to write a simple Batch Apex class with the query below but not able to save , As I am getting error. Can anyone please help me.

global class Batch_VolunteerStatus implements Database.Batchable<sObject> {
    
    public String query = ''; 
    
    global Database.QueryLocator start(Database.BatchableContext BC){
        query = 'SELECT Id,Last_Background_Check_Date__c,Last_Background_Check_Status__c,Background_Check_Valid1__c,Name,Volunteer_Status__c' +
                 'FROM Contact' + 
                 'WHERE Volunteer_Status__c != \'' + Do Not Pursue + '\'' +
                  'AND  Last_Background_Check_Status__c != \'' + Fail + '\'' + 
                  'AND Background_Check_Valid1__c = \'' + false + '\''; 
        

      return Database.getQueryLocator(query);
   }
   
   global void execute(Database.BatchableContext BC, List<Contact> DateexpiredContact)
    {
        
    }
    
    
    global void finish(Database.BatchableContext BC) 
    {
    }
   

}

Getting error as 
Compilation error: unexpected token: 'Do'    
Database.getQueryLocator('select id, name, email, birthdate from contact where calendar_Month(birthdate) =: System.today().month() AND day_In_Month(birthdate) =: SYstem.today().day()');

i have tried in many ways from anonymus also but its not working
ERROR: System.QueryException: unexpected token: '('
I have arequiremnt that i want to take a photo from vf page using mobile/tablet
giving the code for mobile format- 999-999-9999
Hi,
Need salesforce project support in california timings. Intrested please respond.

Thanks,
 
Here is soql i want get ids of attachments as follows and how can i retrieve ids from the list
 
list<Account> accs = [select (select id from attachments where createddate < last_N_days:10) from account where is_read__c = true]

Now i want ids of attachments into a seperate list how it is possible..

Thanks in advance
<apex:pageblocktable value="{!students}" var="student">
                      <apex:column >
                          <apex:facet name="Header">
                              <apex:commandlink value="Name" action="{!toggleSort}" reRender="block2">
                              <apex:param name="sortField" value="name" assignTo="{!sortField}"/>
                              </apex:commandlink>
                          </apex:facet>
                          <apex:outputText value="{!student.name}"/>
                      </apex:column>
                      <apex:column >
                          <apex:facet name="Header">
                              <apex:commandlink value="Id" action="{!toggleSort}" reRender="block2">
                              <apex:param name="sortField" value="studentId" assignTo="{!sortField}"/>
                              </apex:commandlink>
                          </apex:facet>
                          <apex:outputText value="{!student.Student_ID__c}"/>
                      </apex:column>
</apex:pageblocktable>

soql = 'select name, student_id__c, qualification__c, email__c from name__c where name LIKE :'+String.escapeSingleQuotes(studentName)+'%';
Here is the code....Image is not displaying

<apex:page controller="Task_Picklist_onChange">
<apex:form id="show">
  <apex:pageblock >
  <apex:pageblockSection >
      <apex:outputPanel >
          <apex:selectList value="{!colors}" size="1">
              <apex:actionSupport event="onChange" action="{!display}" reRender="show" />
              <apex:selectOptions value="{!images}"/>
          </apex:selectList>
      </apex:outputPanel>
  </apex:pageblockSection>
  </apex:pageblock>
  <apex:outputPanel >
  <apex:image rendered="{!colors = 'Green'}" value="{!$Resource.Green}" width="200" height="200"/>
  <apex:image rendered="{!colors = 'Red'}" value="{!$Resource.Red}" width="200" height="200"/>
  <apex:image rendered="{!colors ='Yellow'}" value="{!$Resource.Yellow}" width="200" height="200"/>
  <apex:image rendered="{!colors ='Orange'}" value="{!$Resource.Orange}" width="200" height="200"/>
  </apex:outputPanel>
</apex:form>
</apex:page>



public with sharing class Task_Picklist_onChange {

    String Color;
   
    public PageReference display() {
        return null;
    }

    public String images { set; }
    
    public list<selectoption> getimages() {
    
        list<selectoption> image = new list<selectoption>();
        image.add(new selectoption('None','No'));
        image.add(new selectoption('Green','Green'));
        image.add(new selectoption('Red','Red'));
        image.add(new selectoption('yellow','Yellow'));
        image.add(new selectoption('Orange','Orange'));
        return image;
    }

    public String colors { get; }
    
    Public String setcolors(String colors) {
    System.debug(colors);
    color = colors;
    return color;
}
}
In SFDC Account1 i was defined a class with a method as follows

global class Integration_Source {

    webservice static void Integration_method() {
   
    System.debug('Sccessfully invoked Remote method');

    }
}

and generated wsdl and Partner wsdl, Now I am trying to invoke the method Integration_method() from SFDC Account2 as follows and i was also defined the remotesite settings there are No Errors in log file status is Success but the Method is not invoked. No String is displayed.
<------ Here i am not displaying the username and password of my SFDC Account1----->
Generated class from WSDL -----> Integration_Dest
Partner WSDL -----> Integration_PartnerSoap


Integration_PartnerSoap.LoginResult loginresult_var;
Integration_PartnerSoap.Soap obj_soap = new Integration_PartnerSoap.Soap();
loginresult_var = obj_soap.login('username','password-security token');

Integration_Dest.Integration_Source obj_source_method = new Integration_Dest.Integration_Source();
obj_source_method.SessionHeader = new Integration_Dest.SessionHeader_element();
obj_source_method.SessionHeader.sessionId = loginresult_var.sessionId;
obj_source_method.Integration_method();
<apex:page controller="Pagnt" tabStyle="Applicant__c">
   <apex:form >
     <apex:panelGrid id="details" >
       <apex:pageBlock >
          <apex:actionStatus id="pageStatus">
            <apex:facet name="start">
              <apex:outputPanel >
                <img src="{!$Resource.Loader}" width="80" height="20" />
              <apex:outputLabel value="Loading..."/>
              </apex:outputPanel>            
            </apex:facet>
          </apex:actionStatus>
         
       <apex:pageblockTable value="{!applist}" var="app">
            <apex:column value="{!app.Name}"/>
            <apex:column value="{!app.First_Name__c}"/>
            <apex:column value="{!app.Email__c}"/>
            <apex:facet name="footer">Page {!pageNumber} of {!totalPages}</apex:facet> 
            
       </apex:pageblockTable>
      Go To Page &nbsp; <apex:inputText value="{!num}" size="1" />
      <apex:commandButton status="pageStatus" value="GO" action="{!Go}" rerender="details" />
       <apex:pageblockButtons >
         <apex:commandButton status="pageStatus" value="First" rerender="details" action="{!First}" disabled="{!prev}"/>
         <apex:commandButton status="pageStatus" value="Previous" rerender="details" action="{!previous}" disabled="{!prev}"/>
         <apex:commandButton status="pageStatus" value="Next" rerender="details" action="{!next}" disabled="{!nxt}"/>
         <apex:commandButton status="pageStatus" value="Last" rerender="details" action="{!Last}" disabled="{!nxt}"/>
       </apex:pageblockButtons>
      
      </apex:pageBlock>
    </apex:panelGrid>
  </apex:form>
</apex:page>

And My Apex Code
 
public with sharing class Pagnt {

    public void Go() 
    {
        
     x = num ;
         
    }

    public Integer num { get; set; }
    
    public Integer x {get; set;}

    public Integer getPageNumber() {
    
       x = offsetsize/LimitSize +1 ;
       
       return x;
   }
    
   public Integer getTotalPages() 
   {
      if (math.mod(totalRecs, Limitsize) > 0) 
      {
         return totalRecs/LimitSize + 1;
         
      } 
      else 
      {
         return (totalRecs/LimitSize);
      }
   }

     public integer totalRecs = 0;
     public integer OffsetSize = 0;
     public integer LimitSize= 5;
     
     public Pagnt()
     {
           totalRecs = [select count() from Applicant__c];
           
           
     }
        
     public List<Applicant__c> getapplist()
     {
          
           List<Applicant__C> app = Database.Query('SELECT Name, first_Name__C, Email__C  FROM Applicant__C ORDER BY createddate ASC NULLS LAST  LIMIT :LimitSize OFFSET :OffsetSize');
           System.debug('Values are ' + app);
           return app;
     }
        
    public void First(){
           
        OffsetSize = 0;
      }
    
    public void previous(){
           
        OffsetSize = OffsetSize - LimitSize;
      }
      
    public void next(){
           
        OffsetSize = OffsetSize + LimitSize;
      }
      
    public void Last(){
           
       OffsetSize = totalrecs - math.mod(totalRecs,LimitSize);
       
      }
    public boolean getprev()
        {
          if(OffsetSize == 0)
          return true;
          else
          return false;
        }
    public boolean getnxt()
       {
          if((OffsetSize + LimitSize) > totalRecs)
          return true;
          else
          return false;
       }
}