• Dhananjay Patil 12
  • NEWBIE
  • 60 Points
  • Member since 2016
  • Tata Consultancy Services

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 27
    Replies
My Requirement is When I update Classification values on Top Account(Parent Account),it updates values on all child accounts.
I have Written a batch apex class for this as I faced CPU Timeout error earlier.
Below is the code for Batch Apex Class:
global class batchAccountUpdate implements Database.batchable<sObject>{ 
   public String query;
   global database.querylocator start(Database.BatchableContext info){
   system.debug('query Result:'+query);
       String query1='select Id,ParentId,RecordTypeId,UltimateParent__c,AccountCategory__c,Account_Subcategory__c ,AccountClassification1__c, AccountClassification2__c, AccountClassification3__c,AccountClassification4__c, AccountClassification5__c, AccountClassification6__c, AccountClassification7__c, AllowClassificationUpdate__c,Allow_CategorySubCategory_Update__c,BillingCountry,BillingCountryCode from Account where Id='+query+'';
   system.debug('Query1 Result:'+query1);
   system.debug('Start Info:'+info);
    return Database.getquerylocator(query);
    }     
   global void execute(Database.BatchableContext info, List<Account> children){
       
       if (!children.isEmpty()) {
                update children;
            }
   }     
   global void finish(Database.BatchableContext info){     
   } 
}
The purpose of this batch is to perform DML operation only.I have created instance of this class in another apex class where I have written an actual logic.
Below is the Apex class:
public static List<Account> updateClassification(Map<Id,Account> accMap) {
List<Account> accList = findAccountToUpdate(accMap);
// find ultimate accounts with classification fields
Set<Id> utimateIds = new Set<Id>();
for (Account acc: accList) {
utimateIds.add(acc.UltimateParent__c);
}
Map<Id,Account> ultimateMap = new Map<Id,Account>(new SelectAccounts().execute(utimateIds));
SET<ID> keys = ultimateMap.keyset();

// update statistics from ultimates
List<Account> accToUpdate = new List<Account>();
for (Account acc: accList) {
Account parentAccount = ultimateMap.get(acc.UltimateParent__c);
accToUpdate.add(new Account(
Id = acc.Id,
AccountCategory__c = parentAccount.AccountCategory__c,
Account_Subcategory__c = parentAccount.Account_Subcategory__c,
AccountClassification1__c = parentAccount.AccountClassification1__c,
AccountClassification2__c = parentAccount.AccountClassification2__c,
AccountClassification4__c = parentAccount.AccountClassification4__c,
AccountClassification5__c = parentAccount.AccountClassification5__c,
AccountClassification6__c = parentAccount.AccountClassification6__c,
AccountClassification7__c = parentAccount.AccountClassification7__c,    
AllowClassificationUpdate__c = true,
Allow_CategorySubCategory_Update__c = true
));
}
string query= '\''+String.join(keys,'\',\'')+'\'';

//Calling Batch Class
batchAccountUpdate execbatch = new batchAccountUpdate();
execbatch.query = query;
database.executebatch(execbatch);
resetAllowClassificationUpdate(accToUpdate);
resetAllowCategoryUpdate(accToUpdate);

return accToUpdate;
}

Whenever I Update Classification Value son Top Accounts or If I do Reparenting,it always throws an exception whenever it runs the natch class.
I can not add this method to Batch Class as the method has lots of dependency on another methods.
My Ultimate Goal is I whenever I perform DML,I have to call batch job so that CPU Runtime error will not face as I can update more than 200 Child records at a time too.

Can someone help what is wrong in the above code? 
 

I am having problem while running below class:
 
@isTest
public with sharing class HandlerTest {

 @isTest static void testScheduleTaskBatch() {
    // Get the information from the CronTrigger API object
    List<CronTrigger> ctBefore = [select Id, CronExpression, TimesTriggered, NextFireTime, State from CronTrigger WHERE CronJobDetail.Name ='SheduledSendTaskBatch' AND State != 'DELETED'];

    System.debug('### ctBefore: ' + ctBefore);

    System.assertEquals(0, ctBefore.size());

    Test.startTest();
      Handler.scheduleTaskBatch(0);
    Test.stopTest();

      List<CronTrigger> ctAfter = [select Id, CronExpression, TimesTriggered, NextFireTime, State from CronTrigger WHERE CronJobDetail.Name = 'SheduledSendTaskBatch' AND State != 'DELETED'];
      System.assertEquals(1, ctAfter.size());
  }

}

It throws below error:

Class HandlerTest Method Name testScheduleTaskBatch Pass/Fail Fail Error Message System.AssertException: Assertion Failed: Expected: 0, Actual: 1 Stack Trace Class.HandlerTest.testScheduleTaskBatch: ' System.assertEquals(0, ctBefore.size());' on this line

I face this assertion error only when if there is any existing Apex Job of name 'SheduledSendTaskBatch' is running in my Org.
But As per my understanding during test class execution the query should return only the batch job that i created in my test class.
I created a Batch Job in Developer console(For Testing purpose in order to debug the issue) like this:
 
SendCMDOTaskBatch m = new SendCMDOTaskBatch();

String sch = '30 0 0 22 12 ?';

String jobID = system.schedule('SheduledSendTaskBatch', sch, m);

at the same time if I run my test class then it throws the assertion error.
Can someone please help how can I avoid this situation?
I have created an account in my test class but when it is querying for Account acc,it gives me Null every time. I have created a VF and create a controller class for this.
Below is My Apex Class:
 
