• Shubham Nandwana
  • NEWBIE
  • 466 Points
  • Member since 2017
  • Salesforce

  • Chatter
    Feed
  • 12
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 9
    Questions
  • 84
    Replies
Hi,
I am looking for scenario based interview questions for Salesforce. Mosty in google I am able to find theory question but what I observe in my recent 2-3 interviews instead of direct questions interviewers are focusing on situation and scenario based question. I am having 1.7 years of experience as salesforce developer, if anyone can suggest from where I do prepare for my interview what would be really helpful.

If anyone have certain set of questions,please send it over my email as well- harsha.suman9421@gmail.com 

Thanks in advance!!
Hello,

As I am trying to insert more than 10000 records by using batch apex,getting error too many DML.
As 
 there is goverener limit that we can not perform dml more than 10000 records but I am using Batch apex,in that it overecome the governer limit by separting into batches(batches having their own limits).but not able to perform how to achiev this,

Please help me in this:
Thank you.
here is  my code: 

global class insertRecordsUsingBatchApex implements database.Batchable<sObject>{
    
    global database.QueryLocator start(database.BatchableContext bc){
        return database.getQueryLocator('select id,name,myEmail__c from Account limit 2000 ');
    }
    
    global void execute(database.BatchableContext bc,list<Account> scope){
        for(Account cc:scope){
            for(integer i=0;i<=10001;i++){
                //10001 records insert
                Account a=new Account(name='testingforInsertRecords' +i,myEmail__C='bsdh@gmail.com' );
                scope.add(a);
            }
            insert scope;
            
        }
        
    }
    global void finish(database.BatchableContext bc){       
        
    }
}

database.execute(**,100);
https://ap4lc-dev-ed.my.salesforce.com/_ui/common/apex/debug/ApexCSIPage

While creating account record I want to set the status to Open by default and after creation, I want to change status to complete if linked contact records are 10 or greater than 10?
hi all , i am not able to write to cover code palease suppot me 
trigger soluation on gole__c(before insert,before update){
    set<string> SetAgentIds = new Set<string>();
    Map<string,string> MapSalesAgentsWithNpn = new Map<string,String>();
    for(gole__c sales:trigger.new){
            if(sales.Writing_Agent_ID__c!=null){
                SetAgentIds.add(sales.Writing_Agent_ID__c);
            }
    }
    if(SetAgentIds.size()>0){
        for(Agent__c SalsAgent:[select id,AWN__c,NPN__c  from Agent__c where AWN__c IN:SetAgentIds]){
                MapSalesAgentsWithNpn.put(SalsAgent.AWN__c,SalsAgent.NPN__c);
        
        }
    }
    
    for(gole__c sales:trigger.new){
      if(MapSalesAgentsWithNpn.containsKey(sales.Writing_Agent_ID__c)){
                  sales.Writing_Agent_NPN__c=MapSalesAgentsWithNpn.get(sales.Writing_Agent_ID__c);
      }
    }
    
 
}
Hi All,

Need one quick help. is there any way to fetch the AsyncApex limits from org. As we know that we are having 250000 AsyncApex jobs limits for every 24 hour. after increasing it by salesforce can we verify that limit has been increased from 2.5 Lcs to some other number.
sop can we fetched that limits details by any way?
Any response will be appriciated.

Thanks,
Chanchal
Error:Apex trigger TaskToCommunityTrigger caused an unexpected exception, contact your administrator: TaskToCommunityTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []: Class.TaskToCommunity.aftrupdate: line 27, column 1
=======================================================================
public class TaskToCommunity {

    public static void aftrupdate(Map<id,contact> oldmap,Map<id,Contact> newmap){

        list<Task> ta=new list<Task>();
        user u=[select id from user where alias='sree'];

        // profile p=[select id from profile where name='Partner Community User'];
        for(id key:oldmap.keyset()){
            Contact old=oldmap.get(key);
            Contact newmp=newmap.get(key);
            
            if(old.Phone!=newmp.Phone){
                Task t=new Task();
                t.OwnerId=u.id; 
               // t.OwnerId=p.id; 
                //t.OwnerId=userinfo.getUserId();
                t.Status='Pending';
                t.Priority='Normal';
                //t.WhatId=newmp.id;
                
                t.ActivityDate=system.today();
                t.Subject='Testing';
                ta.add(t);
            }
        }
        update ta;
    }
}
===============================================================================================
trigger TaskToCommunityTrigger on Contact (after update) {

    if(trigger.isafter && trigger.isupdate){
    TaskToCommunity.aftrupdate(Trigger.oldmap, Trigger.newmap);
}
}

 
Hi,
I am confused in what cases should we use apex:pageMessages, apex:pageMessage, apex:Message and apex:Messages? 

