• Daniel B Probert
  • NEWBIE
  • 395 Points
  • Member since 2013
  • Head of IT Innovation
  • Camfed Internation


  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 159
    Replies
Hi,

  I want to schedule belows class to run every 1hour I tried using the scheduler to run every day at a specific time but this is not working please suggest me how to make this work. 
 
list<String> toAddresses = new List<String>();
 list<Messaging.SingleEmailMessage> mailsToSend = new List<Messaging.SingleEmailMessage>();
 list<opportunity> opp = new list<opportunity>();
 String htmlBody; 

 opp = [select id,name,account.name,owner.name,owner.email, 
               Stage_Prior_Value__c,StageName,Close_Date_Prior_Value__c,
               closedate,f_ACV__c 
         from Opportunity 
         where Stage_Prior_Value__c = '2 - Contracts' or Stage_Prior_Value__c = '3rd Notice - Contracts' ];

for(Opportunity Op: Opp){
 htmlbody = '<html><body>';             
 htmlbody += '<p><strong> Owner Name : ' + op.owner.name + '</strong><br/></p>';
 htmlbody += '<p><strong> Account Name : ' + op.Account.name + '</strong><br/></p>';    
 htmlbody += '<p><strong> ACV Amount : ' + op.f_ACV__c + '</strong><br/></p>';    
 htmlbody += '<p><strong> Prior Forecast Category : ' + op.Stage_Prior_Value__c + '</strong><br/></p>';    
 htmlbody += '<p><strong> New Forecast Category : ' + op.stagename + '</strong><br/></p>';       
 htmlbody += '</body> </html>';   
          
      toAddresses.add('sudhir.narayanaswamy@gmail.com')    
      Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
      mail.setToAddresses(toAddresses);      
      mail.setSenderDisplayName('Deals moving out of Commit forecast ');
      mail.setSubject('Deals moving out of Commit forecast ');
      mail.setUseSignature(false);            
      mail.setHtmlBody(htmlBody);
      mailsToSend.add(mail);
      Messaging.sendEmail(mailsToSend);    
    
}

Thanks
Sudhir
My requirements are to
  • Incorporate a VF Page into the Case Object where Users could upload a single image
  • Have that single image stored as an Attachment for that Case
  • Renaming that Attachment 'CasePhoto1.jpg'
  • Extract that Attachment's ID and insert it into a custom field named CasePhoto1ID__c
So far, I've figured out everything but the extraction of the Attachment's ID. Here's what I have so far. Can anybody help me add the last piece of the puzzle (extracting the Attachment's ID and inserting it into CasePhoto1ID__c.

Here's the Controller:
public with sharing class CasePhotoUploadController1 {

    Private Static FINAL String fixedFileName = 'CasePhoto1.jpg';

    public boolean displaying { get; set; }
    public Case pageCase;
    public Blob casePicFile { get; set; }
    public Id currentPicture { get; set; }
    
    /** Constructor, grab record, and check/load an existing photo */
    public CasePhotoUploadController1(ApexPages.StandardController controller) {
        pageCase = (Case)controller.getRecord();
        
        List<attachment> currentPictures = [SELECT Id FROM Attachment WHERE parentId = :pageCase.Id AND name = :fixedFileName LIMIT 1];
        if(currentPictures.size() != 0) {
            currentPicture = currentPictures.get(0).Id;
        }
        
        displaying = true;
    }

    /** toggle switches between the photo display and photo upload form */
    public void toggle() {
        displaying = !displaying;
    }
    
    /** saveFile clears any existing (secondary) Case picture, retrieves the data from the form, and saves it under the relevant filename*/
    Public Pagereference saveFile() {

        // first, we cannot have any conflicting files
        List<attachment> savedPicture = [SELECT Id, name, body FROM Attachment WHERE parentId = :pageCase.Id AND name = :fixedFileName];
        if(savedPicture.size() > 0) {
            delete savedPicture;
        }
       
        // Now, the new blob is saved
        Attachment a = new Attachment(parentId = pageCase.Id, name = fixedFileName, body = casePicFile);
        insert a;
        
        currentPicture = a.Id;
        
        displaying = true;
        return null;
    }
  }

VF Page
<apex:page standardController="Case" extensions="CasePhotoUploadController1" showHeader="false" standardStyleSheets="true" sidebar="false">

