• Deepak agarwal 9
  • NEWBIE
  • 128 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 42
    Replies
Hi,

I am unable to finish the dashborad.
"The 'LEAD Trend by Source' dashboard component does not have the wedges set to 'Lead Source'."

Wedges are set to "Lead Source"

Any clues?
 
Hello,

How to assign or remove access to objects on profile "Chatter Moderator User"
  • September 06, 2016
  • Like
  • 0
Hi All,

I am having small confusion.Is dev-401 exam known as Platform dev-1 or is it different.

Thanks,
Deepak.
Hi All,
 
I am facing an issue in which i am getting lists of lists from Controller in lightning and want to set into array because i need each index of element from that list of lists.Here is the code.
Public static list<List<ZenObject__c>> getZenObjsOdd(){
          Integer colcount=getColumnsCount();
          Integer index=0,i;
          
      list<list<ZenObject__c>> lst=new list<list<ZenObject__c>>();
          List<ZenObject__c> ZenobjsOdd=new List<ZenObject__c>();
      List<ZenObject__c> Zenobjs=[Select ZenLms_Name_del__c,ZenLms_SubText__c,ZenImage__c from ZenObject__c order by createddate];
          integer listsize=Zenobjs.size();        
          for(integer col=1;col<=(listsize/colcount);col++){ 
              for(i=index;i<(index+colcount);i++){
                  ZenobjsOdd.add(Zenobjs[i]);    
              }  
              index=i;
               lst.add(ZenobjsOdd); 
          }
          if(math.mod(listsize,colcount)!=0)
          {
              for(integer j=index;j<index+(math.mod(listsize,colcount));j++){
                  ZenobjsOdd.add(Zenobjs[j]);
                  lst.add(ZenobjsOdd); 
                 
              }
          }
        return lst;  
      }

//JS controller
 getZenObjsOdd : function (component){
      var action = component.get("c.getZenObjsOdd"); 
 var items[];
      action.setCallback(this, function(actionResult){
        var state = actionResult.getState();
          if (component.isValid() && state === "SUCCESS"){ 
              items.push(JSON.stringify(actionResult.getReturnValue()));
              console.log('hihih ' +items);
             component.set("v.ZenObjsOdd",items);             
              } 
      });
         $A.enqueueAction(action);
},

From the code it is clear that i am pushing actionResult.getReturnValue()  in array.But there is something wrong here.Anyhelp would be appreciated,


Thanks,
Deepak.

Hi Folks,
 I am writting a wrapper class in which it returns 2 lists.Pls refer the code.
Public class SFDC_Ltng_StakeHolderWrapperClass{
   @AuraEnabled
    Public static SFDC_Ltng_StakeHolderWrapperClass getmethod(){
        SFDC_Ltng_StakeHolderWrapperClass Slswc=new SFDC_Ltng_StakeHolderWrapperClass();
        List<ZenObject__c> ZenobjsEven;
        List<ZenObject__c> ZenobjsOdd;        
        List<ZenObject__c> Zenobjs=[Select ZenLms_Name_del__c,ZenLms_SubText__c from ZenObject__c];
        for(integer i=1;i<=Zenobjs.size();i++){
            if(math.mod(i,2)==0){
                Slswc.ZenobjsEven.addAll(Zenobjs);
               
            }
            else if(math.mod(i,2)!=0)
                Slswc.ZenobjsOdd.addAll(Zenobjs);
            
        }       
       
       return Slswc; 
}
    
}