Thanks.
Harshit
Hi,

Is there a way to make an exact replica of an org (including data in the objects).

Thanks.
Prateek Singh.

Hi,
I want to create a tab for Standard object User. Can I do so, if yes then how to do so?

Thanks in advance.

Hi,
I have a custom object having multi-select picklist which contains the name of all the contacts. I want to write a trigger on contact which updates values in picklist whenever a new contact is added. 
Can anyone help me provide the code for that? Any help is appreciated.

Shubham Nandwana.
 
Hi all! Is it possible to create a field with multiple lookup(s) in a custom object page? 

In the custom object page, there are 3 pages (from a seperate custom object) that fall within the same field, however I would like to have them as individual look-up fields. If this is possible, how can I go about with this? 

Thanks!!
How do I use my extension "myController" to show information on my visual force page?
User-added image
Im wanting to pull the information up onto this screen which is my VisualForce page :-
User-added image
Here is the code for my VisualForce page:-
<apex:page lightningStyleSheets="true" StandardController="Apprentice__c" extensions="myController" title="Apprentice Documentation">
    <apex:form >
    <!--myController refers to the Apex class I created called myController.apxc this is so I can use two object types in one form in place of a Standard controller
        For refrence ApprenticeObj = new Apprentice__c and ComponentsObj = new Apprenticeship_Component__c-->
        
    <!--Style-->
        <style>
        body{
        font-family: Arial,Helvetica,sans-serif;
        color: #000000;
        Padding:25px;
        }
        </style>
    <!--End of Style-->
        
        <apex:pageBlock >
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! Apprentice__c.Name}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        
     <!--Apprentice Details Section-->
        <apex:pageBlock title="Apprentice Details">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! Apprentice__c.Apprentice_name__c}"/>
                <apex:inputField value="{! Apprentice__c.Curriculum_Verified__c}"/>
                <apex:inputField value="{! Apprentice__c.Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Programme_Area__c}"/>
                <apex:inputField value="{! Apprentice__c.Vacancy__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Start_Date__c}"/>
                <apex:inputField value="{! Apprentice__c.Levy_Status__c}"/>
                <apex:inputField value="{! Apprentice__c.Programme_Agreed_With_Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Existing_Employee__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        <!--End of Apprentice Details Section-->
        
        <!--Line Manager Details Section-->
         <apex:pageBlock title="Line Manager Details">
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! Apprentice__c.Line_Manager__c}"/>
               <apex:inputField value="{! Apprentice__c.Line_Manager_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Line_Manager_Email__c}"/>
               <apex:inputField value="{! Apprentice__c.Line_Manager_Mobile__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
     <!--End ofLine Manager Details Section-->
        
     <!--Previous Education & Diagnostics-->
       <apex:pageBlock title="Previous Education & Diagnostics">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! Apprentice__c.English_Assessment__c}"/>
                <apex:inputField value="{! Apprentice__c.Date_of_Birth__c}"/>
                <apex:inputField value="{! Apprentice__c.Maths_Assessment__c}"/>
                <apex:inputField value="{! Apprentice__c.Funding_Line__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_Previous_Attainment__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_ICT_Achievement__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_English_Qual__c}"/>
                <apex:inputField value="{! Apprentice__c.Prior_Learning_Record_Attached__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_Maths_Qual__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Difficulties__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Education & Diagnostics-->
        
        <!--Apprenticeship Programme-->
        
        <apex:pageBlock title="Apprenticeship Programme">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Title__c}"/>
                <apex:inputField value="{! Apprentice__c.Minimum_Duration__c}"/>
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Pathway__c}"/>
                <apex:inputField value="{! Apprentice__c.Prefered_Duration__c}"/>
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Level__c}"/>
                <apex:inputField value="{! Apprentice__c.Development_Coach__c}"/>
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Type__c}"/>
                <apex:inputField value="{! Apprentice__c.Usual_College_Day__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
      <!--End of Apprenticeship Programme-->
        
      <!--Functional Skills-->
        <apex:pageBlock title="Functional Skills">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Functional_Maths__c}"/>
                <apex:inputField value="{! Apprentice__c.Maths_Status__c}"/>
                <apex:inputField value="{! Apprentice__c.Functional_English__c}"/>
                <apex:inputField value="{! Apprentice__c.English_Status__c}"/> 
                <apex:inputField value="{! Apprentice__c.Functional_ICT__c}"/> 
                <apex:inputField value="{! Apprentice__c.ICT_Status__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Functional Skills-->
        
        <!--Existing Employer Details-->
        <apex:pageBlock title="Existing Employer Details">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Original_Start_Date__c}"/>
                <apex:inputField value="{! Apprentice__c.Additional_Skills_Existing_Employee__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Existing Employer Details-->
        
        <!--End Point Assessment (EPA)-->
        <apex:pageBlock title="End Point Assessment (EPA)">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Functional_Maths__c}"/>
                <apex:inputField value="{! Apprentice__c.Maths_Status__c}"/>
                <apex:inputField value="{! ComponentsObj.Qual_Aim_Text__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of End Point Assessment (EPA)-->
        
      <!--Apprenticeship Components-->
        
        <apex:pageBlock title="Apprenticeship Components">
            <apex:pageBlockSection columns="1" >
                <apex:inputField value="{! ComponentsObj.Apprenticeship_Qualifications__c}"/> 
                <apex:inputField value="{! ComponentsObj.Learning_Aim_Code__c}"/>
                <apex:inputField value="{! ComponentsObj.Level__c}"/>
                <apex:inputField value="{! ComponentsObj.Delivery_Location__c}"/>
                <apex:inputField value="{! ComponentsObj.Start_Date__c}"/>
                <apex:inputField value="{! ComponentsObj.Expected_End_date__c}"/>
                <apex:inputField value="{! ComponentsObj.Percentage_of_Aim_to_be_Delivered__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Apprenticeship Components-->
        
      <!--Save/Cancel-->
       
        <apex:pageBlock >
        <apex:commandButton action="{!save }" value="Save" />
        </apex:pageBlock>
        
      <!--End of Save/Cancel-->
            

    </apex:form>