public class createAccountTeamMember {
 public List <AccountWrapper> wrappers {get;set;}
 private Integer nextIdent = 0;
 public static boolean isValid = true;
 public static boolean isValid1 {get;set;}
 public static boolean isError {get;set;}
 public static string accId = ApexPages.currentPage().getParameters().get('AccId');
 public Account acct;
 static {
  getAccount();
 }
 public createAccountTeamMember(ApexPages.StandardController Controller) {
     AccountTeamMember a1 = (AccountTeamMember)Controller.getRecord();
     system.debug(' AccountTeamMember a1'+a1);

  wrappers = new List < AccountWrapper > ();
  for (Integer idx = 0; idx < 5; idx++) {
   wrappers.add(new AccountWrapper(nextIdent++));
  }
 }
 public static Account getAccount() {

  try {
      system.debug('accId:'+accId);
      system.debug('Current User:'+UserInfo.getUserId());

     Account acc = [SELECT Id, Name,Global_Key_Account__c,Global_KAM__c FROM Account WHERE Id = : accId AND((Global_Key_Account__c = true AND Global_KAM__c =:UserInfo.getUserId()) OR(Regional_Key_Account__c = true AND Regional_KAM__c =:UserInfo.getUserId()) OR (Country_Key_Account__c = true AND Country_KAM__c =:UserInfo.getUserId()))];
      system.debug('Global Key Account:'+acc.Global_Key_Account__c);
      if (acc != null) {
    isError = false;
    return acc;
   } else {
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Only Global Key Account Manager,Regional Key Account Manager & Country Key Account Manger can add Team Members on Key Account Only.'));
    return null;
   }
  } catch (Exception e) {
      system.debug('e:'+e);
   isError = true;
   ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Only Global Key Account Manager,Regional Key Account Manager & Country Key Account Manger can add Team Members on Key Account Only.');
   ApexPages.addMessage(myMsg);
   return null;
  }
 }
 public PageReference save() {
  List < AccountTeamMember > atms = new List < AccountTeamMember > ();
  Set <Id> vAtms = new Set <Id> ();
  for (AccountWrapper wrap: wrappers) {
   if (wrap.at.UserId != null) {
       system.debug('wrapat:'+wrap);
    if (wrap.at.TeamMemberRole != null) {
     wrap.TeamMemberError = '';
     if (vAtms.contains(wrap.at.UserId) == false) {
      if (isValid == true)
       isValid = true;
      wrap.DuplicateError = '';
      vAtms.add(wrap.at.UserId);
      atms.add(wrap.at);
     } else {
      isValid = false;
      wrap.DuplicateError = 'Duplicate Values Not Allowed';
      wrap.TeamMemberError = '';
     }
    } else {
     isValid = false;
     wrap.TeamMemberError = 'Please Input a Value for Team Member';
     isValid1 = true;
     wrap.DuplicateError = '';
    }
   }
  }
  if (!atms.isEmpty() && atms != null && isValid == true) {
   insert atms;
  }
  if (isValid == true) {
   return new PageReference('/' + accId);
  } else
   return null;
 }
 public class AccountWrapper {
  public AccountTeamMember at {get;set;}
  public Integer ident {get;set;}
  public boolean isInsert {get;set;}
  public String TeamMemberError {get;set;}
  public String DuplicateError {get;set;}
  public AccountWrapper(Integer inIdent) {
   ident = inIdent;
   isInsert = true;
   at = new AccountTeamMember(AccountId = accId, AccountAccessLevel = 'Edit');
   TeamMemberError = '';
   DuplicateError = '';
  }
 }
}

and Below is the Test Class that I am trying to Cover:
 
@isTest public class createAccountTeamMemberTest {

@isTest static void testAccountWrapper(){
    Profile p=[Select Id from Profile where Name='Sales Rep'];
    Profile pManager=[Select Id from Profile where Name='Sales Manager'];
    User uManager=TestUtils.createUser('Jon','Favreau','jon.favreau@test.com',pManager.Id,true);
    User usr=TestUtils.createUser('Scarlet','Johnson','scarlet.johnson@test.com',p.Id,true);
    User u=[Select Id from User where Id=:usr.Id];
    User usr1=TestUtils.createUser('Robert','Downey','robert.downey@test.com',p.Id,true);
    TriggerFactory.bypassApex = true;
     Account act=TestUtils.CreateAccount('TestAcc','Customer',true);
    act.Global_Key_Account__c=true;
    act.Global_KAM__c =uManager.Id;
    update act;
      system.debug('Global Key Account:'+act.Global_Key_Account__c);
    system.debug('Manager ID:'+uManager.Id);
    Account ac=[Select Id,Name from Account where Id=:act.Id];
    system.debug('ac:'+ac);
    TriggerFactory.bypassApex = false;
     AccountTeamMember at=new AccountTeamMember(UserId=u.id,TeamMemberRole='Sales',AccountId=act.Id,AccountAccessLevel = 'Edit');
   // system.debug('AccountTeamMember'+at);
        insert at;
    system.debug('at'+at);
    System.RunAs(uManager){
    test.startTest(); 
PageReference pageRef =Page.Add_Account_Team_Member;

pageRef.getParameters().put('AccId', String.valueOf(act.Id));
Test.setCurrentPage(pageRef);
        system.debug('pageRef'+pageRef);
ApexPages.StandardController stdController = new ApexPages.standardController(at);
system.debug('stdController'+stdController);

        createAccountTeamMember.AccountWrapper aw=new createAccountTeamMember.AccountWrapper(5);
        createAccountTeamMember catm = new createAccountTeamMember(stdController);
        createAccountTeamMember.getAccount();
   catm.save();     

    test.stopTest();
    }

    }
}

but in my controller class,it is giving me Account as Null.Not sure why it is not giving me the account that i created in test class. Can someone help me in that?
Hi--I have a requirement where I have to create custom button that unchecks the checkbox value if the checkbox is already checked.
Somehow I am able to check the checkbox value to false by click on custom button.but the biggest showstooper that I am facing in my requirement is we have 5 tabs & if I click on  any one of the tabs then I have to caputure the ID or the name of the tab that i clicked on it.
I have write the following code;


​For Button:
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
sforce.connection.sessionId = '{!$Api.Session_ID}';
var Result = sforce.apex.execute("OutcomeController","checkboxFalse", {opportunityId: "{!Opportunity.Id}"});
alert('Result:'+Result);
if(Result=='false'){
window.location.reload();
}


 
Controller Class:
 