But i doing some mistake here.As i have less idea on wrapper class.
Critera here is  if(math.mod(i,2)==0){
                            //then i am adding Zenobjs lists to ZenobjsEven
                            else to ZenobjsOdd
}
atlast i need to return 2 lists.
Can anybody help me out here.
Hi Folks,
I have a requirement in which i am getting data dynamically from Salesforce objects to Community builder.I need help in arranging the data in 2 rows at a time.Presenlty i am getting data in this format.But here i need Zenovation center and ZENQMS in 1 row similarly i need again 2records in one row and so on.I am using SLDS here.
<div class="slds">  
        <div class="slds-container--center slds-container--small slds-container--medium">
              <aura:iteration items="{!v.ZenObjsnew}" var="zenobjsnew" aura:id="iter">     
            <div class="slds-grid slds-wrap">
                <div class="slds-size--12-of-12 slds-small-size--6-of-6 slds-medium-size--6-of-12 slds-large-size--6-of-12 blue-bg ">
                    <div class="slds-grid slds-wrap content-box">
                        <div class="slds-size--12-of-12 slds-medium-size--3-of-12">
                            <img src="{!v.imagepath1}" alt="{!v.imagetext1}"/>
                        </div>
                        
                        <div class="slds-size--12-of-12 slds-medium-size--9-of-12">
                           
                            <h4 class="liheading"> 
                                
                               <div>
                                <a href="{!v.linkpath1}">
                                   {!zenobjsnew.ZenLms_Name_del__c}
                                </a>
                                </div> 
                               
                            </h4>
                           
                            <p class="text-limit">{!v.linktext1}
                            </p>
                            <p class="language  spacer">Chinese 
                                        <a href="javascript:void(0)">????
                                        </a> | Korean 
                                        <a href="javascript:void(0)">???
                                        </a> | French 
                                        <a href="javascript:void(0)">Français
                                        </a> | Japanese 
                                        <a href="javascript:void(0)">???
                                        </a>
                          	</p>
                            
                        </div>
						</div>   
                </div>
				</div> 
            </aura:iteration> 
            
            </div>
    </div>


User-added image

Here the data is bring bought from Apex controller in {!zenobjsnew.ZenLms_Name_del__c}.i am unable to understand how do i divide the data row wise with 2 records in 1 row.And the data is being iterated through <aura:iteration> tag and being displayed.

Thanks,
Deepak.
Hi All,

I need help in resolving the error. I have declared a attribute name="flag" and doing some condition check and then setting the attribute value to
 something inside if.But i am getting the following error.
Failed to save undefined: The attribute "flag" was not found on the COMPONENT markup://aura:if: Source​
<aura:attribute name="flag" default="0"/>
<div class="slds">  
        <div class="slds-container--center slds-container--small slds-container--medium">
              <aura:iteration items="{!v.ZenObjsnew}" var="zenobjsnew" aura:id="iter">
            <div class="slds-grid slds-wrap">
              <aura:set attribute="flag" value="0"/>
                       <aura:if istrue="{!lessthan(v.flag,2)}">
                <div class="slds-size--12-of-12 slds-small-size--6-of-6 slds-medium-size--6-of-12 slds-large-size--6-of-12 blue-bg ">
                    <div class="slds-size--1-of-2">
                    <div class="slds-grid slds-wrap content-box">
                        <div class="slds-size--12-of-12 slds-medium-size--3-of-12">
                            <img src="{!v.imagepath1}" alt="{!v.imagetext1}"/>
                        </div>
                        
                        <div class="slds-size--12-of-12 slds-medium-size--9-of-12">
                           
                            <h4 class="liheading"> 
                                
                               <div>
                                <a href="{!v.linkpath1}">
                                   {!zenobjsnew.ZenLms_Name_del__c}
                                </a>
                                </div> 
                               
                            </h4>
                           
                            <p class="text-limit">{!v.linktext1}
                            </p>
                            <p class="language  spacer">Chinese 
                                        <a href="javascript:void(0)">????
                                        </a> | Korean 
                                        <a href="javascript:void(0)">???
                                        </a> | French 
                                        <a href="javascript:void(0)">Français
                                        </a> | Japanese 
                                        <a href="javascript:void(0)">???
                                        </a>
                              </p>
                            
                        </div>
                        </div>   
                </div>
                </div>
                <aura:set attribute="flag" value="{!add(v.flag,1)}"/>    
                </aura:if>
                </div>  
            </aura:iteration>
              </div>          
            </div>

Thanks in Advance,
Deepak.
 
Hi Folks,

I am having an apex class which is having AuraEnabled method which returns list of accounts to <aura:iteration >. I am not able to display the list in component.Code is very simple nothing complicated.
  
