Skip to main content
added 1 character in body
Source Link
sfdcfox
  • 501.8k
  • 21
  • 473
  • 828

// public class IncidentTask { public ApexPages.StandardController std;

 
public class IncidentTask
{
    public ApexPages.StandardController std;
 
    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c, Model__c, CMDB_Model__c, BMCServiceDesk__FKIncident__c, BMCServiceDesk__FKStatus__c, Tracking_Number__c, Asset_Tag__c, Serial_Number__c, Cost__c, Vendor_Name__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}

// public class IncidentTask { public ApexPages.StandardController std;

    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c, Model__c, CMDB_Model__c, BMCServiceDesk__FKIncident__c, BMCServiceDesk__FKStatus__c, Tracking_Number__c, Asset_Tag__c, Serial_Number__c, Cost__c, Vendor_Name__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}
 
public class IncidentTask
{
    public ApexPages.StandardController std;
 
    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c, Model__c, CMDB_Model__c, BMCServiceDesk__FKIncident__c, BMCServiceDesk__FKStatus__c, Tracking_Number__c, Asset_Tag__c, Serial_Number__c, Cost__c, Vendor_Name__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}
Added URL at initialization of the Visualforce page and after saving & added Debug logs
Source Link
Gabriel M
  • 116
  • 4
  • 15
    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c, Model__c, CMDB_Model__c, BMCServiceDesk__FKIncident__c, BMCServiceDesk__FKStatus__c, Tracking_Number__c, Asset_Tag__c, Serial_Number__c, Cost__c, Vendor_Name__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}

Debug Logs:

42.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,NONE;DB,NONE;NBA,NONE;SYSTEM,NONE;VALIDATION,NONE;VISUALFORCE,INFO;WAVE,NONE;WORKFLOW,NONE
13:45:52.0 (479332)|EXECUTION_STARTED
13:45:52.0 (483847)|CODE_UNIT_STARTED|[EXTERNAL]|06641000008T5Co|VF: /apex/Procurement_Record_Management
13:45:52.0 (1214905)|VF_DESERIALIZE_VIEWSTATE_BEGIN|06641000008T5Co
13:45:52.0 (18949081)|VF_DESERIALIZE_VIEWSTATE_END
13:45:52.383 (383505615)|CUMULATIVE_LIMIT_USAGE
13:45:52.383 (383505615)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.383 (383505615)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 7 out of 100
  Number of query rows: 86 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.383 (383505615)|CUMULATIVE_LIMIT_USAGE_END

13:45:52.0 (402654770)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Incident:a1T0x000000Su1M
13:45:52.0 (403213788)|CODE_UNIT_FINISHED|Validation:Incident:a1T0x000000Su1M
13:45:52.806 (806704219)|CUMULATIVE_LIMIT_USAGE
13:45:52.806 (806704219)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 311 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.806 (806704219)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 18 out of 100
  Number of query rows: 95 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.806 (806704219)|CUMULATIVE_LIMIT_USAGE_END

13:45:52.0 (808787766)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01I41000001Gv3t
13:45:52.0 (919230184)|CODE_UNIT_FINISHED|Workflow:01I41000001Gv3t
13:45:53.158 (1158033959)|CUMULATIVE_LIMIT_USAGE
13:45:53.158 (1158033959)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 7 out of 10000
  Maximum CPU time: 458 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.158 (1158033959)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 25 out of 100
  Number of query rows: 120 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.158 (1158033959)|CUMULATIVE_LIMIT_USAGE_END

13:45:53.163 (1163138096)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT1
13:45:53.163 (1163605145)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT1
13:45:53.163 (1163630288)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT2
13:45:53.163 (1163967650)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT2
13:45:53.163 (1163987669)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT3
13:45:53.163 (1164314460)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT3
13:45:53.163 (1164333991)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT4
13:45:53.163 (1164680182)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT4
13:45:53.163 (1164701741)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT5
13:45:53.163 (1165027883)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT5
13:45:53.163 (1165047344)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT6
13:45:53.163 (1165373172)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT6
13:45:53.412 (1412600170)|CUMULATIVE_LIMIT_USAGE
13:45:53.412 (1412600170)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 7 out of 10000
  Maximum CPU time: 579 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.412 (1412600170)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 33 out of 100
  Number of query rows: 140 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.412 (1412600170)|CUMULATIVE_LIMIT_USAGE_END

13:45:53.163 (1414686811)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01I41000001Gv43
13:45:53.163 (1478221369)|CODE_UNIT_FINISHED|Workflow:01I41000001Gv43
13:45:53.500 (1500337356)|CUMULATIVE_LIMIT_USAGE
13:45:53.500 (1500337356)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 7 out of 10000
  Maximum CPU time: 579 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.500 (1500337356)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 33 out of 100
  Number of query rows: 140 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.500 (1500337356)|CUMULATIVE_LIMIT_USAGE_END