</apex:page>
And here is my Controller Extension 
public class myController{
public Apprentice__c ApprenticeObj{get;set;}
public Apprenticeship_Component__c ComponentsObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public Apprenticeship_Qual__c Qual {get;set;}  
ApexPages.StandardController sc;
public myController(ApexPages.StandardController sc){ 
    this.sc = sc; 
    ApprenticeObj = new Apprentice__c(); 
    ComponentsObj = new Apprenticeship_Component__c(); 
    ProgramArea = new Programme_Area__c ();
    Qual = new Apprenticeship_Qual__c ();
}
    public void saveObjects(){
         ProgramArea.PA_Code__c = 'P12';
         insert ProgramArea;
         ApprenticeObj.Programme_area__c = ProgramArea.Id;
         ApprenticeObj.Date_of_Birth__c = date.parse('12/08/2000');
         insert ApprenticeObj;
         ComponentsObj.Apprentice__c = ApprenticeObj.Id;
         Qual.Course_Code__c = '5363hdg';
         Qual.Qual_Aim__c = 'QualAim';
         Qual.Qualification_Type__c = 'Competency';
         insert Qual;
         ComponentsObj.Apprenticeship_Qualifications__c = Qual.Id;
         insert ComponentsObj;
    }
}


Any help is much appreciated thanks
 
What are the ways to call a function on the Page Layout apart from the constructor calling.

Kindly help me on this.

Thanks.

I have a VF page that I'm embedding in a standard page layout. I'd like to pass a parameter into the VF page. The VF page's controller will look at the parameter and the current record, then decide what to display on the embedded page.

 

I have the VF page and controller written. But how can I get the standard page layout editor to pass a parameter in to the VF page? Is that even possible? If not, do you have any other suggestions?

 

Thanks!