<apex:form id="contentForm">
<div style="height:170px;">
    <apex:pageBlock mode="edit">
    
        <apex:pageblocksection columns="1" rendered="{!displaying}">
            <apex:image height="150" value="{!URLFOR($Action.Attachment.Download, currentPicture)}" rendered="{!currentPicture != null}"/>
            <apex:outputPanel rendered="{!currentPicture == null}"><em>No picture currently available</em></apex:outputPanel>
        </apex:pageblocksection>
        
        <apex:pageblocksection columns="1" rendered="{! !displaying}">
            <p>Use the button to below to select a new file and then press "Save"</p>
            <apex:inputFile value="{!profilePicFile}" />
            <p>Or press Cancel to return.</p>
        </apex:pageBlockSection>
        
    </apex:pageBlock>
</div>
    <apex:commandButton value="Upload new photo" action="{!toggle}" rerender="contentForm" rendered="{!displaying && currentPicture!=null}"/>
    <apex:commandButton value="Upload photo" action="{!toggle}" rerender="contentForm" rendered="{!displaying && currentPicture==null}"/>
    <apex:commandButton value="Cancel" action="{!toggle}" rendered="{! !displaying}"/>
    <apex:commandButton value="Save" action="{!saveFile}" rendered="{! !displaying}"/>
</apex:form>
  
</apex:page>

Any help would be much appreciated!

Thanks,
Ben

 
Hi all can anyone point me in the right direction for URL passing of cross filters within reports?

i've followed this guide and can't get it to work - i can get salesforce to recognise the cross filter but my filters within don't work

http://www.verticalcoder.com/2014/06/03/url-hacking-cross-filter-reports/

so basically my problem is that this works for my custom object

ptable0=072C0000002ezuA&ocond0=w&rtable0=01IC0000000qeCG&rtablecol0=00NC0000006DEAg

but adding in my filter within this doesn't work

&sfpc0_0=00NC0000006DEDY&sfpn0_0=eq&sfpv0_0=Term+1

has anyone managed to get url hacking for cross filters working and if so how - or whats another way around it?

thanks
dan

 
i've confused myself

i have an object with 2 fields

Form Name (external reference and unique name that is stored within the form_id field within a different custom object)
ObjectName__c (formula field that based on name enter the correct custom object mycustomobject__c)
Salesforce_Record_Count__c (i want to put the number of records that match my search critera in here)

i then want to create a batch process that will do something like this:

global class UpdateMonitoringForms implements Database.Batchable<sObject>{

    string query;
    global Database.querylocator start(Database.BatchableContext BC){
      Query = 'Select ID,Form_Name__c,Salesforce_Record_Count__c From Monitoring_Form__c';
      return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext BC, List<Monitoring_Form__c> scope){
      List<Monitoring_Form__c> lstmforms = new List<Monitoring_Form__c>();  
       for (Monitoring_Form__c mf:scope) {
        string object = mf.ObjectName__c;
        IF(mf.ObjectName__c!= 'DO NOT PROCESS'){
          mf.Salesforce_Record_Count__c = [select count() from object where Form_ID__c =:mf.Form_Name__c];
        }
        lstmforms.add(mf)
        }
        update lstmforms;       
    }

    global void finish(Database.BatchableContext BC){

    }
}

so basically my challenge is how can I build my select count to use potentially a different customobject__c each time it runs.

I plan to limit this batch to only updating 20 records at time.

any thoughts or betters ways of doing this, please do as for clarification.

dan


I am creating a trigger which creates a Target_Sale__c which links to a Target__c. Each User has a Target per month and the Sales represents the Won Opportunity which rolls up to the target. The problem is that I need to take OpportunitySplits into account and create  Target Sale for each Opportunity Split.

I wrote the below trigger and am not getting any errors in the Developer Console but it is not saving in the browser - Here is my trigger:

