• CageMMA
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 9
    Replies

I am getting the following error:

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger Last_CBM_F2F_Meeting_trg caused an unexpected exception, contact your administrator: Last_CBM_F2F_Meeting_trg: execution of AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Last_CBM_F2F_Meeting_trg: line 5, column 1".

 

On this line:

    Set<Id> relatedIds = new Set<Id>();
    for (Task indivTask : Trigger.new) {
        if (indivTask.WhatId != null) relatedIds.add(indivTask.WhatId);
        
    }

 Any help would be appreciated... Basically if a user deletes the task the Last date field should become null on account.

Thanks

Hi I have no idea why am i getting this error message:

SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, null: []

 

trigger GeneralCaseAlertNotification on Case (after insert, after update) {
if(RunTriggerOnceEmail.firstRun){

    //Boolean used to send email only if valid conditions and email exists
    Boolean toMail = false;
    List<string> lstEmail = new List<string>();
    Set<id> setCaseId= new Set<id>();
    Set<id> setAccountId = new Set<id>();
    Set<String> setEmail = new Set<String>();
    String salesforceUrl = URL.getSalesforceBaseUrl().toExternalForm() + '/';

    Map<Id, User> mapUnSubscribedUser = new Map<Id, User>([Select 
                                                            Email_Alert_Subscription__c , 
                                                            Id 
                                                            From 
                                                            User 
                                                            where 
                                                            Email_Alert_Subscription__c 
                                                            includes ('General CIQ Case Alert') 
                                                            And
                                                            isActive = true]);

    for(Case objcase: trigger.new){
    if(Trigger.IsInsert && objcase.Status == 'Escalated'){
        setCaseId.add(objcase.id);
        setAccountId.add(objcase.AccountId);
    }
    
    if(Trigger.IsUpdate && trigger.oldMap.get(objcase.Id).Status != objcase.Status && 
        (objcase.Status == 'Closed' || objcase.Status == 'Escalated'))
        { 
            setCaseId.add(objcase.id);
            setAccountId.add(objcase.AccountId);
        }
    }
    Map<Id, List<AccountTeamMember>> mapATM = new Map<Id, List<AccountTeamMember>>();
    for(Account a : [Select Id, 
                    (select user.email from AccountTeamMembers where 
                    TeamMemberRole 
                    IN('Account Manager',
                    'Lead Sales Executive',
                    'Regional Sales Executive',
                    'Team (Activity Alerts)')) 
                    from Account where Id In: setAccountId])

        mapATM.put(a.Id, a.AccountTeamMembers);

    List<Messaging.SingleEmailMessage> lstMail = new List<Messaging.SingleEmailMessage>();

    String strEmailBody = '';
    String strCaseDetail = '';

    for(Case objcased : [SELECT Id, CaseNumber, Type, Status, Origin, 
                        Subject, Priority, Description, Resolution__c, 
                        Action_Code__c, Resolution_Code__c, 
                        ID_Sharing_User_Names__c, Internal_Notes__c, 
                        ID_Sharing__c, Feature__c, Section__c,
                        Contact.Id, Contact.Name, 
                        Contact.Phone, Contact.Email,ThreadID__c, 
                        Account.Id, Account.Name, Ownerid,CreatedBy.Alias,
                        Owner.Name FROM Case 
                        Where Id IN: setCaseId
                        AND RecordType.Name = 'Client Services - CIQ'
                        AND CIQ_Escalate_To__c != 'Account Team']){
                        
                        
        lstEmail = new list<string>();
        setEmail = new Set<String>();
        strCaseDetail = '';

    //Collect Email Id from Account Team Member
    if(mapATM.ContainsKey(objcased.Accountid) && !mapATM.get(objcased.Accountid).isEmpty())
    for(AccountTeamMember objAtm : mapATM.get(objcased.Accountid))
    if(mapUnSubscribedUser.containsKey(objAtm.UserId))  
    
    setEmail.add(objAtm.user.email);

if(!setEmail.isEmpty()){
if(!toMail)
toMail = true;

//Get Unique Email ids
for(String s: setEmail)
lstEmail.add(s);

strEmailBody = 
'This is a general case alert. However, you can reply to this e-mail and the Case Owner will be alerted.'+'<br/>'+ 
'Please see below.'+'<br/>'+
'Case Owner:' +  objcased.Owner.Name + '<br/>'+
'Case Detail:'+'<br/>'+
'Type = ' + objcased.Type + '<br/>'+
'Status = ' + objcased.Status + '<br/>'+
'Origin = ' + objcased.Origin +  '<br/>'+
'Priority = ' + objcased.Priority +'<br/>'+
'Client Info:'+'<br/>'+
'Account Name = ' + 
'<a href=\'' + salesforceUrl + objcased.Accountid + '\'>'+
objcased.Account.Name +
'<a/>'+ '<br/>'+
'Contact Name = ' +
'<a href=\'' + salesforceUrl + objcased.Contactid + '\'>'+ 
objcased.Contact.Name + 
'<a/>'+ '<br/>'+
'E-mail = ' + objcased.Contact.Email +'<br/>'+
'Phone = '+ objcased.Contact.Phone +'<br/>'+
'General Product Information:'+'<br/>'+
'Section = ' +  objcased.Section__c +'<br/>'+
'Feature = ' + objcased.Feature__c +'<br/>'+
'Sharing? = ' + objcased.ID_Sharing__c +'<br/>'+
'Sharing with = ' + objcased.ID_Sharing_User_Names__c+'<br/>'+
'Description Information:'+'<br/>'+ 
'Subject =' +  objcased.Subject +'<br/>'+
'Description = ' +objcased.Description +'<br/>'+
'Resolution Details: Action=' + objcased.Action_Code__c+'<br/>'+
'Resolution =' + objcased.Resolution__c+'<br/>'+
'Internal Notes ='+ objcased.Internal_Notes__c +'<br/>'+
'Case number = ' + objcased.CaseNumber +'<br/>'+
'Thread Id : ' + objcased.ThreadID__c +'<br/>'+
'Click on the link to access the case: '+
'<a href=\'' + salesforceUrl + objcased.Id + '\'>'+
objcased.CaseNumber +
'<a/>'+ '<br/>'+
strCaseDetail;



              
OrgWideEmailAddress owa = [select id, DisplayName, Address from OrgWideEmailAddress 
                            where displayName='S&P Capital IQ Client Services' limit 1];

//New instance of a single email message
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

        mail.setToAddresses(lstEmail);
        mail.setOrgWideEmailAddressId(owa.id);
        mail.setSaveAsActivity(true);
        mail.setSubject('General Case Alert, Case Number:' + objcased.CaseNumber + ', ' + objcased.Account.Name+', '+ objcased.Contact.Name);
        mail.setHtmlBody(strEmailBody);
        lstMail.add(mail);
    try{
        //Send Email
        if(toMail){
            if(objcased.CreatedBy.Alias!='Merge' || objcased.CreatedBy.Alias<>'Merge' ){
           Messaging.sendEmail(lstMail);
        }
        }
    }
    catch(exception objEx){
        Trigger.new[0].addError('Some unexpected error occured. Please call your system admin if error persists : '+objEx.getMessage());
    }
    RunTriggerOnceEmail.firstRun=false;

}
}


}

RunTriggerOnceEmail.firstRun=false;
}

 Someone help...I do not get this in sandbox. only when i pushed it out to prod.