Need help ASAP.


<aura:component controller="Accounts">
    <aura:attribute name="Acc" type="Account[]" default="{'sObjectType':'Account',
                                                                         'Name':'',
                                                         'Id':''}"/>
    <aura:iteration items="{!v.Acc}" var="acc">
    <p>{!acc.Name}</p>
    </aura:iteration>
</aura:component>

//Server side controller
public with sharing class Accounts {
    @AuraEnabled
    Public Static List<Account> getAccount(){
  return  [Select Name,id from Account LIMIT 2];
      
    
}
}

 
<apex:page sidebar="false" showHeader="false" docType="html-5.0" controller="Ecommerce">
<apex:form >
<apex:actionFunction name="passStringToController" action="{!myMethod}" reRender="op">
<apex:param name="params" assignTo="{!EnteredText}" value=""/>
</apex:actionFunction>
<apex:outputPanel id="op">
<apex:outputText value="{!prodlist}"/>
</apex:outputPanel>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
 $("#ip1").keyup(function(){
 var enteredtext=document.getElementById("ip1").value;
  //alert(enteredtext); 
    passStringToController(enteredtext);
});
});
</script>
<center><h1>Welcome to Ecommerce Website</h1></center>
<div class="searchproducts">
 <form>
  <input type="text" placeholder="Search Products.." class="sp" id="ip1"/>
  <input type="text" name="search" placeholder="Search Categories.." class="sc"/>
</form> 
</div>  
<style>
.sp{
    width: 160px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    background-image: url('http://www.freeiconspng.com/uploads/search-icon-png-22.png');
    background-position: 10px 10px; 
    background-repeat: no-repeat;
    padding: 12px 20px 12px 40px;
    -webkit-transition: width 0.4s ease-in-out;
    transition: width 0.4s ease-in-out;
    float:right;
}

.sp:focus{
    width: 20%;
}
.sc{
    width: 160px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    background-image: url('http://www.freeiconspng.com/uploads/search-icon-png-22.png');
    background-position: 10px 10px; 
    background-repeat: no-repeat;
    padding: 12px 20px 12px 40px;
    -webkit-transition: width 0.4s ease-in-out;
    transition: width 0.4s ease-in-out;
    float:right;
}

.sc:focus{
    width: 20%;
}
h1{
font-size:20px;
}
</style>
</html>
</apex:form>
</apex:page>

//Controller

public class Ecommerce {
public String EnteredText{get;set;}
public List<Product2> prodlist{get;set;}
    public PageReference myMethod() {
   system.debug(EnteredText);
    List<Product2> prodlist=[Select Name from Product2 where name like: EnteredText + '%'];
    system.debug(prodlist);
        return null;
    }

}
Hi All,

 Need help.MY Requirement here is in my vf page i should be able to display result from controller.
 What i am doing is using onkeyup event which invokes passStringToController() method in action function which inturns calls mymethod in controller and there i am fetching results using query.Now the query result i wanted to display in vf page. Basically the idea is i am designing a ecommerce website so when any user enters product name like 'c' it should display all products with c.If he types on like "co" then it should display products with co like we search in amazon and all.
the result should be displayed exactly in the input text area.

Thanks in Advance
 
Hi Guys,

 I Have a very different situation. I have a batch apex and test class.Now my requirement is executing batch from test class.When i am running test class the debug statements of Start,Execute and Finish Methods are getting displayed but in Apex Jobs there is no sign of the batch.Like the Batch name and all are not getting displayed in Apex Jobs.
global class BatchClassexample implements Database.Batchable<sObject> {
    
    global String query = 'SELECT Id,Name FROM Account where name=:filter ';
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        system.debug('inside methiod----');
        String filter='Client';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
        //User u=[SELECT username from user where profileid='00e28000000sxOR'];
        system.debug('inside execute::'+scope);
        for(Account a : scope)
        {
            a.Name = a.Name + '(newyork)';
            System.debug('::::::: execute');
            update a;
        }
        system.debug('scope ::: '+scope);	
       // update scope;
        system.debug('scope after ::: '+scope);
        //system.runAs(u){}
    }
    global void finish(Database.BatchableContext BC) {
        system.debug('inside finish');
    }
}