global with sharing class OutcomeController {
    public string myStage{get; set;}
    ......................
 
  public Map<String, List<VerifiableOutcome__c>> OutcomesByStage {
        get {
            if (OutcomesByStage == null) {
                OutcomesByStage = new Map<String, List<Outcome__c>>();
            }
            return OutcomesByStage;
        }
        private set;
    }

 
    public void StageNme()
    {
        system.debug('myStage:'+myStage);
    }
 
 
   
        webservice static boolean checkboxFalse(Id opportunityId)
    {
    Opportunity currentOpportunity = OpportunityServices.getOpportunity(opportunityId);
      Outcome__c voi1= VerifiableOutcome__c.getValues('Solution Implemented');  
     Outcome__c voi2= VerifiableOutcome__c.getValues('Schedule Created');     
      system.debug('voi1 stage NAme:'+voi1.StageName__c);
       system.debug('voi2 stage NAme:'+voi2.StageName__c);
  
          
                //system.debug('vo name:'+vo);
                if (currentOpportunity.get(voi1.FieldName__c) == true && voi1.StageName__c=='Implement') {
                currentOpportunity.SolutionImplemented__c=false;
                update currentOpportunity;  
                }
                if(currentOpportunity.get(voi2.FieldName__c) == true && voi2.StageName__c=='Cause')
                {
                currentOpportunity.ScheduleCreated__c=false;
                update currentOpportunity; 
                }
                else{
                    return true;
                }
               
                return false;
       
    }
}


VF Page:
 
<apex:page docType="html-5.0" standardController="Opportunity" extensions="OutcomeController" showHeader="false" sidebar="false" standardStylesheets="false" applyHtmlTag="false" applyBodyTag="false">
<html>
<head>
<script>
var j$ = jQuery.noConflict();

j$(function() {

  
    j$('.voCheckbox').click(function() {
        j$('[id$=":selectedVerifiableOutcomeIdInput"]').val(j$(this).data("outcome"));
        j$('[id$=":currentStageInput"]').val(j$(this).data("stage"));
        completeVOActionJSCheck();
       
    });     
    // get tab container
    var container = document.getElementById("tabcontainer");
    var tabcon = document.getElementById("tabscontent");
    var navitem = document.getElementById("tabheader_{!SUBSTITUTE(currentStage,' ','')}");
  
    if (navitem != null) {
        //store which tab we are on
        var ident = navitem.id.split("_")[1];
        navitem.parentNode.setAttribute("data-current",ident);
       //set current tab with class of activetabheader
        navitem.setAttribute("class","active");
       
    }
    //this adds click event to tabs
    var tabs = container.getElementsByTagName("li");
    console.log('tabdata8:'+tabs);
    for (var i = 0; i < tabs.length; i++) {
    tabs[i].onclick=displayPage;
    console.log('tabdata9:'+tabs[0]);
   
    }
    // show active panel
  
    var curTab = document.getElementById("tabpage_{!SUBSTITUTE(currentStage,' ','')}");
    console.log('tabdata10:'+curTab);
    if (curTab != null) {
        curTab.style.display='block';
    }
});

// on click of one of tabs
function displayPage() {
   
    var current = this.parentNode.getAttribute("data-current");
    console.log('current tab name'+current);
    if (current != null) {
        //remove class of activetabheader and hide old contents
        document.getElementById("tabheader_" + current).removeAttribute("class");
        document.getElementById("tabpage_" + current).style.display="none";
    }
    ident = this.id.split("_")[1];
    console.log('ident:'+ident);
   
    //add class of activetabheader to new active tab and show contents
    this.setAttribute("class","active");
    document.getElementById("tabpage_" + ident).style.display="block";
    this.parentNode.setAttribute("data-current",ident);
}

 /*function dosomejavascript()
 { // set up my param to pass to action function
 var myParam = 'abc';
 //call my action function - myParam variable should be set to 'somevariable' in my controller
 StageNme(myParam);
 console.log('myParam Name:'+myParam);
 }*/
 

</script>

</head>

<body>

<!-- variables -->
<apex:variable value="{!Opportunity.Tender__c}" var="oppTender" />
<apex:variable value="{!Opportunity.AccountId}" var="oppAccId" />

<apex:form id="mainForm">

<apex:actionFunction action="{!completeVOActionKP}" name="completeVOActionJSKP" />
<apex:actionFunction action="{!completeVOActionDoc}" name="completeVOActionJSDoc" />
<apex:actionFunction action="{!completeVOActionCheck}" name="completeVOActionJSCheck" />
<apex:actionFunction action="{!StageNme}" name="StageNme"  rerender="">
<apex:param name="v" value="" assignTo="{!myStage}" />
</apex:actionFunction>


<apex:inputHidden value="{!selectedVerifiableOutcomeId}" id="selectedOutcomeIdInput" />
<apex:inputHidden value="{!currentStage}" id="currentStageInput" />

<!-- Error window -->
<apex:outputPanel rendered="{!isError}">
    <div class="modal" id="errorMessage" tabindex="-1" role="dialog" aria-labelledby="errorMessageModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">Error</h4>
                </div>
                <div class="modal-body">
                    <p>{!errorMessage}</p>
                </div>
            </div>
        </div>
    </div>
    <script>
        j$('#errorMessage').modal('show');
    </script>
</apex:outputPanel>

<apex:outputPanel rendered="{!doParentReload && !isError}" layout="none">
    <script>
        // Go back to the opportunity detail page
        if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {
            // Salesforce1 navigation
            //sforce.one.navigateToSObject(aId);
        }
        else {
            // Set the window's parent URL using a Visualforce expression
            window.top.location.href = '/{!Opportunity.Id}';
        }
    </script>
</apex:outputPanel>