thanks

Hi:

   The error I am recieving is:

The following errors were encountered while processing an incoming email:

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : OriginalCaseOwnerUpdate: data changed by trigger for field Original Case Owner: id value of incorrect type: 00GQ0000001919RMAQ

 

trigger OriginalCaseOwnerUpdate on Case(before update) {

Set<Id> ownerIds = new Set<Id>();

for (Case a : Trigger.new)
  ownerIds.add(a.OwnerId);

Map<Id, User> owners = new Map<Id, User>([Select Id from User Where Id in :ownerIds]);



List<QueueSobject> qna = [SELECT Queue.Id, Queue.Name FROM QueueSobject 
                    Where sObjectType='Case' AND (NOT Queue.Name Like 'CIQ%')];

List<Case> cc=[Select id,Ownerid from case where id IN :ownerIds];

RecordType rt=[SELECT Id FROM RecordType where sobjectType='Case' and Name='Client Services - CIQ'];
Integer i=0;
for (Case a : Trigger.new){
for(i=0; i==cc.size();i++){
System.Debug('cc' + cc.size());
If(a.Recordtypeid==rt.Id){  
    if( a.Ownerid!= qna[i].id && a.Original_Case_Owner__c==null){
            if(a.Original_Case_Owner__c!= a.OwnerId){
                a.Original_Case_Owner__c =a.ownerid;
            }
    }  
}

 So basically the concept is we have a original case owner custom field there and it should update once with a user name not a queue. If the user changes it to a queue or another user and if the original case owner is filled in previously it should not update it...

What is wrong with the code.

thanks

Z

Hi all:

    I have the following scenario:

   If Applicable = true then

Period Months is required

and Either Amount or Percentage needs to be filled.

 

Here is my validation rule which is not working.

AND(
Is_There_a_Discount_Applicable__c = True 
&&
(ISPICKVAL(If_Yes_Period_months__c, "")),
AND(ISBLANK(If_Yes_Percentage__c) &&
 
ISBLANK(If_Yes_Amount__c)),

 $User.Alias <> "Merge")

 Now this works when I select Applicable = true and when the user clicks save it errors out. But then when you choose Period months and applicable = true then user hits save and it does not error out and saves the record, when it should error out and error out until percentage or amount is filled.

Thanks

Z

Hi:

   Please do the following to apply for the position for salesforce.com developer:

Go to https://mh.taleo.net/careersection/10020/jobsearch.ftl?lang=en
Where it states Job Number Place down :
20890 <== this is for salesforce.com Developer ... Click on Apply...

 

Thanks

Z

  • September 26, 2011
  • Like
  • 0

Hi:

   I have a multiselect picklist field and in apex, I need to prepopulate the first value that is in the Multi-select picklist...

But I do not know the tag that would do it...

Can anyone help

Example:

Field Name: Compliance

Values:

B

C

A

I would like the first value selected "B" to prepopulate a text field...

Thanks

Z

  • September 16, 2011
  • Like
  • 0

Hi all:

   I have the following, where I split the text area box with names but I do not know how to get the next value in that split... for example:

TextBox Area = X,Y,Z

3 Names
I use code to Split it based on comma (',')

but in a for loop do not know how to go to the next value...

 

            queryAttendeesLines(investor.id);           
            List<Investor_Feedback__c> sarq = new List<Investor_Feedback__c>(
            [Select Id,S_P_Attendees__c FROM Investor_Feedback__c
            where id=:investor.id] );   
            integer gone = -1;
            integer i = 0; 
            
            String filename;
            filename = sarq[0].S_P_Attendees__c; 
            List<string> my_list = new List<String>();
            for ( i=0; i< attendeeLineItems.size(); i++ ) {
            if(sarq[0].S_P_Attendees__c == null){
            sarq[0].S_P_Attendees__c = attendeeLineItems[i].Attendee_name__c; 
            }
            else {
                List<String> parts = filename.split(',');
                filename = parts[parts.size()-1];
                System.debug('-parts='+ parts + '-filename=' + filename + '-attendeeLineItems=' + attendeeLineItems[i].Attendee_name__c);
                System.debug('z1' + parts[i]);
                if(filename!=attendeeLineItems[i].Attendee_name__c){

                sarq[0].S_P_Attendees__c = sarq[0].S_P_Attendees__c = + ',' + attendeeLineItems[i].Attendee_name__c;                 
                }
            }
        }

 I tried Filename = parts.get(i) <== gave me error System.ListException: List index out of bounds: 1  ???

Hi:

  If I have a textbox area and have 3 names in it, each name followed by a comma... How can I count the number of names that are in this box?

For example:

a,b,c <==3 names

 

Anyone have any ideas?

Hi everyone:

   I have the following scenario:

Partner WSDL,  Sobject has 3 elements (type, fieldsToNull, Id) .
          
 
           <complexType name="sObject">
                <sequence>
                    <element name="type" type="xsd:string"/>
                    <element name="fieldsToNull" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="Id" type="tns:ID" nillable="true"/>
                    <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
                </sequence>
            </complexType> 

 

 
             When converting this WSDL to Java,  It will generate the following methods only.
               
               1.  getType, setType.
               2.   getFieldsToNull, setFieldsToNull
               3.   getId , setId
            ---------------------------------------------------------------------------------------------------------------------------------
            
            But, I need setField & getField methods. 
            
            Ex:
                         SObject contact = new com.sforce.soap.partner.sobject.SObject();
                         contact.setType("Contact");
                         contact.setField("LastName", "LName");
 
                In WSDL, the complexType name "SObject" should have the element name "field", 
                 then only java can generate getField & SetField methods
                 Ex:
                          <element name="field" type="xsd:string"/>



So anyone can solve my issue here please??

Thanks

Zishan

Hi:

Looking for Application Developer III - Sales & Marketing IT CRM, Place in the Job Number 20413 .... http://lnkd.in/uTGvda

 

Thanks

Zishan

Hi:

   Utilizing a workflow rule and Field Update Action...

How would I convert a Text field that has a date format such as 12/19/2010 and update it to a real date field.

The text field is updating into salesforce through web api...

I tried DATEVALUE(dtsText) I get the following error:

 

Invalid Date Computed an invalid date, such as February 29th on a non-leap year. Please contact your administrator; formula fields can cause such errors.

 

Thanks

Zishan

Hi:

   I have a junction object, named XYZJunction.

The first master relatinship is Account.

Secondary is Contact (Primary Contact).

 

I try to create a report to get the following:

  1. The account
  2. The Primary Contact
  3. All Contacts for that Account.

Now the issue is I can get the contacts for that account but the primary contact name is blank when in reality it is not blank inside the object.

 

I have created a custom report, where I start with Account ==> Contact ==> XYZ Junction (with or without related records from XYZ Junction)

 

Why wouldn't it show the Primary Contact name ???

Thanks

Happy Holidays.

 

Hi everyone:

   How do I call this or test this method out in my test class:

 

public String getCountry() {
        return countryName;
    }

 

 

Thanks

 

Hi:

   I am doing a trigger from CaseComment where I went to send out an email to admins when the case owner and case comment owner is the same... but my trigger is not working keeps bringing up null  values for the parent..where am i going wrong

 

trigger TRG_CaseCommentEmailToCaseAssignedTo on CaseComment (after insert,after update)
{
 System.Debug('zitistrue1');
 for(CaseComment c : trigger.new)
 {
  System.Debug('z2' + c.CreatedById);
  System.Debug('z3' +  c.Parent.Ownerid);
  System.Debug('z4' +  c.Parent.RecordTypeid);

 if((c.CreatedById == c.Parent.Ownerid && c.Parent.RecordTypeid=='0123000000092K5ZZA'))
   {
   
    CLS_MailerClass.sendMail(c.CommentBody);
    }
   }
}

 

 

Hi My SOQL QUERY IS not working what is wrong with it:

SELECT Who.Id, Who.Name, Who.MailingStreet, Who.Phone, Who.Email, Who.Title FROM Task LIMIT 20

 Who.MailingStreet ==> is giving me an error. Is there an easier way to get Contact info from Task Object.

Thanks

 

 

I am getting the following error:

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger Last_CBM_F2F_Meeting_trg caused an unexpected exception, contact your administrator: Last_CBM_F2F_Meeting_trg: execution of AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Last_CBM_F2F_Meeting_trg: line 5, column 1".

 

On this line:

    Set<Id> relatedIds = new Set<Id>();
    for (Task indivTask : Trigger.new) {
        if (indivTask.WhatId != null) relatedIds.add(indivTask.WhatId);
        
    }

 Any help would be appreciated... Basically if a user deletes the task the Last date field should become null on account.

Thanks

Hi I have no idea why am i getting this error message:

SendEmail failed. First exception on row 0; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, null: []

 

trigger GeneralCaseAlertNotification on Case (after insert, after update) {
if(RunTriggerOnceEmail.firstRun){

    //Boolean used to send email only if valid conditions and email exists
    Boolean toMail = false;
    List<string> lstEmail = new List<string>();
    Set<id> setCaseId= new Set<id>();
    Set<id> setAccountId = new Set<id>();
    Set<String> setEmail = new Set<String>();
    String salesforceUrl = URL.getSalesforceBaseUrl().toExternalForm() + '/';

    Map<Id, User> mapUnSubscribedUser = new Map<Id, User>([Select 
                                                            Email_Alert_Subscription__c , 
                                                            Id 
                                                            From 
                                                            User 
                                                            where 
                                                            Email_Alert_Subscription__c 
                                                            includes ('General CIQ Case Alert') 
                                                            And
                                                            isActive = true]);

    for(Case objcase: trigger.new){
    if(Trigger.IsInsert && objcase.Status == 'Escalated'){
        setCaseId.add(objcase.id);
        setAccountId.add(objcase.AccountId);
    }
    
    if(Trigger.IsUpdate && trigger.oldMap.get(objcase.Id).Status != objcase.Status && 
        (objcase.Status == 'Closed' || objcase.Status == 'Escalated'))
        { 
            setCaseId.add(objcase.id);
            setAccountId.add(objcase.AccountId);
        }
    }
    Map<Id, List<AccountTeamMember>> mapATM = new Map<Id, List<AccountTeamMember>>();
    for(Account a : [Select Id, 
                    (select user.email from AccountTeamMembers where 
                    TeamMemberRole 
                    IN('Account Manager',
                    'Lead Sales Executive',
                    'Regional Sales Executive',
                    'Team (Activity Alerts)')) 
                    from Account where Id In: setAccountId])

        mapATM.put(a.Id, a.AccountTeamMembers);

    List<Messaging.SingleEmailMessage> lstMail = new List<Messaging.SingleEmailMessage>();

    String strEmailBody = '';
    String strCaseDetail = '';

    for(Case objcased : [SELECT Id, CaseNumber, Type, Status, Origin, 
                        Subject, Priority, Description, Resolution__c, 
                        Action_Code__c, Resolution_Code__c, 
                        ID_Sharing_User_Names__c, Internal_Notes__c, 
                        ID_Sharing__c, Feature__c, Section__c,
                        Contact.Id, Contact.Name, 
                        Contact.Phone, Contact.Email,ThreadID__c, 
                        Account.Id, Account.Name, Ownerid,CreatedBy.Alias,
                        Owner.Name FROM Case 
                        Where Id IN: setCaseId
                        AND RecordType.Name = 'Client Services - CIQ'
                        AND CIQ_Escalate_To__c != 'Account Team']){
                        
                        
        lstEmail = new list<string>();
        setEmail = new Set<String>();
        strCaseDetail = '';

    //Collect Email Id from Account Team Member
    if(mapATM.ContainsKey(objcased.Accountid) && !mapATM.get(objcased.Accountid).isEmpty())
    for(AccountTeamMember objAtm : mapATM.get(objcased.Accountid))
    if(mapUnSubscribedUser.containsKey(objAtm.UserId))  
    
    setEmail.add(objAtm.user.email);

if(!setEmail.isEmpty()){
if(!toMail)
toMail = true;

//Get Unique Email ids
for(String s: setEmail)
lstEmail.add(s);

strEmailBody = 
'This is a general case alert. However, you can reply to this e-mail and the Case Owner will be alerted.'+'<br/>'+ 
'Please see below.'+'<br/>'+
'Case Owner:' +  objcased.Owner.Name + '<br/>'+
'Case Detail:'+'<br/>'+
'Type = ' + objcased.Type + '<br/>'+
'Status = ' + objcased.Status + '<br/>'+
'Origin = ' + objcased.Origin +  '<br/>'+
'Priority = ' + objcased.Priority +'<br/>'+
'Client Info:'+'<br/>'+
'Account Name = ' + 
'<a href=\'' + salesforceUrl + objcased.Accountid + '\'>'+
objcased.Account.Name +
'<a/>'+ '<br/>'+
'Contact Name = ' +
'<a href=\'' + salesforceUrl + objcased.Contactid + '\'>'+ 
objcased.Contact.Name + 
'<a/>'+ '<br/>'+
'E-mail = ' + objcased.Contact.Email +'<br/>'+
'Phone = '+ objcased.Contact.Phone +'<br/>'+
'General Product Information:'+'<br/>'+
'Section = ' +  objcased.Section__c +'<br/>'+
'Feature = ' + objcased.Feature__c +'<br/>'+
'Sharing? = ' + objcased.ID_Sharing__c +'<br/>'+
'Sharing with = ' + objcased.ID_Sharing_User_Names__c+'<br/>'+
'Description Information:'+'<br/>'+ 
'Subject =' +  objcased.Subject +'<br/>'+
'Description = ' +objcased.Description +'<br/>'+
'Resolution Details: Action=' + objcased.Action_Code__c+'<br/>'+
'Resolution =' + objcased.Resolution__c+'<br/>'+
'Internal Notes ='+ objcased.Internal_Notes__c +'<br/>'+
'Case number = ' + objcased.CaseNumber +'<br/>'+
'Thread Id : ' + objcased.ThreadID__c +'<br/>'+
'Click on the link to access the case: '+
'<a href=\'' + salesforceUrl + objcased.Id + '\'>'+
objcased.CaseNumber +
'<a/>'+ '<br/>'+
strCaseDetail;



              
OrgWideEmailAddress owa = [select id, DisplayName, Address from OrgWideEmailAddress 
                            where displayName='S&P Capital IQ Client Services' limit 1];

//New instance of a single email message
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

        mail.setToAddresses(lstEmail);
        mail.setOrgWideEmailAddressId(owa.id);
        mail.setSaveAsActivity(true);
        mail.setSubject('General Case Alert, Case Number:' + objcased.CaseNumber + ', ' + objcased.Account.Name+', '+ objcased.Contact.Name);
        mail.setHtmlBody(strEmailBody);
        lstMail.add(mail);
    try{
        //Send Email
        if(toMail){
            if(objcased.CreatedBy.Alias!='Merge' || objcased.CreatedBy.Alias<>'Merge' ){
           Messaging.sendEmail(lstMail);
        }
        }
    }
    catch(exception objEx){
        Trigger.new[0].addError('Some unexpected error occured. Please call your system admin if error persists : '+objEx.getMessage());
    }
    RunTriggerOnceEmail.firstRun=false;

}
}


}

RunTriggerOnceEmail.firstRun=false;
}

 Someone help...I do not get this in sandbox. only when i pushed it out to prod.

thanks

Hi all:

    I have the following scenario:

   If Applicable = true then

Period Months is required

and Either Amount or Percentage needs to be filled.

 

Here is my validation rule which is not working.

AND(
Is_There_a_Discount_Applicable__c = True 
&&
(ISPICKVAL(If_Yes_Period_months__c, "")),
AND(ISBLANK(If_Yes_Percentage__c) &&
 
ISBLANK(If_Yes_Amount__c)),

 $User.Alias <> "Merge")

 Now this works when I select Applicable = true and when the user clicks save it errors out. But then when you choose Period months and applicable = true then user hits save and it does not error out and saves the record, when it should error out and error out until percentage or amount is filled.

Thanks

Z

Hi all:

   I have the following, where I split the text area box with names but I do not know how to get the next value in that split... for example:

TextBox Area = X,Y,Z

3 Names
I use code to Split it based on comma (',')

but in a for loop do not know how to go to the next value...

 

            queryAttendeesLines(investor.id);           
            List<Investor_Feedback__c> sarq = new List<Investor_Feedback__c>(
            [Select Id,S_P_Attendees__c FROM Investor_Feedback__c
            where id=:investor.id] );   
            integer gone = -1;
            integer i = 0; 
            
            String filename;
            filename = sarq[0].S_P_Attendees__c; 
            List<string> my_list = new List<String>();
            for ( i=0; i< attendeeLineItems.size(); i++ ) {
            if(sarq[0].S_P_Attendees__c == null){
            sarq[0].S_P_Attendees__c = attendeeLineItems[i].Attendee_name__c; 
            }
            else {
                List<String> parts = filename.split(',');
                filename = parts[parts.size()-1];
                System.debug('-parts='+ parts + '-filename=' + filename + '-attendeeLineItems=' + attendeeLineItems[i].Attendee_name__c);
                System.debug('z1' + parts[i]);
                if(filename!=attendeeLineItems[i].Attendee_name__c){

                sarq[0].S_P_Attendees__c = sarq[0].S_P_Attendees__c = + ',' + attendeeLineItems[i].Attendee_name__c;                 
                }
            }
        }

 I tried Filename = parts.get(i) <== gave me error System.ListException: List index out of bounds: 1  ???