• Kamaldeep Sehrawat
  • NEWBIE
  • 20 Points
  • Member since 2014
  • Application Engineer
  • Golden Gate University

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
I am in process of developing a code to get the information from the Case Object and update it on our Website. I have developed all the code (Apex Classes and Apex Trigger) and the code is working well but its look like my code is not bulkified and its hitting the Governance Limit whenever I am mass updating the Case object. Can somebody please help me to bulkify the code. 


Apex Class

public class GGUWSCall
{
    private static gguEduIntegration.SFDCHandlerPort login(){
        gguEduIntegration.SFDCHandlerPort port = new gguEduIntegration.SFDCHandlerPort();
         
        port.inputHttpHeaders_x = new Map<String, String>();

        Blob headerValue = Blob.valueOf(GGUSettings.USERNAME + ':' + GGUSettings.PASSWORD );
         
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

        port.inputHttpHeaders_x.put('Authorization', authorizationHeader);

        port.inputHttpHeaders_x.put('Content-Type', 'text/xml; charset=utf-8');
       
        return port;
    }
    
    @Future(callout=true) 
    public static void syncCase(String caseId, String status, String resolution
        , String resolutionMethod, String closedDate, String commentsToSubmitter)
    {                 
        gguEduIntegration.SFDCHandlerPort port = login();
        port.updateCase(caseId, status, resolution, resolutionMethod, closedDate, commentsToSubmitter);
    }
}

Trigger

trigger CaseSyncTrigger on Case (after update) {
    for (Case caseNew : Trigger.new) {
        GGUWSCall.syncCase(caseNew.CaseID__c, caseNew.Status, caseNew.Resolution__c, caseNew.ResolutionMethod__c
        , caseNew.ClosedDate != null ? caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'') : ''
        , caseNew.Comments_to_Submitter__c);
        //System.debug(Logginglevel.INFO, 'caseId: '+caseNew.CaseID__c+' status: '+caseNew.Status + ' resolution: '+caseNew.Resolution__c+ ' resolutionMethod: '+ 
        //caseNew.ResolutionMethod__c + ' closeDate: '+(caseNew.ClosedDate!=null?caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\''):''));
    }
}

Thanks 

Kamaldeep
I am in process of developing a code to get the information from the Case Object and update it on our Website. I have developed all the code (Apex Classes and Apex Trigger) and the code is working well but its look like my code is not bulkified and its hitting the Governance Limit whenever I am mass updating the Case object. Can somebody please help me to bulkify the code. 


Apex Class

public class GGUWSCall
{
    private static gguEduIntegration.SFDCHandlerPort login(){
        gguEduIntegration.SFDCHandlerPort port = new gguEduIntegration.SFDCHandlerPort();
         
        port.inputHttpHeaders_x = new Map<String, String>();

        Blob headerValue = Blob.valueOf(GGUSettings.USERNAME + ':' + GGUSettings.PASSWORD );
         
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

        port.inputHttpHeaders_x.put('Authorization', authorizationHeader);

        port.inputHttpHeaders_x.put('Content-Type', 'text/xml; charset=utf-8');
       
        return port;
    }
    
    @Future(callout=true) 
    public static void syncCase(String caseId, String status, String resolution
        , String resolutionMethod, String closedDate, String commentsToSubmitter)
    {                 
        gguEduIntegration.SFDCHandlerPort port = login();
        port.updateCase(caseId, status, resolution, resolutionMethod, closedDate, commentsToSubmitter);
    }
}

Trigger

trigger CaseSyncTrigger on Case (after update) {
    for (Case caseNew : Trigger.new) {
        GGUWSCall.syncCase(caseNew.CaseID__c, caseNew.Status, caseNew.Resolution__c, caseNew.ResolutionMethod__c
        , caseNew.ClosedDate != null ? caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'') : ''
        , caseNew.Comments_to_Submitter__c);
        //System.debug(Logginglevel.INFO, 'caseId: '+caseNew.CaseID__c+' status: '+caseNew.Status + ' resolution: '+caseNew.Resolution__c+ ' resolutionMethod: '+ 
        //caseNew.ResolutionMethod__c + ' closeDate: '+(caseNew.ClosedDate!=null?caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\''):''));
    }
}

Thanks 

Kamaldeep
Hi, 
I have created a Trigger on the Child Object having 2 parent objects. Below is the Relationship
  • evt__Attendee__c - Child Object 
  • evt__Special_Event__c - Parent Object
  • Contacts - Parent Object 
Both the parents Object (Special Event and Contacts) has a realtionship with the child Object (Attendee)