//Test class
@isTest()
  public class BatchClassexampleTestClass {
        public static testMethod void testRunAs(){       
        Test.startTest();
        BatchClassexample BC=new BatchClassexample();
        Account a=new Account(name='Client');
            insert a;
		/*Profile p = [SELECT Id FROM Profile WHERE Name='Standard Platform User']; 
      User u = new User(Alias = 'standt', Email='standardplatformuser@testorg.com', 
      EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
      LocaleSidKey='en_US', ProfileId = p.Id, 
      TimeZoneSidKey='America/Los_Angeles', UserName='standardplatformuser@testorg.com');
            insert u;*/
 
            User u=[SELECT username,ProfileId from user where profileid='00e28000000sxOR'];
              system.runAs(u){
               System.debug('u :::::: '+u);
				System.debug('u.ProfileId :::::: '+u.ProfileId);   
            	DataBase.executeBatch(BC,1); 
               System.debug('name ::: '+a.Name);
              Test.stopTest(); 
               System.debug('name after ::: '+a.Name);
           }
       }
          }

 
Hi There,

Can anybody tell me how to run dataloader in batch mode.


Thanks.
Hi Guys,

Need help in coverage.I have written test class for below batch apex biut was able to achieve only 50% coverage.Pls help me to get 100% coverage.

global class BatchClassexample implements Database.Batchable<sObject> {
    
    global String query = 'SELECT Id,Name FROM Account where name=:filter ';
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        system.debug('inside methiod----');
        String filter='bBVINES';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
        //User u=[SELECT username from user where profileid='00e28000000sxOR'];
        system.debug('inside method 1---');
        for(Account a : scope)
        {
            a.Name = a.Name + 'By bhuvanBam';
        }
        system.debug(scope);	
        update scope;
        //system.runAs(u){}
    }
    global void finish(Database.BatchableContext BC) {
    }
}


//Test class
@isTest
   public class BatchClassexampleTestClass {
        public static testMethod void testRunAs(){        
        String filter='bBVINES';
        Test.startTest();
        BatchClassexample BC=new BatchClassexample();
         Account a=new Account(name='bBVINES');
            insert a;
            List<Account> alist=[Select name from Account where name like '%bBVINES%'];
            for(Account afor:alist){
               afor.name=afor.name+'Bhuvanbam';
            }
            update alist;
            User u=[SELECT username from user where profileid='00e28000000sxOR'];
           system.runAs(u){} 
            DataBase.executeBatch(BC,200);
           Test.stopTest();
       
        
       } 
          }

 
Hi All,
 
Below is Vf code.The issue is when i click on any name i should get its related data.
Example :IF  name is Deepak if i click on deepak i should get its related data like its related account name and all.


Thanks,
Deepak
<apex:page controller="conrec1" sidebar="false" showHeader="false">
<apex:pageBlock title="Search for the contact">
<apex:form >
<apex:inputText value="{!data}"/>
<apex:commandButton value="Search"/>
<apex:pageBlockTable title="Contact" var="f" value="{!data1}" columns="3">
<apex:column value="{!f.name}" headerValue="Name"/>
<apex:column headerValue="Email" value="{!f.Email}"/>
<apex:column headerValue="Phone" value="{!f.phone}"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
 
</apex:page>
 
public class conrec1 {
public list<contact> l;
public string data{get;set;}
public list<contact> getdata1(){
l= [select name,email,phone from contact where name like: data + '%'];
system.debug(l);
return l;
}
    
}


 
HI all,

I am creating opportunites report but is not showing territory information on it.That particular opp's account is having few territories.
Refer screen shot for further clearity.There is no territory name displayed.

User-added image


Thanks,
Deepak
public class my6 {
string Calender='cale';
public List<SelectOption> getdates() {
 List<SelectOption> options = new List<SelectOption>();
 for(integer i=1890;i<2000;i++){
 options.add(new SelectOption(+i,+i));
       }
   return options;
        }
       public string getCalender(){
        return Calender;
        }
public void setCalender(string Calender){
this.Calender=Calender;
}

}

 
Hi,