<apex:outputPanel id="allTabs" layout="block">

    <!-- Steps -->
    <div id="tabcontainer">
        <div id="tabs">
            <ul class="stackedProgress">
            <apex:repeat value="{!stageNames}" var="stage">
                <li id="tabheader_{!SUBSTITUTE(stage,' ','')}" >
                    <div class="content">
                        <div class="ico">
                            <i class="{!verifiableOutcomesUI[stage].Icon__c} icon"></i>
                                <apex:outputPanel layout="none" rendered="{!stageCompletedOutcomes[stage] == true}">
                                    <i class="fa fa-check green secondaryIcon"></i>
                                </apex:outputPanel>
                                <apex:outputPanel layout="none" rendered="{!stageInWarningOutcomes[stage] == true}">
                                    <i class="fa fa-exclamation-triangle orange secondaryIcon"></i>
                                </apex:outputPanel>
                        </div>
                        <div class="stepText">
                            <span style="float:left; margin-right:5px;">
                                <apex:outputPanel layout="none" rendered="{!stageCompletedOutcomes[stage] == true}">
                                    <i class="fa fa-check green"></i>
                                </apex:outputPanel>
                                <apex:outputPanel layout="none" rendered="{!stageInWarningOutcomes[stage] == true}">
                                    <i class="fa fa-exclamation-triangle orange"></i>
                                </apex:outputPanel>
                            </span>
                            <strong style="overflow: hidden;">{!stage}</strong>
                            <div class="descr"><apex:outputText value="{!OutcomesUI[stage].Description__c}" /></div>
                        </div>
                    </div>
                </li>
            </apex:repeat>
            </ul>
        </div>

        <div id="tabscontent">

        <apex:repeat value="{!stageNames}" var="stage">
            <div class="tabpage" id="tabpage_{!SUBSTITUTE(stage,' ','')}" data-style="tab">

                <div class="leftCol">

                <h4 class="secondaryTitle">
                    <apex:outputPanel layout="none" rendered="{!stageCompletedOutcomes[stage] == true}">
                        <i class="fa fa-check green"></i>
                    </apex:outputPanel>
                    <apex:outputPanel layout="none" rendered="{!stageInWarningOutcomes[stage] == true}">
                        <i class="fa fa-exclamation-triangle orange"></i>
                    </apex:outputPanel>
                    {!stage}
                </h4>

                <h4>{!$Label.VO_Expected_Milestone_Completion_Date}:<span style="white-space: pre"> </span>
                    <span style="white-space: nowrap">
                    <apex:outputText value="{0,date,dd MMM YYYY}">
                        <apex:param value="{!currentOpportunity[stageToEndDate[stage]]}" />
                    </apex:outputText>
                    </span>
                </h4>

                <!-- <p class="secondaryDescription"><apex:outputText value="{!verifiableOutcomesUI[stage].Description__c}" /></p> -->

                <apex:repeat var="outcome" value="{!OutcomesByStage[stage]}">

                    <!-- INFO BLOCK -->
                    <apex:outputPanel layout="block" rendered="{!outcome.Type__c == 'CLASSIFICATION'}">
                        <p>
                            <label class="outcome-name">{!outcome.Name}:</label>
                            <apex:outputPanel layout="none" rendered="{!currentOpportunity[outcome.FieldName__c] == true}">
                                <i class="fa fa-check green"></i>
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!currentOpportunity[outcome.FieldName__c] == false}">
                                <i class="fa fa-times red"></i>
                            </apex:outputPanel>
                        </p>
                    </apex:outputPanel>

            
                    <!-- CHECKBOX BLOCK -->
                    <apex:outputPanel layout="block" rendered="{!outcome.Type__c == 'CHECKBOX'}">
                        <p>
                            <label class="outcome-name">{!outcome.Name}:</label>
                            <apex:outputPanel layout="none" rendered="{!currentOpportunity[outcome.FieldName__c] == true}">
                                <i class="fa fa-check green"></i>
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!currentOpportunity[outcome.FieldName__c] == false}">
                               
                                <apex:outputPanel rendered="{!isEditAllowed}" layout="none">
                                    <input type="checkbox" class="voCheckbox" data-outcome="{!outcome.Id}" data-stage="{!stage}" style="vertical-align: middle" />
                                </apex:outputPanel>
                                <apex:outputPanel rendered="{!!isEditAllowed}" layout="none">
                                    <input type="checkbox" style="vertical-align: middle" disabled="true" />
                                </apex:outputPanel>

                            </apex:outputPanel>
                        </p>
                    </apex:outputPanel>

                </apex:repeat>

            </div>

            <div class="rightCol">
                <apex:outputText escape="false" value="{!$Label[verifiableOutcomesUI[stage].HelpLabel__c]}" rendered="{!oppTender=false}" />
                <apex:outputText escape="false" value="{!$Label[verifiableOutcomesUI[stage].HelpLabelTender__c]}" rendered="{!oppTender=true}" />
            </div>

            </div>
        </apex:repeat>
        </div>
    </div>
</apex:outputPanel>
</apex:form>

</body>
</html>
</apex:page>


if u have referred the VF code,there is a function called as 'Display Page' inwhich there is a variable called as 'Ident' that gives me the exact value of the tabs that i clicked and I must pass the Variable 'Ident' value to the controller class which i am trying to pass by using following syntax
 
<apex:actionFunction action="{!StageNme}" name="StageNme"  rerender="">
<apex:param name="v" value="Ident" assignTo="{!myStage}" />
</apex:actionFunction>



whatever the Stage Value I get in the Ident variable I have to pass the value and assign to the  Variable 'myStage' of the controller but I am not able to pass it out not sure why??
Can somebody please help me how can i pass the variable value to the controller class so that I can use it in my If() of Weservice method?
because right now the problem that I am facing while unchecking the checkbox is I am not able uncheck the exact checkbox of the current tab,it randomly executes the condition and randomly uncheck the checkbox and this is true because I am not able to pass the value of click event in my controller class.

Your Help is really appreciate for me to fix this issue.
 
I have a requirement in which when click on delete button on the account it should allow you to delete only when its related contacts status  are inactive..Otherwise it should throw some error message on UI..
 I have solved this requirement by writing an apex code & Creating a new label where I can specify the message which is working fine but there is one standard scenrio where it failing ..When I merge 2 accounts if loosing accoun contains contact of active status then it is throwing me an error message but as per my requirement I have to bypass the code when it comes to the account...I have referred some docs about Trigger and Merge and found that MasterRecordID is getting set on lossing record.....but On winning record what kind of condtion should I specify so that it  works....because my coding is getting triggered on before delete event....
Hello Guys,
I have a requirement inwhich system will allow to delete an account only when its related contacts status are inactive...if any of the contacts are active then it should throw an error message..I have fulfilled this functionality by writing apex code on beforedelete event..My code is working fine but there is a standard functionlity in salesforce called as "Merging"........In that scenario when i merge two accounts,if loosing account contains  active records then it is throwing me validation message...but I have to bypass my code when it comes to the merging....

Can anybody suggest me,how I bypass the code? 

One thing I tried,note down the masterid of winning record and put in my condition where I can bypass the scenario..but when I merge the accounts then I am not able to get MasterID of Winiing record....I am not sure why this is happening??? 
Ideally I should get some ID of the merge operation.......
 
Hello,

One of our team has recently created an "Activities" tab via visualforce page and they unchecked the "Visualforce Page: Activities ~ Salesforce - Unlimited EditionAvailable for Salesforce mobile apps and Lightning Pages" option which means this "Activities"  tab is not visible in SF1 application.

I just wanted to know whether  creation of this new Visualforce page affects on existing Activities that were created through "Account" or "Contact" tabs.