So, I want to do is to create a trigger after the attendee Record is created. The tirgger will look for some fields on the Special Events and Contacts and if the criteria is met then update some fields on the Contact Object.

I have created the trigger but it looks like not working. It is not giving me any error also. 

Below is the code of the Trigger.  


 trigger AttendeeITK on evt__Attendee__c (after insert)
{

    List<Contact> contactsToUpdate = new List<Contact>();
    Set<Id> ContactIds = new Set<Id>();
    Set<Id> SEIds = new Set<Id>();

    for(evt__Attendee__c attendee :trigger.new)
    {
       ContactIds.add(attendee.evt__Contact__c);
       SEIds.add(attendee.evt__Event__c);
    }
     
    Map<Id, Contact> ContactMap = new Map<Id, Contact>([SELECT Id,Assignment_Queue__c,Law_Student__c,Stage__c,Contact_Type__c FROM Contact WHERE Id IN :ContactIds]);
    Map<Id, evt__Special_Event__c> SEMap = new Map<Id, evt__Special_Event__c>([SELECT Id,Non_Recruitment_Event__c FROM evt__Special_Event__c WHERE Id IN :SEIds]);
    
    for(evt__Attendee__c attendee : System.Trigger.New)
    {          

        Contact tempContact = ContactMap.get(attendee.evt__Contact__c);
        evt__Special_Event__c tempSE = SEMap.get(attendee.evt__Event__c);
             
        if (tempSE.Non_Recruitment_Event__c == False && 
            tempContact.Assignment_Queue__c == null && 
            tempContact.Law_Student__c == False && 
            tempContact.Stage__c == null &&
            tempContact.Ownerid == '005G0000002wYvi' &&
            (tempContact.Contact_Type__c != 'Faculty' || tempContact.Contact_Type__c == null))   
        {
           
            tempContact.Assignment_Queue__c = 'Inside Track Graduate';
            tempContact.Stage__c = 'New';
            tempContact.Lead_Status__c = 'Not Attempted';
            tempContact.Contact_Type__c = 'Prospect';
            tempContact.Most_Recent_Inquiry_Date__c = date.today();
            tempContact.Non_Law_Student__c = True;
            contactsToUpdate.add(tempContact);
        }               
    }
     
          update contactsToUpdate; 


I will really appreciate if somebody can help me in developing the right code. 

Thanks 
Hi All, 

I am in process of developing a code to get the information from the Case Object and update it on our Website. I have developed all the code (Apex Classes and Apex Trigger) and the code is working well but I am getting an Error while I am doing a mass update of more than 51 records on the Case Object due to the classes and triggers. Can any body Help me in bulkfying the code or even suggest me ways I can improve the code so that I doesn't get any errors while mass updating the records in Case Object. 

Below are the Apex Classes and Trigger that I have developed 

Apex Class 1

public class GGUSettings
{
    public static string USERNAME = 'abc';
    public static string PASSWORD = 'abc';
    public static string GGU_END_POINT = 'https://www.ggu.edu';
}

Apex Class 2 

//Generated by wsdl2apex

public class gguEduIntegration {
    public class Exception_x {
        public String message;
        private String[] message_type_info = new String[]{'message','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'message'};
    }
    public class result {
        public String[] error;
        public String status;
        private String[] error_type_info = new String[]{'error','http://ggu.edu/integration',null,'0','-1','true'};
        private String[] status_type_info = new String[]{'status','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'error','status'};
    }
    public class updateCase {
        public String caseId;
        public String status;
        public String resolution;
        public String resolutionMethod;
        public String closeDate;
        private String[] caseId_type_info = new String[]{'caseId','http://ggu.edu/integration',null,'0','1','false'};
        private String[] status_type_info = new String[]{'status','http://ggu.edu/integration',null,'0','1','false'};
        private String[] resolution_type_info = new String[]{'resolution','http://ggu.edu/integration',null,'0','1','false'};
        private String[] resolutionMethod_type_info = new String[]{'resolutionMethod','http://ggu.edu/integration',null,'0','1','false'};
        private String[] closeDate_type_info = new String[]{'closeDate','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'caseId','status','resolution','resolutionMethod','closeDate'};
    }
    public class updateCaseResponse {
        public gguEduIntegration.result return_x;
        private String[] return_x_type_info = new String[]{'return','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class SFDCHandlerPort {
        public String endpoint_x = 'https://www.ggu.edu/integration';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://ggu.edu/integration', 'gguEduIntegration'};
        public gguEduIntegration.result updateCase(String caseId,String status,String resolution,String resolutionMethod,String closeDate) {
            gguEduIntegration.updateCase request_x = new gguEduIntegration.updateCase();
            request_x.caseId = caseId;
            request_x.status = status;
            request_x.resolution = resolution;
            request_x.resolutionMethod = resolutionMethod;
            request_x.closeDate = closeDate;
            gguEduIntegration.updateCaseResponse response_x;
            Map<String, gguEduIntegration.updateCaseResponse> response_map_x = new Map<String, gguEduIntegration.updateCaseResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://ggu.edu/integration',
              'updateCase',
              'http://ggu.edu/integration',
              'updateCaseResponse',
              'gguEduIntegration.updateCaseResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
    }
}


Apex Class 3 

public class GGUWSCall
{
    private static gguEduIntegration.SFDCHandlerPort login(){
        gguEduIntegration.SFDCHandlerPort port = new gguEduIntegration.SFDCHandlerPort();
         
        port.inputHttpHeaders_x = new Map<String, String>();

        Blob headerValue = Blob.valueOf(GGUSettings.USERNAME + ':' + GGUSettings.PASSWORD );
         
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

        port.inputHttpHeaders_x.put('Authorization', authorizationHeader);

        port.inputHttpHeaders_x.put('Content-Type', 'text/xml; charset=utf-8');
       
        return port;
    }
    
    @Future(callout=true) 
    public static void syncCase(String caseId, String status, String resolution, String resolutionMethod, String closedDate)
    {                 
        gguEduIntegration.SFDCHandlerPort port = login();
        port.updateCase(caseId, status, resolution, resolutionMethod, closedDate);
    }
}

Apex Trigger 

Trigger 

trigger CaseSyncTrigger on Case (after update) {
    for (Case caseNew : Trigger.new) {
        GGUWSCall.syncCase(caseNew.CaseID__c, caseNew.Status, caseNew.Resolution__c, caseNew.ResolutionMethod__c, caseNew.ClosedDate != null ? caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'') : '');
//        System.debug(Logginglevel.INFO, 'caseId: '+caseNew.CaseID__c+' status: '+caseNew.Status + ' resolution: '+caseNew.Resolution__c+ ' resolutionMethod: '+ 
//        caseNew.ResolutionMethod__c + ' closeDate: '+(caseNew.ClosedDate!=null?caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\''):''));
    }
}

Thanks 





 
Hi All, 

I am getting the fololowing Error while creating the Class and the Trigger

Apex trigger IAAAccountupdate caused an unexpected exception,
contact your administrator: IAAAccountupdate: execution of AfterInsert caused by:
System.FinalException: Record is read-only: Class.IAAAccountUpdate.AccountUpdate: line 18, column 1



Below is the Code for my Apex Class 


public with sharing class IAAAccountUpdate
{
   
    private List<Contact> contactUpdateList;
   
    public IAAAccountUpdate()
    {
        contactUpdateList = new List<Contact>();
    }

    public void AccountUpdate(Contact[] triggersNew, Contact[] TriggersOld)
   {
        Account iaa = [Select Id FROM Account a WHERE Account_ID__c = 'gguiaa'];
        for (Contact contemp : triggersNew)
        {
                if  (contemp.Area_of_Interest_del__c != 'Law' && (contemp.Visa_Type__c == 'J1 Exchange Visitor'||contemp.Visa_Type__c =='F1 Nonimmigrant Student'||contemp.International_Student__c ==True))
                {
                    contemp.AccountId = iaa.id;
                   
                    contactUpdateList.add(contemp);
                }     
        }     
         update contactUpdateList;
    }
   
}



Apex Trigger

trigger IAAAccountupdate on Contact (After Insert,After Update)
{
IAAAccountUpdate iaa = new IAAAccountUpdate();
iaa.AccountUpdate(trigger.new, Trigger.old);
}


Can anybody please help me in resolve this error, I will really appreacite your help. 

Thanks in advance 

Kamaldeep


Hi All, 

I am very new to Apex and trying to bulkify and batchify a trigger to avoid the Governance Limits. Below is the my trigger


trigger IAA on Contact (before insert, before update)
{
for (Contact c : Trigger.new)
{
    if  (c.Area_of_Interest_del__c != 'Law' && (c.Visa_Type__c == 'J1 Exchange Visitor'||c.Visa_Type__c =='F1 Nonimmigrant Student'||c.International_Student__c ==True))
    {
        Account iaa = [Select Id FROM Account WHERE Account.Name = 'GGU - International Admissions & Advising'];
        c.AccountId = iaa.Id;
    }
}
}


I will really appreciate any help. 

Thanks 
Hi All, 

I am very new to Apex Coding and trying to create a Trigger to Update the Account Name on the Contact Object whenever the Contact meet the Specific criteria. Below is the Trigger code and test Class that I have written but I have problems in Deploying the Code in the Production Env. 

trigger IAA on Contact (before insert, before update)
{
for (Contact c : Trigger.new)
{
    if  (c.Area_of_Interest_del__c != 'Law' && (c.Visa_Type__c == 'J-1 Exchange Visitor'||c.Visa_Type__c =='F-1 Nonimmigrant Student'||c.International_Student__c ==True))
    {
        Account iaa = [Select Id FROM Account WHERE Account.Name = 'GGU - International Admissions & Advising'];
        c.AccountId = iaa.Id;
    }
}
}


Test Class Code 

@isTest
private class IAA {

    @isTest static void test_method_one() {
      
        Contact s = new Contact(Area_of_Interest_del__c = 'Accounting',Visa_Type__c = 'J-1 Exchange Visitor',FirstName = 'Test',LastName = 'IAA',Origin_Channel__c ='C-Banner',Origin_Source__c = 'Trader');
        insert s;
    System.assert(s.Id != null);     
         
        Campaign cam = [SELECT Id FROM Campaign WHERE Campaign.Name = 'Banner_Trader'];
        System.assert(cam.Id != null);
       
        CampaignMember cm = new CampaignMember(ContactId = s.Id, CampaignId = cam.Id, Status = 'Responded');
        insert cm;
        System.assert(cm.Id != null);
       
        Id AccountId = [SELECT Id, AccountId FROM Contact WHERE Contact.Id=:s.Id].AccountId;

        test.startTest();

        update s;

        Account a = [SELECT Id FROM Account WHERE Account.Name = 'GGU - International Admissions & Advising'];

        system.assertEquals(AccountId, a.Id);

        test.stopTest();
    }

}

Can anybody please help in finding out where is the problem in my test class or Trigger and also help me in bulkifying and batchifying it so that I can deploy it to Production.

Thanks 

Kamaldeep
I am in process of developing a code to get the information from the Case Object and update it on our Website. I have developed all the code (Apex Classes and Apex Trigger) and the code is working well but its look like my code is not bulkified and its hitting the Governance Limit whenever I am mass updating the Case object. Can somebody please help me to bulkify the code. 


Apex Class

public class GGUWSCall
{
    private static gguEduIntegration.SFDCHandlerPort login(){
        gguEduIntegration.SFDCHandlerPort port = new gguEduIntegration.SFDCHandlerPort();
         
        port.inputHttpHeaders_x = new Map<String, String>();

        Blob headerValue = Blob.valueOf(GGUSettings.USERNAME + ':' + GGUSettings.PASSWORD );
         
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

        port.inputHttpHeaders_x.put('Authorization', authorizationHeader);

        port.inputHttpHeaders_x.put('Content-Type', 'text/xml; charset=utf-8');
       
        return port;
    }
    
    @Future(callout=true) 
    public static void syncCase(String caseId, String status, String resolution
        , String resolutionMethod, String closedDate, String commentsToSubmitter)
    {                 
        gguEduIntegration.SFDCHandlerPort port = login();
        port.updateCase(caseId, status, resolution, resolutionMethod, closedDate, commentsToSubmitter);
    }
}

Trigger

trigger CaseSyncTrigger on Case (after update) {
    for (Case caseNew : Trigger.new) {
        GGUWSCall.syncCase(caseNew.CaseID__c, caseNew.Status, caseNew.Resolution__c, caseNew.ResolutionMethod__c
        , caseNew.ClosedDate != null ? caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'') : ''
        , caseNew.Comments_to_Submitter__c);
        //System.debug(Logginglevel.INFO, 'caseId: '+caseNew.CaseID__c+' status: '+caseNew.Status + ' resolution: '+caseNew.Resolution__c+ ' resolutionMethod: '+ 
        //caseNew.ResolutionMethod__c + ' closeDate: '+(caseNew.ClosedDate!=null?caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\''):''));
    }
}

Thanks 

Kamaldeep
Hi All, 

I am in process of developing a code to get the information from the Case Object and update it on our Website. I have developed all the code (Apex Classes and Apex Trigger) and the code is working well but I am getting an Error while I am doing a mass update of more than 51 records on the Case Object due to the classes and triggers. Can any body Help me in bulkfying the code or even suggest me ways I can improve the code so that I doesn't get any errors while mass updating the records in Case Object. 

Below are the Apex Classes and Trigger that I have developed 

Apex Class 1

public class GGUSettings
{
    public static string USERNAME = 'abc';
    public static string PASSWORD = 'abc';
    public static string GGU_END_POINT = 'https://www.ggu.edu';
}

Apex Class 2 

//Generated by wsdl2apex

public class gguEduIntegration {
    public class Exception_x {
        public String message;
        private String[] message_type_info = new String[]{'message','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'message'};
    }
    public class result {
        public String[] error;
        public String status;
        private String[] error_type_info = new String[]{'error','http://ggu.edu/integration',null,'0','-1','true'};
        private String[] status_type_info = new String[]{'status','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'error','status'};
    }
    public class updateCase {
        public String caseId;
        public String status;
        public String resolution;
        public String resolutionMethod;
        public String closeDate;
        private String[] caseId_type_info = new String[]{'caseId','http://ggu.edu/integration',null,'0','1','false'};
        private String[] status_type_info = new String[]{'status','http://ggu.edu/integration',null,'0','1','false'};
        private String[] resolution_type_info = new String[]{'resolution','http://ggu.edu/integration',null,'0','1','false'};
        private String[] resolutionMethod_type_info = new String[]{'resolutionMethod','http://ggu.edu/integration',null,'0','1','false'};
        private String[] closeDate_type_info = new String[]{'closeDate','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'caseId','status','resolution','resolutionMethod','closeDate'};
    }
    public class updateCaseResponse {
        public gguEduIntegration.result return_x;
        private String[] return_x_type_info = new String[]{'return','http://ggu.edu/integration',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://ggu.edu/integration','false','false'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class SFDCHandlerPort {
        public String endpoint_x = 'https://www.ggu.edu/integration';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://ggu.edu/integration', 'gguEduIntegration'};
        public gguEduIntegration.result updateCase(String caseId,String status,String resolution,String resolutionMethod,String closeDate) {
            gguEduIntegration.updateCase request_x = new gguEduIntegration.updateCase();
            request_x.caseId = caseId;
            request_x.status = status;
            request_x.resolution = resolution;
            request_x.resolutionMethod = resolutionMethod;
            request_x.closeDate = closeDate;
            gguEduIntegration.updateCaseResponse response_x;
            Map<String, gguEduIntegration.updateCaseResponse> response_map_x = new Map<String, gguEduIntegration.updateCaseResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://ggu.edu/integration',
              'updateCase',
              'http://ggu.edu/integration',
              'updateCaseResponse',
              'gguEduIntegration.updateCaseResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
    }
}


Apex Class 3 

public class GGUWSCall
{
    private static gguEduIntegration.SFDCHandlerPort login(){
        gguEduIntegration.SFDCHandlerPort port = new gguEduIntegration.SFDCHandlerPort();
         
        port.inputHttpHeaders_x = new Map<String, String>();

        Blob headerValue = Blob.valueOf(GGUSettings.USERNAME + ':' + GGUSettings.PASSWORD );
         
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

        port.inputHttpHeaders_x.put('Authorization', authorizationHeader);

        port.inputHttpHeaders_x.put('Content-Type', 'text/xml; charset=utf-8');
       
        return port;
    }
    
    @Future(callout=true) 
    public static void syncCase(String caseId, String status, String resolution, String resolutionMethod, String closedDate)
    {                 
        gguEduIntegration.SFDCHandlerPort port = login();
        port.updateCase(caseId, status, resolution, resolutionMethod, closedDate);
    }
}

Apex Trigger 

Trigger 

trigger CaseSyncTrigger on Case (after update) {
    for (Case caseNew : Trigger.new) {
        GGUWSCall.syncCase(caseNew.CaseID__c, caseNew.Status, caseNew.Resolution__c, caseNew.ResolutionMethod__c, caseNew.ClosedDate != null ? caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'') : '');
//        System.debug(Logginglevel.INFO, 'caseId: '+caseNew.CaseID__c+' status: '+caseNew.Status + ' resolution: '+caseNew.Resolution__c+ ' resolutionMethod: '+ 
//        caseNew.ResolutionMethod__c + ' closeDate: '+(caseNew.ClosedDate!=null?caseNew.ClosedDate.format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\''):''));
    }
}

Thanks 





 
Hi All, 

I am very new to Apex and trying to bulkify and batchify a trigger to avoid the Governance Limits. Below is the my trigger


trigger IAA on Contact (before insert, before update)
{
for (Contact c : Trigger.new)
{
    if  (c.Area_of_Interest_del__c != 'Law' && (c.Visa_Type__c == 'J1 Exchange Visitor'||c.Visa_Type__c =='F1 Nonimmigrant Student'||c.International_Student__c ==True))
    {
        Account iaa = [Select Id FROM Account WHERE Account.Name = 'GGU - International Admissions & Advising'];
        c.AccountId = iaa.Id;
    }
}
}


I will really appreciate any help. 

Thanks