A query which shows all rejected leads for a particular month.

Thanks,
Deepak
Hi,
Need Help!!
trigger Update_modified_date on Task (after insert,after update) {      
     list<task> t=[SELECT LastModifiedDate FROM Task];
    list<lead> l=[select TaskLastModifiedDate__c from lead where Isconverted = false];
        for(task t1:t){
            //system.debug('this is ----------------------------------');
            for(lead l1:l){
                system.debug('this is ----------------------------------');
            l1.TaskLastModifiedDate__c=t1.LastModifiedDate;
            l.add(l1.TaskLastModifiedDate__c);  
                
            }
        }
    update l;
    }


Iam trying to copy last modified date of task in lead.But iam getting the following error.Please help.

Error: Incompatible element type Datetime for collection of Lead
Hi
i want opportunities count for each account using soql.
show lastmodified date of task on lead.
user should able to see lastmodified date of tasks on lead.
apex class to get each Account and their opportunities count.
A list view that shows accounts with related opportunities.

public with sharing class lead_create {
public lead_create(){
set<id> lead_l=new set<id>();
lead_l=[select id from lead where rating like:'%hot%'];
task t=new task(subject='email',whoid=lead_l.id);
insert t;
}
}

Error: Illegal assignment from List<Lead> to Set<Id> at line 4 column 1

Please help!!
Thanks in advance

Hi All,

I am having small confusion.Is dev-401 exam known as Platform dev-1 or is it different.

Thanks,
Deepak.
Hi All,
 
I am facing an issue in which i am getting lists of lists from Controller in lightning and want to set into array because i need each index of element from that list of lists.Here is the code.
Public static list<List<ZenObject__c>> getZenObjsOdd(){
          Integer colcount=getColumnsCount();
          Integer index=0,i;
          
      list<list<ZenObject__c>> lst=new list<list<ZenObject__c>>();
          List<ZenObject__c> ZenobjsOdd=new List<ZenObject__c>();
      List<ZenObject__c> Zenobjs=[Select ZenLms_Name_del__c,ZenLms_SubText__c,ZenImage__c from ZenObject__c order by createddate];
          integer listsize=Zenobjs.size();        
          for(integer col=1;col<=(listsize/colcount);col++){ 
              for(i=index;i<(index+colcount);i++){
                  ZenobjsOdd.add(Zenobjs[i]);    
              }  
              index=i;
               lst.add(ZenobjsOdd); 
          }
          if(math.mod(listsize,colcount)!=0)
          {
              for(integer j=index;j<index+(math.mod(listsize,colcount));j++){
                  ZenobjsOdd.add(Zenobjs[j]);
                  lst.add(ZenobjsOdd); 
                 
              }
          }
        return lst;  
      }

//JS controller
 getZenObjsOdd : function (component){
      var action = component.get("c.getZenObjsOdd"); 
 var items[];
      action.setCallback(this, function(actionResult){
        var state = actionResult.getState();
          if (component.isValid() && state === "SUCCESS"){ 
              items.push(JSON.stringify(actionResult.getReturnValue()));
              console.log('hihih ' +items);
             component.set("v.ZenObjsOdd",items);             
              } 
      });
         $A.enqueueAction(action);
},

From the code it is clear that i am pushing actionResult.getReturnValue()  in array.But there is something wrong here.Anyhelp would be appreciated,


Thanks,
Deepak.

Hi Folks,

I am having an apex class which is having AuraEnabled method which returns list of accounts to <aura:iteration >. I am not able to display the list in component.Code is very simple nothing complicated.
  
Need help ASAP.


<aura:component controller="Accounts">
    <aura:attribute name="Acc" type="Account[]" default="{'sObjectType':'Account',
                                                                         'Name':'',
                                                         'Id':''}"/>
    <aura:iteration items="{!v.Acc}" var="acc">
    <p>{!acc.Name}</p>
    </aura:iteration>
</aura:component>