In our higher environment some user complaining they are not able to see activities in SF1 application which is visible in Desktop application.we never faced this visibility related issues before...
 
Whenever I login to my application using SF1 it throws a certification related error..

"the certificate of this server is incvalid.You might be connecting to a server that is pretending to be which could put your confidential information at risk"

If I click on the Domain name again,it launch the application but if I drilldown to any record of Accoutn,Opportunity,Contacts any it shows me blank screen...
I have already logged in to the mobile browser and Insatll the certificates manually but in SF1 application,I am still having a trouble and I can not see any data whenever i drilldown to any record... 
 
Hi Guys,
On Account Object there is a lookup field  callled as 'AccountManager' where I can assign the user(Lookup(User)). 
Now  there is a tab called as "Account Team " where I can add multiple users which I can modify.
Suppose A is the user who creates an account then he can add and modify the "Account Team " members.
and in the 'AccountManager'field if I add the user as 'B'.when I login to the application as B and navigating to the perticular account that was created by A then B can see the Account Team Member(Read Only) but can not add or delete it.

I have a requirement inwhich if any user who creates an account and add the user in 'AccountManager' field then Account Manager should  modify the team members. 

I know with manually it is possible but i am looking for a programatical way like writing an apex class then call its method in trigger.
It would be better if I get any example


 
Hi,

I have a requirement inwhich There is a field of type Picklist "BU__C" which is present on both User and Task object.Now when a user create a contact record,when he creates a task,value of "BU__C" of User should be stamp to the "BU__C" in Task.
e.g.If Value "BU__c" of user is "ABC" then in task "BU__C" must be stamp with the value as "ABC".

I have to solve this by writing a apex class not a trigger.
Can somebody help me how to do it via apex sharing class?
It would be better if it explains with example
Hello,
My configure with Outlook.when i add an email from outlook to salesforce then the task is created on a perticular contact which is the existing functionlity of application.
there is workflow rule we are using here,
Workflow Rule: ABCUpdate ~ Salesforce - Unlimited Edition

AND( ISPICKVAL(Owner:User.BusinessUnit__c ,"ABC"), $User.BypassWorkflow__c = FALSE, ISPICKVAL( BusinessUnit__c,""))

then we are updating a field "BusinessUnit__c " with value as ABC

this value is updated as soon as task is created.

Now as currently WF rule doesn't trigger when task is craeted via outlook which is a bug in salesforce.
I need to create a trigger for this.
Can someone help me how to create a trigger when i add an email from outlook to salesforce,in the task,it should update the field "BusinessUnit__c " with value as ABC

It would be better if is explain with code example as I am new in apex coding.


 
Hi,
I have a requirement inwhich after changing the record type of an account,it change the owner of account to the new owner as well as send an email alerts to the user.For this I created  a WF rule inwhich I have created 2 WF actions:
1 for the Field updates i.e.change the account type the new user.
then I have created an email servicea and use a custom email template.
Now problem when i receive an email,in the opening of an email I receive new user's first name.But my expection is after changing the owner of the record in the email opening i should receive old user's first name.

e.g.if user Dhananjay create an account  of type "Temporary".account is created.now the another user "DJ" change the record type from "Temporary" to "Customer" then  when Dhananjay receives an email from DJ,in the mail opening it should be start with "Hello Dhannajay" not "Hello DJ".


Following are the email template that i used:

Hello {!User.FirstName} ,
This is to inform you that the account
{!Account.Name} has been verified by the CMDO team and created as a {!Account.RecordType}.
Thank you.
Test


instaed of {!User.FirstName} i used {!Account.CreatedBy},this solved my issue but i want previous users first name only not the complete name.In Created by it gives First name as well as last name which is default.

is there any way i can receive old user's first name even after changing the owner of record?



 
Hello All,

I have a following query: 

SELECT name,ParentId FROM Attachment WHERE name like 'Spon%' AND ParentId IN (SELECT ID FROM Opportunity where SponsorLetterAgreedUpon__c=false) 

this query is working is expected but I have to add the "SponsorLetterAgreedUpon__c"(type checkbox) field at the start of select statement i.e.

SELECT name,ParentId,SponsorLetterAgreedUpon__c FROM Attachment WHERE name like 'Spon%' AND ParentId IN (SELECT ID FROM Opportunity where SponsorLetterAgreedUpon__c=false) 

like this.In order to check the value but if I use "Opportunity.SponsorLetterAgreedUpon__c"  then it throws an error that I mentioned in the heading.
The reason that I am adding this field is because I have to run a cleanup job using data loader and I must add this field in the select statement in order to know the value in column.
 Can I someone tell me what I've missed?
 
 I am not actually getting the Relationship between Opportunity and Attachment.
 Ideally below query should've worked:
 
 SELECT name,ParentId,Attachment.Opportunity__r.SponsorLetterAgreedUpon__c FROM Attachment WHERE name like 'Spon%' AND ParentId IN (SELECT ID FROM Opportunity where SponsorLetterAgreedUpon__c=false) 
 
 
 Let me know with you reply
Hey Guys,

I have created a following query: 

Select Id,Name,SponsorLetter__c,(Select Name From Attachments where Name Like'Sponsor Letter%') from opportunity where SponsorLetter__c<>true

In this query SponsorLetter_c is a custom field of type checkbox and we have craeted a visual force page inwhich provided a button for this perticular field.functionality behind this button is if I Attach a document,In the Notes and Attachement the document is geeting displayed along with Field Label+Name of the Docuemnt.
E.g.If I attach a doucment name 'test.txt',in the notes and attachment it display the fiel anme like 'SponserLetter-test.txt' like that which is our current functionality.
now when the document is attached.Checkbox is checked(true) for SponsorLetter__c(Again this is visualforce page modification by proving an images of checkbox based on the value).

I am testing negative scenario like When the document is attached,Checboxbox is getting checked but in the Query Editor I chenged the value to False even if document is attached.
Now the query that I mentioned Earlier,it gives me result of All the opportunity records where SponsorLetter__c is false and in the attachements column it displays blank/null value  for the records as well as it display the Opportunity record where I've done my negative scenario including the name of attachment.

Now this query is working as expected but my concern is I want to display only those Opportunity Records where SponsorLetter__c=false and in Attachments Column
it display does not display the blank value.