13:45:53.163 (1500387202)|CODE_UNIT_FINISHED|VF: /apex/Procurement_Record_Management
13:45:53.163 (1501359275)|EXECUTION_FINISHED
    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}
    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c, Model__c, CMDB_Model__c, BMCServiceDesk__FKIncident__c, BMCServiceDesk__FKStatus__c, Tracking_Number__c, Asset_Tag__c, Serial_Number__c, Cost__c, Vendor_Name__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}

Debug Logs:

42.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,NONE;DB,NONE;NBA,NONE;SYSTEM,NONE;VALIDATION,NONE;VISUALFORCE,INFO;WAVE,NONE;WORKFLOW,NONE
13:45:52.0 (479332)|EXECUTION_STARTED
13:45:52.0 (483847)|CODE_UNIT_STARTED|[EXTERNAL]|06641000008T5Co|VF: /apex/Procurement_Record_Management
13:45:52.0 (1214905)|VF_DESERIALIZE_VIEWSTATE_BEGIN|06641000008T5Co
13:45:52.0 (18949081)|VF_DESERIALIZE_VIEWSTATE_END
13:45:52.383 (383505615)|CUMULATIVE_LIMIT_USAGE
13:45:52.383 (383505615)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.383 (383505615)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 7 out of 100
  Number of query rows: 86 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.383 (383505615)|CUMULATIVE_LIMIT_USAGE_END

13:45:52.0 (402654770)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Incident:a1T0x000000Su1M
13:45:52.0 (403213788)|CODE_UNIT_FINISHED|Validation:Incident:a1T0x000000Su1M
13:45:52.806 (806704219)|CUMULATIVE_LIMIT_USAGE
13:45:52.806 (806704219)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 311 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.806 (806704219)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 18 out of 100
  Number of query rows: 95 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:52.806 (806704219)|CUMULATIVE_LIMIT_USAGE_END

13:45:52.0 (808787766)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01I41000001Gv3t
13:45:52.0 (919230184)|CODE_UNIT_FINISHED|Workflow:01I41000001Gv3t
13:45:53.158 (1158033959)|CUMULATIVE_LIMIT_USAGE
13:45:53.158 (1158033959)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 7 out of 10000
  Maximum CPU time: 458 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.158 (1158033959)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 25 out of 100
  Number of query rows: 120 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.158 (1158033959)|CUMULATIVE_LIMIT_USAGE_END

13:45:53.163 (1163138096)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT1
13:45:53.163 (1163605145)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT1
13:45:53.163 (1163630288)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT2
13:45:53.163 (1163967650)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT2
13:45:53.163 (1163987669)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT3
13:45:53.163 (1164314460)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT3
13:45:53.163 (1164333991)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT4
13:45:53.163 (1164680182)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT4
13:45:53.163 (1164701741)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT5
13:45:53.163 (1165027883)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT5
13:45:53.163 (1165047344)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Task:a2F0x0000001gT6
13:45:53.163 (1165373172)|CODE_UNIT_FINISHED|Validation:Task:a2F0x0000001gT6
13:45:53.412 (1412600170)|CUMULATIVE_LIMIT_USAGE
13:45:53.412 (1412600170)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 7 out of 10000
  Maximum CPU time: 579 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.412 (1412600170)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 33 out of 100
  Number of query rows: 140 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.412 (1412600170)|CUMULATIVE_LIMIT_USAGE_END

13:45:53.163 (1414686811)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01I41000001Gv43
13:45:53.163 (1478221369)|CODE_UNIT_FINISHED|Workflow:01I41000001Gv43
13:45:53.500 (1500337356)|CUMULATIVE_LIMIT_USAGE
13:45:53.500 (1500337356)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 7 out of 10000
  Maximum CPU time: 579 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.500 (1500337356)|LIMIT_USAGE_FOR_NS|BMCServiceDesk|
  Number of SOQL queries: 33 out of 100
  Number of query rows: 140 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

13:45:53.500 (1500337356)|CUMULATIVE_LIMIT_USAGE_END

13:45:53.163 (1500387202)|CODE_UNIT_FINISHED|VF: /apex/Procurement_Record_Management
13:45:53.163 (1501359275)|EXECUTION_FINISHED
Added URL at initialization of the Visualforce page and after saving.
Source Link
Gabriel M
  • 116
  • 4
  • 15

When saving the visualforce page, it redirects to a blank page. Can anyone advise as to why it is not redirecting to the exact url for the current page cited in the PageRefrence at the bottom?

When navigating to the visualforce page at launch the URL is:

public class IncidentTask
{
    public ApexPageshttps://xxxxxxxx.StandardController std;cs95.visual.force.com/apex/Procurement_Record_Management?id=a1T0x000000Su1M&isdtp=vw&nonce=bfcc41bffd041921c58df21045dba1bca4b8cf5d8d7d84d1d9ecba5b16cb4b40&sfdcIFrameOrigin=https%3A%2F%2Fxxxxxxxx.cs95.my.salesforce.com
 

When I click save no error is displayed and the page just hangs blank/white:

https://xxxxx.cs95.visual.force.com/apex/Procurement_Record_Management?AJAXREQUEST=_viewRoot&com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4T0Mwd05TMHhNMVF5TURvek56b3hNQzR3TmpSYSw1YWJnOWxaTTcyRzR0QkRTSjdzanJZLFpHTXlZakpr&com.salesforce.visualforce.ViewStateVersion=201805100303370434&id=a1T0x000000Su1M&isdtp=vw&j_id0%3Aj_id1=j_id0%3Aj_id1&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157=SHIPPED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lkid=a29410000027ezs&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lkold=SHIPPED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id160=Dell&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id163=500&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id177=j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id177&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lkid=a2941000000CYiC&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lkold=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id160=Dell&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id163=500&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lkid=a2941000000CYiC&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lkold=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id160=Dell&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id163=500&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lkid=a2941000000CYht&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lkold=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id160=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id163=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lkid=a2941000000CYht&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lkold=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id160=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id163=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lkid=a2941000000CYht&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lkold=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id160=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id163=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id175=&nonce=bfcc41bffd041921c58df21045dba1bca4b8cf5d8d7d84d1d9ecba5b16cb4b40&sfdcIFrameOrigin=https%3A%2F%2Fntxxxxx.cs95.my.salesforce.com

// public class IncidentTask { public ApexPages.StandardController std;

    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}

When saving the visualforce page, it redirects to a blank page. Can anyone advise as to why it is not redirecting to the exact url for the current page cited in the PageRefrence at the bottom?

public class IncidentTask
{
    public ApexPages.StandardController std;
 
    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}

When saving the visualforce page, it redirects to a blank page. Can anyone advise as to why it is not redirecting to the exact url for the current page cited in the PageRefrence at the bottom?

When navigating to the visualforce page at launch the URL is:

https://xxxxxxxx.cs95.visual.force.com/apex/Procurement_Record_Management?id=a1T0x000000Su1M&isdtp=vw&nonce=bfcc41bffd041921c58df21045dba1bca4b8cf5d8d7d84d1d9ecba5b16cb4b40&sfdcIFrameOrigin=https%3A%2F%2Fxxxxxxxx.cs95.my.salesforce.com

When I click save no error is displayed and the page just hangs blank/white:

https://xxxxx.cs95.visual.force.com/apex/Procurement_Record_Management?AJAXREQUEST=_viewRoot&com.salesforce.visualforce.ViewStateCSRF=VmpFPSxNakF4T0Mwd05TMHhNMVF5TURvek56b3hNQzR3TmpSYSw1YWJnOWxaTTcyRzR0QkRTSjdzanJZLFpHTXlZakpr&com.salesforce.visualforce.ViewStateVersion=201805100303370434&id=a1T0x000000Su1M&isdtp=vw&j_id0%3Aj_id1=j_id0%3Aj_id1&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157=SHIPPED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lkid=a29410000027ezs&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lkold=SHIPPED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id160=Dell&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id163=500&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id177=j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A0%3Aj_id152%3Aj_id177&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lkid=a2941000000CYiC&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lkold=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id160=Dell&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id163=500&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A1%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lkid=a2941000000CYiC&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lkold=ORDERED&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id160=Dell&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id163=500&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A0%3Aj_id150%3Aj_id151%3A2%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lkid=a2941000000CYht&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lkold=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id160=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id163=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A3%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lkid=a2941000000CYht&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lkold=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id160=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id163=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A4%3Aj_id152%3Aj_id175=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lkid=a2941000000CYht&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lkold=OPENED&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lktp=a29&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lspf=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_lspfsub=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id157_mod=0&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id160=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id163=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id166=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id169=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id172=&j_id0%3Aj_id1%3Aj_id149%3A1%3Aj_id150%3Aj_id151%3A5%3Aj_id152%3Aj_id175=&nonce=bfcc41bffd041921c58df21045dba1bca4b8cf5d8d7d84d1d9ecba5b16cb4b40&sfdcIFrameOrigin=https%3A%2F%2Fntxxxxx.cs95.my.salesforce.com

// public class IncidentTask { public ApexPages.StandardController std;

    // lists the associated tasks to the Incident
    public List<BMCServiceDesk__Task__c> tasks {get; set;}
   
    public String[] records {get;set;}
    
    public IncidentTask(ApexPages.StandardController stdCtrl)
    {
     std=stdCtrl;
     tasks=[select id, Name, Subject__c =:std.getId() order by Name asc limit 400];

    // dynamically create set of unique Line Items from query
    Set<String> taskSet = new Set<String>();
        for (BMCServiceDesk__Task__c t : tasks)
        taskSet.add(t.Subject__c);

    // convert the set into a string array  
    records = new String[taskSet.size()];
    Integer i = 0;
        for (String record : taskSet) { 
        records[i] = record;
        i++;
        }
    }
  
    public PageReference save()
    {

     // first save the incident
        std.save();
       
     // then save the procurement tasks
        update tasks;

     // set current page as reference to be returned to after save commits
        PageReference result=ApexPages.currentPage();
         result.setRedirect(true);       
        
        return result;
    }
}
added 176 characters in body
Source Link
sfdcfox
  • 501.8k
  • 21
  • 473
  • 828
Loading
Source Link
Gabriel M
  • 116
  • 4
  • 15
Loading