//Server side controller
public with sharing class Accounts {
    @AuraEnabled
    Public Static List<Account> getAccount(){
  return  [Select Name,id from Account LIMIT 2];
      
    
}
}

 
<apex:page sidebar="false" showHeader="false" docType="html-5.0" controller="Ecommerce">
<apex:form >
<apex:actionFunction name="passStringToController" action="{!myMethod}" reRender="op">
<apex:param name="params" assignTo="{!EnteredText}" value=""/>
</apex:actionFunction>
<apex:outputPanel id="op">
<apex:outputText value="{!prodlist}"/>
</apex:outputPanel>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
 $("#ip1").keyup(function(){
 var enteredtext=document.getElementById("ip1").value;
  //alert(enteredtext); 
    passStringToController(enteredtext);
});
});
</script>
<center><h1>Welcome to Ecommerce Website</h1></center>
<div class="searchproducts">
 <form>
  <input type="text" placeholder="Search Products.." class="sp" id="ip1"/>
  <input type="text" name="search" placeholder="Search Categories.." class="sc"/>
</form> 
</div>  
<style>
.sp{
    width: 160px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    background-image: url('http://www.freeiconspng.com/uploads/search-icon-png-22.png');
    background-position: 10px 10px; 
    background-repeat: no-repeat;
    padding: 12px 20px 12px 40px;
    -webkit-transition: width 0.4s ease-in-out;
    transition: width 0.4s ease-in-out;
    float:right;
}

.sp:focus{
    width: 20%;
}
.sc{
    width: 160px;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    background-image: url('http://www.freeiconspng.com/uploads/search-icon-png-22.png');
    background-position: 10px 10px; 
    background-repeat: no-repeat;
    padding: 12px 20px 12px 40px;
    -webkit-transition: width 0.4s ease-in-out;
    transition: width 0.4s ease-in-out;
    float:right;
}

.sc:focus{
    width: 20%;
}
h1{
font-size:20px;
}
</style>
</html>
</apex:form>
</apex:page>

//Controller

public class Ecommerce {
public String EnteredText{get;set;}
public List<Product2> prodlist{get;set;}
    public PageReference myMethod() {
   system.debug(EnteredText);
    List<Product2> prodlist=[Select Name from Product2 where name like: EnteredText + '%'];
    system.debug(prodlist);
        return null;
    }

}
Hi All,

 Need help.MY Requirement here is in my vf page i should be able to display result from controller.
 What i am doing is using onkeyup event which invokes passStringToController() method in action function which inturns calls mymethod in controller and there i am fetching results using query.Now the query result i wanted to display in vf page. Basically the idea is i am designing a ecommerce website so when any user enters product name like 'c' it should display all products with c.If he types on like "co" then it should display products with co like we search in amazon and all.
the result should be displayed exactly in the input text area.

Thanks in Advance
 
Hi Guys,

 I Have a very different situation. I have a batch apex and test class.Now my requirement is executing batch from test class.When i am running test class the debug statements of Start,Execute and Finish Methods are getting displayed but in Apex Jobs there is no sign of the batch.Like the Batch name and all are not getting displayed in Apex Jobs.
global class BatchClassexample implements Database.Batchable<sObject> {
    
    global String query = 'SELECT Id,Name FROM Account where name=:filter ';
    global Database.QueryLocator start(Database.BatchableContext BC)
    {
        system.debug('inside methiod----');
        String filter='Client';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext BC, List<Account> scope)
    {
        //User u=[SELECT username from user where profileid='00e28000000sxOR'];
        system.debug('inside execute::'+scope);
        for(Account a : scope)
        {
            a.Name = a.Name + '(newyork)';
            System.debug('::::::: execute');
            update a;
        }
        system.debug('scope ::: '+scope);	
       // update scope;
        system.debug('scope after ::: '+scope);
        //system.runAs(u){}
    }
    global void finish(Database.BatchableContext BC) {
        system.debug('inside finish');
    }
}