I have tried with the below new query to solve the problem 


Select Id,Name,SponsorLetter__c,(Select Name From Attachments where Name Like'Sponsor Letter%') from opportunity where SponsorLetter__c<>true AND Attachment.Name<>''


if you observe the last condition i.e. "Attachment.Name<>''  ",it throws an error.but the reason I used this condion is to avoid the blank values which i am getting in Attachments Column.

Can Sommeone help me to sort out this problem?

In this case I have created negative scenario on only one opportunity record whose SponsorLetter__c=false though it contains an attachments.Ideally I should get Only one records(i.e.Negative scenario)

Please provide ur suggession along with query where do I put the exact contion in order to avoid blank value in the attachments.
My Requirement is When I update Classification values on Top Account(Parent Account),it updates values on all child accounts.
I have Written a batch apex class for this as I faced CPU Timeout error earlier.
Below is the code for Batch Apex Class:
global class batchAccountUpdate implements Database.batchable<sObject>{ 
   public String query;
   global database.querylocator start(Database.BatchableContext info){
   system.debug('query Result:'+query);
       String query1='select Id,ParentId,RecordTypeId,UltimateParent__c,AccountCategory__c,Account_Subcategory__c ,AccountClassification1__c, AccountClassification2__c, AccountClassification3__c,AccountClassification4__c, AccountClassification5__c, AccountClassification6__c, AccountClassification7__c, AllowClassificationUpdate__c,Allow_CategorySubCategory_Update__c,BillingCountry,BillingCountryCode from Account where Id='+query+'';
   system.debug('Query1 Result:'+query1);
   system.debug('Start Info:'+info);
    return Database.getquerylocator(query);
    }     
   global void execute(Database.BatchableContext info, List<Account> children){
       
       if (!children.isEmpty()) {
                update children;
            }
   }     
   global void finish(Database.BatchableContext info){     
   } 
}
The purpose of this batch is to perform DML operation only.I have created instance of this class in another apex class where I have written an actual logic.
Below is the Apex class:
public static List<Account> updateClassification(Map<Id,Account> accMap) {
List<Account> accList = findAccountToUpdate(accMap);
// find ultimate accounts with classification fields
Set<Id> utimateIds = new Set<Id>();
for (Account acc: accList) {
utimateIds.add(acc.UltimateParent__c);
}
Map<Id,Account> ultimateMap = new Map<Id,Account>(new SelectAccounts().execute(utimateIds));
SET<ID> keys = ultimateMap.keyset();

// update statistics from ultimates
List<Account> accToUpdate = new List<Account>();
for (Account acc: accList) {
Account parentAccount = ultimateMap.get(acc.UltimateParent__c);
accToUpdate.add(new Account(
Id = acc.Id,
AccountCategory__c = parentAccount.AccountCategory__c,
Account_Subcategory__c = parentAccount.Account_Subcategory__c,
AccountClassification1__c = parentAccount.AccountClassification1__c,
AccountClassification2__c = parentAccount.AccountClassification2__c,
AccountClassification4__c = parentAccount.AccountClassification4__c,
AccountClassification5__c = parentAccount.AccountClassification5__c,
AccountClassification6__c = parentAccount.AccountClassification6__c,
AccountClassification7__c = parentAccount.AccountClassification7__c,    
AllowClassificationUpdate__c = true,
Allow_CategorySubCategory_Update__c = true
));
}
string query= '\''+String.join(keys,'\',\'')+'\'';

//Calling Batch Class
batchAccountUpdate execbatch = new batchAccountUpdate();
execbatch.query = query;
database.executebatch(execbatch);
resetAllowClassificationUpdate(accToUpdate);
resetAllowCategoryUpdate(accToUpdate);

return accToUpdate;
}

Whenever I Update Classification Value son Top Accounts or If I do Reparenting,it always throws an exception whenever it runs the natch class.
I can not add this method to Batch Class as the method has lots of dependency on another methods.
My Ultimate Goal is I whenever I perform DML,I have to call batch job so that CPU Runtime error will not face as I can update more than 200 Child records at a time too.

Can someone help what is wrong in the above code? 
 

I am having problem while running below class:
 
@isTest
public with sharing class HandlerTest {

 @isTest static void testScheduleTaskBatch() {
    // Get the information from the CronTrigger API object
    List<CronTrigger> ctBefore = [select Id, CronExpression, TimesTriggered, NextFireTime, State from CronTrigger WHERE CronJobDetail.Name ='SheduledSendTaskBatch' AND State != 'DELETED'];

    System.debug('### ctBefore: ' + ctBefore);

    System.assertEquals(0, ctBefore.size());

    Test.startTest();
      Handler.scheduleTaskBatch(0);
    Test.stopTest();

      List<CronTrigger> ctAfter = [select Id, CronExpression, TimesTriggered, NextFireTime, State from CronTrigger WHERE CronJobDetail.Name = 'SheduledSendTaskBatch' AND State != 'DELETED'];
      System.assertEquals(1, ctAfter.size());
  }

}

It throws below error:

Class HandlerTest Method Name testScheduleTaskBatch Pass/Fail Fail Error Message System.AssertException: Assertion Failed: Expected: 0, Actual: 1 Stack Trace Class.HandlerTest.testScheduleTaskBatch: ' System.assertEquals(0, ctBefore.size());' on this line

I face this assertion error only when if there is any existing Apex Job of name 'SheduledSendTaskBatch' is running in my Org.
But As per my understanding during test class execution the query should return only the batch job that i created in my test class.
I created a Batch Job in Developer console(For Testing purpose in order to debug the issue) like this:
 
SendCMDOTaskBatch m = new SendCMDOTaskBatch();

String sch = '30 0 0 22 12 ?';

String jobID = system.schedule('SheduledSendTaskBatch', sch, m);

at the same time if I run my test class then it throws the assertion error.
Can someone please help how can I avoid this situation?
I have created an account in my test class but when it is querying for Account acc,it gives me Null every time. I have created a VF and create a controller class for this.
Below is My Apex Class:
 