trigger LinkOpportunitytoUserTarget on Opportunity (before insert, after update, after delete) {
   
    SET<String> oppyear = new SET<String>();
    SET<String> oppmonth = new SET<String>();
   
    SET<ID> oids = new SET<ID>();
    SET<ID> osids = new SET<ID>();
    SET<ID> userids = new SET<ID>();
   
    LIST<Target_Sale__c> targetsalelistdelete = new LIST<Target_Sale__c>();
    LIST<Target_Sale__c> targetsalelistinsert = new LIST<Target_Sale__c>();
    MAP<String,Target__c> targetmap = new MAP<String,Target__c>();
       
    String omaplookup;
    String osmaplookup;
   
    if(Trigger.IsInsert || Trigger.IsUpdate){
        for(Opportunity o : Trigger.new){
            if(o.Probability==100){
                oppyear.add(string.Valueof(o.CloseDate.Year()));
                oids.add(o.Id);
                oppmonth.add(string.ValueOf(o.CloseDate.Month()));
            }
        }
       
        system.debug('oppyear: '+oppyear);
        system.debug('oids: '+oids);
        system.debug('oppmonth: '+oppmonth);
    
     //Query Opportunity Splits linked to Opportunity and assign user ids to set
    for(OpportunitySplit getos : [SELECT Id, OpportunityId, SplitAmount, SplitOwnerId
                                FROM OpportunitySplit
                                WHERE OpportunityId IN :oids]){
                                    if(Opportunity.Probability=100){
                                        osids.add(getos.Id);
                                        userids.add(getos.SplitOwnerId);
                                  }
                                }
       
      system.debug('userids: '+userids);
      system.debug('osids: '+osids);
     
    //Query Target Sales already linked to Opportunity for delete
    for(Target_Sale__c getts : [SELECT Id, Name, Amount__c, Opportunity_Reference__c, Opportunity_Split_Reference__c, Opportunity_Name__c FROM Target_Sale__c WHERE Opportunity_Split_Reference__c IN :osids]){
        targetsalelistdelete.add(getts);   
    }
       
        system.debug('targetsalelistdelete: '+targetsalelistdelete);
   
        if(!targetsalelistdelete.isEmpty()){
            delete targetsalelistdelete;
        }
     
    //Query Target records for users for Month and Date of Opportunity
    for(Target__c gett : [SELECT Id, Name, Target_Amount__c, Actual_Sales__c, OwnerId, Sales_Rep__r.Id, Year__c, Month__c
                        FROM Target__c
                        WHERE Sales_Rep__r.Id IN :userids
                        AND Year__c IN :oppyear
                        AND Month__c IN :oppmonth]){
                        //add Targets to Target Map
                        targetmap.put(gett.Sales_Rep__r.Id + '_' + gett.Year__c + '_' + gett.Month__c,gett);                     
                        }
       
    system.debug('targetmap: '+targetmap);

    for(OpportunitySplit oppsplits : [SELECT Id, OpportunityId, SplitAmount, SplitOwnerId
                                FROM OpportunitySplit
                                WHERE Id IN :osids]){
            osmaplookup = oppsplits.SplitOwnerId + '_' + string.Valueof(oppsplits.Opportunity.CloseDate.Year()) + '_' + string.Valueof(oppsplits.Opportunity.CloseDate.Month()); 
            system.debug('osmaplookup: '+osmaplookup);
                            if(targetmap.get(osmaplookup) != null){
                                            targetsalelistinsert.add(new Target_Sale__c(Target__c = targetmap.get(osmaplookup).Id,
                                                                    Opportunity_Reference__c = oppsplits.OpportunityId,
                                                                    Opportunity_Split_Reference__c = oppsplits.Id,
                                                                    Amount__c = oppsplits.SplitAmount,
                                                                    Opportunity_Name__c = oppsplits.OpportunityId.Name)); 
                                            }
        }
            
        system.debug('targetsalelistinsert: '+targetsalelistinsert);
        if(!targetsalelistinsert.isEmpty()){
            insert targetsalelistinsert;
        }
    }
   
    if(Trigger.IsDelete){
        for(Opportunity o : Trigger.old){
            if(o.Probability=100){
                oids.add(o.Id);
            }
        }
       
        system.debug('oids: '+oids);
       
        for(Target_Sale__c getts : [SELECT Id, Name, Amount__c, Opportunity_Reference__c, Opportunity_Split_Reference__c, Opportunity_Name__c FROM Target_Sale__c WHERE Opportunity_Reference__c IN :oids]){
            targetsalelistdelete.add(getts);   
        }
       
        system.debug('targetsalelistdelete: '+targetsalelistdelete);
        if(!targetsalelistdelete.isEmpty()){
            delete targetsalelistdelete;
        }
    }
}

Any help would be greatly appreciated as I just can't figure out what the error is refering to!
Hi All,

I've recenrtly started working with some batch apex and have generally found it pretty simple to deal with but have now hit a problem that I can't get round.

Setup:

One object Entitlement__c which I need to provide a button to force update records that match a criteria.
I've create a second object Entitlement_Updates__c which allows them to set the criteria Year__c, Term__c

I then have a custom VF page that based on their criteria tells them how many records match and if the number is greater than 0 they get a button to press that is supposed to invoke a batch apex - all of this I've managed to get working relatively easily.

my problem is that I am unable to pass my soql query from my apex class to my batch apex.

Apex Class: 

public with sharing class FPS_ManualIntervention {
    public FPS_Update__c FPS { get; set; }
     // Class Constructor
    public FPS_ManualIntervention(ApexPages.StandardController controller){
        FPS =  (FPS_Update__c)controller.getRecord();  
      }
    // button page for firing of apex batch class
    public PageReference updaterecords() {
        string fpyear = fps.year__c;
        string fpterm = fps.term__c;
        string fpcountry = fps.country__c;
        string fpstudenttype = fps.student_type__c;
        Database.executeBatch(new BatchEntitlementUpdate('SELECT ID, Year__c, Term__c, StudentType__c, Student__r.Country__c ' +
                ' FROM Entitlement__c ' +
                ' WHERE Year__c =:\'' + fpyear + '\'' +
                ' AND Term__c =:\'' + fpterm + '\'' +
                ' AND StudentType__c=:\'' + fpstudenttype + '\''+
                ' AND Country__c=:\'' + fpcountry + '\''), 10);
        PageReference redirect  = new PageReference('/apex/FPSManageRunning?id=' + fps.id);
        redirect.setRedirect(true);
        return redirect;
        return null;
    }
 }

the button on this page is then firing this batch apex:

global class BatchEntitlementUpdate implements Database.Batchable<sObject>{

   global final String Query;

   global BatchEntitlementUpdate(String q){
             Query=q;
   }
   global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator(query);
   }
    global void execute (Database.Batchablecontext BC, list<Entitlement__c> scope){
        List<Entitlement__c> lsttoupdate = new List<Entitlement__c>();
        for(Entitlement__c ent:scope){
            ent.BatchProcess__c = 10;
            lsttoupdate.add(ent);
        }
        update lsttoupdate;
    }
    global void finish(Database.Batchablecontext BC){
    }
}

i've been reading so many docs that i've kind of lost the plot on how this should or could look now so any guidance appreicated.

the code as it is brings back: First error: Only variable references are allowed in dynamic SOQL/SOSL.


Hi All,

I have a subquery statement and I'm trying to make sure that parent records don't display if they have no child records available.

Query:

List<Training_Module__c> trainingmod;
    public List<Training_Module__c> gettrainingmod() {
        if(trainingmod == null) {
            trainingmod = [SELECT id, Name, Introduction__c,
                (SELECT id, Name, Introduction__c
                    FROM Training_Lessons__r
                    WHERE (Applicable_Country__c includes (:empcountry) and Applicable_Teams__c includes (:empteam) and Status__c=:'Online'))
                FROM Training_Module__c
                WHERE Training_Course__c =:currentpage and Applicable_Country__c includes (:empcountry) and Applicable_Teams__c includes (:empteam) and Status__c=:'Online'];
            }
            return trainingmod;
        }

Now I am displaying this on a page in a repeat 

<apex:repeat var="tm" value="{!trainingmod}" rendered="{!trainingmod.size>0}">
        <table border="0" width="100%">
            <tr>
                <th>Module</th>
                <th>Introduction</th>
            </tr>
            <tr>
                <td width="15%"><apex:outputfield value="{!tm.Name}" /></td>            
                <td colspan="3">{!tm.Introduction__c}</td>           
            </tr>
            <tr>
                <th></th>
                <th>Lesson</th>
                <th>Introduction</th>
            </tr>
            <apex:repeat var="tmsg" value="{!tm.Training_Lessons__r}">
                <tr>
                    <td>&nbsp;</td>
                    <td width="15%"><apex:outputfield value="{!tmsg.Name}" /></td>
                    <td width="55%">{!tmsg.Introduction__c}</td>
                    <td><a href="/apex/TrainingLesson?id={!tmsg.id}"><button type="button">Take Lesson</button></a></td>
                </tr>
            </apex:repeat>

my query is where i have: rendered="{!trainingmod.size>0}" in my apex:repeat

how can i make it only display if training_lesson__r.size>0 i tried rendered="{trainingmod.training_lesson__r.size>0 but get an error