//Test class
@isTest()
  public class BatchClassexampleTestClass {
        public static testMethod void testRunAs(){       
        Test.startTest();
        BatchClassexample BC=new BatchClassexample();
        Account a=new Account(name='Client');
            insert a;
		/*Profile p = [SELECT Id FROM Profile WHERE Name='Standard Platform User']; 
      User u = new User(Alias = 'standt', Email='standardplatformuser@testorg.com', 
      EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
      LocaleSidKey='en_US', ProfileId = p.Id, 
      TimeZoneSidKey='America/Los_Angeles', UserName='standardplatformuser@testorg.com');
            insert u;*/
 
            User u=[SELECT username,ProfileId from user where profileid='00e28000000sxOR'];
              system.runAs(u){
               System.debug('u :::::: '+u);
				System.debug('u.ProfileId :::::: '+u.ProfileId);   
            	DataBase.executeBatch(BC,1); 
               System.debug('name ::: '+a.Name);
              Test.stopTest(); 
               System.debug('name after ::: '+a.Name);
           }
       }
          }

 
Hi All,
 
Below is Vf code.The issue is when i click on any name i should get its related data.
Example :IF  name is Deepak if i click on deepak i should get its related data like its related account name and all.


Thanks,
Deepak
<apex:page controller="conrec1" sidebar="false" showHeader="false">
<apex:pageBlock title="Search for the contact">
<apex:form >
<apex:inputText value="{!data}"/>
<apex:commandButton value="Search"/>
<apex:pageBlockTable title="Contact" var="f" value="{!data1}" columns="3">
<apex:column value="{!f.name}" headerValue="Name"/>
<apex:column headerValue="Email" value="{!f.Email}"/>
<apex:column headerValue="Phone" value="{!f.phone}"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
 
</apex:page>
 
public class conrec1 {
public list<contact> l;
public string data{get;set;}
public list<contact> getdata1(){
l= [select name,email,phone from contact where name like: data + '%'];
system.debug(l);
return l;
}
    
}


 
public class my6 {
string Calender='cale';
public List<SelectOption> getdates() {
 List<SelectOption> options = new List<SelectOption>();
 for(integer i=1890;i<2000;i++){
 options.add(new SelectOption(+i,+i));
       }
   return options;
        }
       public string getCalender(){
        return Calender;
        }
public void setCalender(string Calender){
this.Calender=Calender;
}

}

 
If I want to set up the permission levels for Person Account then where I need to make those entries?
trigger newacconsal on Contact (after insert) {
    set<Id> ids=new set<Id>()
    
    map<id,Account> macc=new map<id,Account>();
    map<id,Contact> mcon=new map<id,Contact>();
    
        map<id,Account> macc=trigger.old;

}


Error

Illegal assignment from Map<Id,Contact> to Map<Id,Account>
Hi Team,

Can any one please help me to create a trigger for below senario.

Object: Task
if Task.Support Team Request = AE Support Request
then{
if Task.created by.Pole = NA or North America then set Task.project= AE NA or Project id= xxxx
if Task.created by.Pole = China then set Task.project= AE China or Project id= xxxx1
if Task.created by.Pole = APAC then set Task.project= AE APAC or Project id= xxxx2
if Task.created by.Pole = EMEA or MEA then set Task.project= AE EMEA or Project id= xxxx3
if Task.created by.Pole = LATAM then set Task.project= AE LATAM or Project id= xxxx4
}

Thanks in Advance
I want integrate Visualforce Component into a Visualforce Page. Can any one help.
Hi All,

I want an Quote tab similar to Orders tab. I hope its not possible by general development. Can someone help me with the VF page for the quote tab.

Thanks!!
Hi,

I am unable to finish the dashborad.
"The 'LEAD Trend by Source' dashboard component does not have the wedges set to 'Lead Source'."

Wedges are set to "Lead Source"

Any clues?
 
I am trying to refresh the visualforce page with
 <apex:commandButton value="Refresh Button" action="{!QuickSave}"/>
but it throws an error as unknown method. Can anyone please help on this?

I have also tried with 
<apex:commandButton value=" Refresh " onclick="URL"/>
but still not refreshing
i  am using custom controller for opportunity and i have field on my page account name, when i enter account name and submit it does not et store in opportuity  i want to fetch and store account name in opportunity object when i click submit button my VF page.