public class createAccountTeamMember {
 public List <AccountWrapper> wrappers {get;set;}
 private Integer nextIdent = 0;
 public static boolean isValid = true;
 public static boolean isValid1 {get;set;}
 public static boolean isError {get;set;}
 public static string accId = ApexPages.currentPage().getParameters().get('AccId');
 public Account acct;
 static {
  getAccount();
 }
 public createAccountTeamMember(ApexPages.StandardController Controller) {
     AccountTeamMember a1 = (AccountTeamMember)Controller.getRecord();
     system.debug(' AccountTeamMember a1'+a1);

  wrappers = new List < AccountWrapper > ();
  for (Integer idx = 0; idx < 5; idx++) {
   wrappers.add(new AccountWrapper(nextIdent++));
  }
 }
 public static Account getAccount() {

  try {
      system.debug('accId:'+accId);
      system.debug('Current User:'+UserInfo.getUserId());

     Account acc = [SELECT Id, Name,Global_Key_Account__c,Global_KAM__c FROM Account WHERE Id = : accId AND((Global_Key_Account__c = true AND Global_KAM__c =:UserInfo.getUserId()) OR(Regional_Key_Account__c = true AND Regional_KAM__c =:UserInfo.getUserId()) OR (Country_Key_Account__c = true AND Country_KAM__c =:UserInfo.getUserId()))];
      system.debug('Global Key Account:'+acc.Global_Key_Account__c);
      if (acc != null) {
    isError = false;
    return acc;
   } else {
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Only Global Key Account Manager,Regional Key Account Manager & Country Key Account Manger can add Team Members on Key Account Only.'));
    return null;
   }
  } catch (Exception e) {
      system.debug('e:'+e);
   isError = true;
   ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Only Global Key Account Manager,Regional Key Account Manager & Country Key Account Manger can add Team Members on Key Account Only.');
   ApexPages.addMessage(myMsg);
   return null;
  }
 }
 public PageReference save() {
  List < AccountTeamMember > atms = new List < AccountTeamMember > ();
  Set <Id> vAtms = new Set <Id> ();
  for (AccountWrapper wrap: wrappers) {
   if (wrap.at.UserId != null) {
       system.debug('wrapat:'+wrap);
    if (wrap.at.TeamMemberRole != null) {
     wrap.TeamMemberError = '';
     if (vAtms.contains(wrap.at.UserId) == false) {
      if (isValid == true)
       isValid = true;
      wrap.DuplicateError = '';
      vAtms.add(wrap.at.UserId);
      atms.add(wrap.at);
     } else {
      isValid = false;
      wrap.DuplicateError = 'Duplicate Values Not Allowed';
      wrap.TeamMemberError = '';
     }
    } else {
     isValid = false;
     wrap.TeamMemberError = 'Please Input a Value for Team Member';
     isValid1 = true;
     wrap.DuplicateError = '';
    }
   }
  }
  if (!atms.isEmpty() && atms != null && isValid == true) {
   insert atms;
  }
  if (isValid == true) {
   return new PageReference('/' + accId);
  } else
   return null;
 }
 public class AccountWrapper {
  public AccountTeamMember at {get;set;}
  public Integer ident {get;set;}
  public boolean isInsert {get;set;}
  public String TeamMemberError {get;set;}
  public String DuplicateError {get;set;}
  public AccountWrapper(Integer inIdent) {
   ident = inIdent;
   isInsert = true;
   at = new AccountTeamMember(AccountId = accId, AccountAccessLevel = 'Edit');
   TeamMemberError = '';
   DuplicateError = '';
  }
 }
}

and Below is the Test Class that I am trying to Cover:
 
@isTest public class createAccountTeamMemberTest {

@isTest static void testAccountWrapper(){
    Profile p=[Select Id from Profile where Name='Sales Rep'];
    Profile pManager=[Select Id from Profile where Name='Sales Manager'];
    User uManager=TestUtils.createUser('Jon','Favreau','jon.favreau@test.com',pManager.Id,true);
    User usr=TestUtils.createUser('Scarlet','Johnson','scarlet.johnson@test.com',p.Id,true);
    User u=[Select Id from User where Id=:usr.Id];
    User usr1=TestUtils.createUser('Robert','Downey','robert.downey@test.com',p.Id,true);
    TriggerFactory.bypassApex = true;
     Account act=TestUtils.CreateAccount('TestAcc','Customer',true);
    act.Global_Key_Account__c=true;
    act.Global_KAM__c =uManager.Id;
    update act;
      system.debug('Global Key Account:'+act.Global_Key_Account__c);
    system.debug('Manager ID:'+uManager.Id);
    Account ac=[Select Id,Name from Account where Id=:act.Id];
    system.debug('ac:'+ac);
    TriggerFactory.bypassApex = false;
     AccountTeamMember at=new AccountTeamMember(UserId=u.id,TeamMemberRole='Sales',AccountId=act.Id,AccountAccessLevel = 'Edit');
   // system.debug('AccountTeamMember'+at);
        insert at;
    system.debug('at'+at);
    System.RunAs(uManager){
    test.startTest(); 
PageReference pageRef =Page.Add_Account_Team_Member;

pageRef.getParameters().put('AccId', String.valueOf(act.Id));
Test.setCurrentPage(pageRef);
        system.debug('pageRef'+pageRef);
ApexPages.StandardController stdController = new ApexPages.standardController(at);
system.debug('stdController'+stdController);

        createAccountTeamMember.AccountWrapper aw=new createAccountTeamMember.AccountWrapper(5);
        createAccountTeamMember catm = new createAccountTeamMember(stdController);
        createAccountTeamMember.getAccount();
   catm.save();     

    test.stopTest();
    }

    }
}

but in my controller class,it is giving me Account as Null.Not sure why it is not giving me the account that i created in test class. Can someone help me in that?
I have a requirement in which when click on delete button on the account it should allow you to delete only when its related contacts status  are inactive..Otherwise it should throw some error message on UI..
 I have solved this requirement by writing an apex code & Creating a new label where I can specify the message which is working fine but there is one standard scenrio where it failing ..When I merge 2 accounts if loosing accoun contains contact of active status then it is throwing me an error message but as per my requirement I have to bypass the code when it comes to the account...I have referred some docs about Trigger and Merge and found that MasterRecordID is getting set on lossing record.....but On winning record what kind of condtion should I specify so that it  works....because my coding is getting triggered on before delete event....
Hi Guys,
On Account Object there is a lookup field  callled as 'AccountManager' where I can assign the user(Lookup(User)). 
Now  there is a tab called as "Account Team " where I can add multiple users which I can modify.
Suppose A is the user who creates an account then he can add and modify the "Account Team " members.
and in the 'AccountManager'field if I add the user as 'B'.when I login to the application as B and navigating to the perticular account that was created by A then B can see the Account Team Member(Read Only) but can not add or delete it.