Error: Unknown property 'VisualforceArrayList.training_lesson__r'

any ideas do i have to do this in the apex?

any guidance appreciated.

dan
Hello,

We would like to have documents attached to a custom object record (Notes & Attachments) be sent with the approval request email once that record has entered the approval process.  Is there anyway to do this?

It would be nice if when setting up the approval process, admin could just click a button similar to 'include record documents with approval email request'; but seems that is not available?

Alternately, set up a second email alert with documents attached that follows the approval process and is triggered each time an approval step is marked as approved.  That then triggers email with documents attached to next approver in process.

Have spoken with Conga and created a button, but having difficulty figuring out how to include 'next approver' in query to populate email address in secondary email.

Help greatly appreciated.
Hello everyone,

I am getting the error below when trying to make changes to my test class in Sandbox. 
Has anyone seen this before. Do you know how to fix it.

Thanks
Deployment Error
Here is the error message: error: {faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to namespace "http://www.w3.org/2000/xmlns/" was already specified for element "query".',}
Hello,

I created 2 Classes (below) for testing purposes.  The first class creates an Account record, with 3 dummy user records that get populated into 3 custom user lookup fields on the Account.  The second class is a test class that is meant to cover a trigger that fires when the values for the users are changed on the Account.  Everything saves OK, but when I run the test, I get an error stating:

System.QueryException: List has no rows for assignment to SObject
Class.TestStatusAcctCreate.createAcct: line 6, column 1
Class.TestAccountPlan.testMyController1: line 9, column 1

Does anyone know why I would be getting this error?  Thanks.

public class TestStatusAcctCreate {

        // create and insert a new Accountrecord that has an arbitrary value for Type.
    public static Account createAcct(Integer i){ 

        Profile ProDir = [SELECT Id
                          FROM Profile
                          WHERE Name='Client Delivery (Director)'];
               
            User Dir1 = new User(Alias = 'DirUser',Country='United States',Email='DirUser@testing.com',EmailEncodingKey='UTF-8', LastName='Testing1', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProDir.Id,TimeZoneSidKey='America/New_York', UserName='DirUser@testing.com');
        insert Dir1;

        Profile ProTeamMgr = [SELECT Id
                              FROM Profile
                              WHERE Name='Client Delivery Team Manager'];
               
            User TM1 = new User(Alias = 'TMUser',Country='United States',Email='TMUser@testing.com',EmailEncodingKey='UTF-8', LastName='Testing2', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProTeamMgr.Id,TimeZoneSidKey='America/New_York', UserName='TMUser@testing.com');
        insert TM1;

        Profile ProCSM = [SELECT Id
                          FROM Profile
                          WHERE Name='Client Success Manager'];
               
            User CSM1 = new User(Alias = 'CSMUser',Country='United States',Email='CSMUser@testing.com',EmailEncodingKey='UTF-8', LastName='Testing3', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProCSM.Id,TimeZoneSidKey='America/New_York', UserName='CSMUser@testing.com');
        insert CSM1;


    Account acct = new Account();
            acct.Name = 'Test' + i;
            acct.Type= 'Employer';
            acct.Client_Advisor__c = CSM1.Id;
            acct.Industry_Manager__c = TM1.Id;
            acct.Market_Director__c = Dir1.Id;
            
        return acct;
        
    }
}




@Istest(SeeAllData=true)
public class TestAccountPlan {

public static testMethod void testMyController1() {    
       
    Account acct1 = TestGeneralAcctCreate.createAcct(0);
    insert acct1;

    Account acct2 = TestStatusAcctCreate.createAcct(0);
    insert acct2;

        Profile ProDir2 = [SELECT Id
                          FROM Profile
                          WHERE Name='Client Delivery (Director)'];
               
            User Dir2 = new User(Alias = 'Dir2User',Country='United States',Email='Dir2User@testing.com',EmailEncodingKey='UTF-8', LastName='Testing1a', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProDir2.Id,TimeZoneSidKey='America/New_York', UserName='Dir2User@testing.com');
        insert Dir2;

        Profile ProTeamMgr2 = [SELECT Id
                              FROM Profile
                              WHERE Name='Client Delivery Team Manager'];
               
            User TM2 = new User(Alias = 'TM2User',Country='United States',Email='TM2User@testing.com',EmailEncodingKey='UTF-8', LastName='Testing2a', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProTeamMgr2.Id,TimeZoneSidKey='America/New_York', UserName='TM2User@testing.com');
        insert TM2;

        Profile ProCSM2 = [SELECT Id
                          FROM Profile
                          WHERE Name='Client Success Manager'];
               
            User CSM2 = new User(Alias = 'CSM2User',Country='United States',Email='CSM2User@testing.com',EmailEncodingKey='UTF-8', LastName='Testing3a', LanguageLocaleKey='en_US',LocaleSidKey='en_US',ProfileId = ProCSM2.Id,TimeZoneSidKey='America/New_York', UserName='CSM2User@testing.com');
        insert CSM2;

        Account acct2a = [SELECT id,Market_Director__c,Industry_Manager__c,Client_Advisor__c
                          FROM Account
                          WHERE id =: acct2.Id];
               acct2a.Market_Director__c = Dir2.Id;
               acct2a.Industry_Manager__c = TM2.Id;
               acct2a.Client_Advisor__c = CSM2.Id;
        
    Account acct3 = TestGeneralAcctCreate.createAcct(0);
    insert acct3;

    Account acct4 = TestGeneralAcctCreate.createAcct(0);
    insert acct4;

    Account acct5 = TestGeneralAcctCreate.createAcct(0);
    insert acct5;

//    Account acct6 = TestStatusAcctCreate.createAcct(0);
//    insert acct6;

    Opportunity opp1 = TestOppCreate3.createOpp(acct1.Id);
    insert opp1;

    Contract_Summary__c contsumm1 = TestContractCreate.createContSumm(opp1.Id);
    insert contsumm1;
  
        Contract_Summary__c contSumm2 = [SELECT id
                                         FROM Contract_Summary__c
                                         WHERE id =: contSumm1.id];
  
    Client_Status_Scorecard__c cssc1 = TestStatusSCCreate.createCSSC1(acct1.Id);
    insert cssc1;
    
        Client_Status_Scorecard__c cssc1a = [SELECT id
                                           FROM Client_Status_Scorecard__c
                                           WHERE id =: cssc1.id];
    
    Client_Status_Scorecard__c cssc2 = TestStatusSCCreate.createCSSC2(acct2.Id);
    insert cssc2;
    
    Client_Status_Scorecard__c cssc3 = TestStatusSCCreate.createCSSC3(acct3.Id);
    insert cssc3;
    
    Client_Status_Scorecard__c cssc4 = TestStatusSCCreate.createCSSC4(acct4.Id);
    insert cssc4;
    
    Client_Status_Scorecard__c cssc5 = TestStatusSCCreate.createCSSC5(acct5.Id);
    insert cssc5;
    
//    Client_Status_Scorecard__c cssc6 = TestStatusSCCreate.createCSSC6(acct6.Id);
//    insert cssc6;
    
    Account_Plan__c plan1 = TestAcctPlanCreate.createAP1(acct1.Id);

    ApexPages.StandardController AcctPlan = new ApexPages.standardController(acct1);
    AcctPlanController APControl1 = new AcctPlanController(AcctPlan);
  //  APControl1.ap.add(plan1);
    APControl1.ap2 = plan1;
    APControl1.testsf();
    APControl1.save();
    
    Test.startTest();
    update acct1;
    update acct2;
    update acct2a;
    update acct3;
    update acct4;
    update acct5;
//    update acct6;
    update opp1;
    update contsumm1;
    delete contsumm2;
    update cssc1;
//    update cssc2;
    update cssc3;
    update cssc4;
    update cssc5;
//    update cssc6;
    delete cssc1a;
    Test.stopTest();
  
}

}



I am looking to make a "Personal Productiviy App" - As a developer who is in an acting sales/admin role, I use salesforce often. Mainly, I am assigned tasks specific to my department.

I am looking to grab my tasks, and the attributes of those tasks somehow. Then once complete update the corresponding information.

I have had a good look around - I really don't know where to start or what would be the best approch. Does anyone have any ideas?
How to created an email alert if total amount of opened cases reaches lets say 100 per day?

Hi ,
I am trying to show some notification for unread private message in a VF page of Community Site.
In standard chatter page it used to notify the number of unread mails side by Messages link.

I did some search regarding this but didn't get clear idea how to achieve this.
Please suggest some ideas how I can know that a user has some unread private messages or how I can show similar functionality as of standard chatter page in VF page.


Thanks
Arabinda