I have a requirement inwhich if any user who creates an account and add the user in 'AccountManager' field then Account Manager should  modify the team members. 

I know with manually it is possible but i am looking for a programatical way like writing an apex class then call its method in trigger.
It would be better if I get any example


 
Hi,

I have a requirement inwhich There is a field of type Picklist "BU__C" which is present on both User and Task object.Now when a user create a contact record,when he creates a task,value of "BU__C" of User should be stamp to the "BU__C" in Task.
e.g.If Value "BU__c" of user is "ABC" then in task "BU__C" must be stamp with the value as "ABC".

I have to solve this by writing a apex class not a trigger.
Can somebody help me how to do it via apex sharing class?
It would be better if it explains with example
Hello,
My configure with Outlook.when i add an email from outlook to salesforce then the task is created on a perticular contact which is the existing functionlity of application.
there is workflow rule we are using here,
Workflow Rule: ABCUpdate ~ Salesforce - Unlimited Edition

AND( ISPICKVAL(Owner:User.BusinessUnit__c ,"ABC"), $User.BypassWorkflow__c = FALSE, ISPICKVAL( BusinessUnit__c,""))

then we are updating a field "BusinessUnit__c " with value as ABC

this value is updated as soon as task is created.

Now as currently WF rule doesn't trigger when task is craeted via outlook which is a bug in salesforce.
I need to create a trigger for this.
Can someone help me how to create a trigger when i add an email from outlook to salesforce,in the task,it should update the field "BusinessUnit__c " with value as ABC

It would be better if is explain with code example as I am new in apex coding.


 
Hi,
I have a requirement inwhich after changing the record type of an account,it change the owner of account to the new owner as well as send an email alerts to the user.For this I created  a WF rule inwhich I have created 2 WF actions:
1 for the Field updates i.e.change the account type the new user.
then I have created an email servicea and use a custom email template.
Now problem when i receive an email,in the opening of an email I receive new user's first name.But my expection is after changing the owner of the record in the email opening i should receive old user's first name.

e.g.if user Dhananjay create an account  of type "Temporary".account is created.now the another user "DJ" change the record type from "Temporary" to "Customer" then  when Dhananjay receives an email from DJ,in the mail opening it should be start with "Hello Dhannajay" not "Hello DJ".


Following are the email template that i used:

Hello {!User.FirstName} ,
This is to inform you that the account
{!Account.Name} has been verified by the CMDO team and created as a {!Account.RecordType}.
Thank you.
Test


instaed of {!User.FirstName} i used {!Account.CreatedBy},this solved my issue but i want previous users first name only not the complete name.In Created by it gives First name as well as last name which is default.

is there any way i can receive old user's first name even after changing the owner of record?



 
Hello All,

I have a following query: 

SELECT name,ParentId FROM Attachment WHERE name like 'Spon%' AND ParentId IN (SELECT ID FROM Opportunity where SponsorLetterAgreedUpon__c=false) 

this query is working is expected but I have to add the "SponsorLetterAgreedUpon__c"(type checkbox) field at the start of select statement i.e.

SELECT name,ParentId,SponsorLetterAgreedUpon__c FROM Attachment WHERE name like 'Spon%' AND ParentId IN (SELECT ID FROM Opportunity where SponsorLetterAgreedUpon__c=false) 

like this.In order to check the value but if I use "Opportunity.SponsorLetterAgreedUpon__c"  then it throws an error that I mentioned in the heading.
The reason that I am adding this field is because I have to run a cleanup job using data loader and I must add this field in the select statement in order to know the value in column.
 Can I someone tell me what I've missed?
 
 I am not actually getting the Relationship between Opportunity and Attachment.
 Ideally below query should've worked:
 
 SELECT name,ParentId,Attachment.Opportunity__r.SponsorLetterAgreedUpon__c FROM Attachment WHERE name like 'Spon%' AND ParentId IN (SELECT ID FROM Opportunity where SponsorLetterAgreedUpon__c=false) 
 
 
 Let me know with you reply

Hello all.  We have a trigger on the Task object that looks at the WhatId and/or WhoId to update certain fields on the related Account.  A user reported an issue to us when adding emails to Account and Contact records.  Upon taking a look at the debug logs, the WhatId and WhoId are both NULL in Before and After triggers.  However, after the Task record is saved, the WhatId and WhoId are properly set.  The logic of the trigger does not execute properly since the values are NULL when the trigger is executing.  Even if I perform a query in the After trigger for the WhatId and WhoId, they are still NULL.

 

How does Salesforce for Outlook work regarding the WhatId and WhoId?

 

System.debug commands:

	for (Task record : Trigger.new) {
		System.debug(record.WhoId);
		System.debug(record.WhatId);
		System.debug(record.Status);
		System.debug([SELECT Id, WhoId FROM Task WHERE Id = :record.Id].WhoId);

 Result in debug log:

15:26:09.682 (682782000)|USER_DEBUG|[13]|DEBUG|null
15:26:09.682 (682788000)|SYSTEM_METHOD_EXIT|[13]|System.debug(ANY)
15:26:09.682 (682839000)|SYSTEM_METHOD_ENTRY|[14]|System.debug(ANY)
15:26:09.682 (682850000)|USER_DEBUG|[14]|DEBUG|null
15:26:09.682 (682856000)|SYSTEM_METHOD_EXIT|[14]|System.debug(ANY)
15:26:09.682 (682940000)|SYSTEM_METHOD_ENTRY|[15]|System.debug(ANY)
15:26:09.682 (682953000)|USER_DEBUG|[15]|DEBUG|Completed
15:26:09.682 (682959000)|SYSTEM_METHOD_EXIT|[15]|System.debug(ANY)
15:26:09.683 (683169000)|SOQL_EXECUTE_BEGIN|[16]|Aggregations:0|select Id, WhoId from Task where Id = :tmpVar1
15:26:09.700 (700279000)|SOQL_EXECUTE_END|[16]|Rows:1
15:26:09.700 (700390000)|SYSTEM_METHOD_ENTRY|[16]|System.debug(ANY)
15:26:09.700 (700398000)|USER_DEBUG|[16]|DEBUG|null