• Luke Higgins 23
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 6
    Replies
I am querying timesheets__c and looking to update the contact associated to the timesheet (timecardApprover__c) that is held in the parent object placement__c. I am able to get a list of ids of the contact I need to update but I can't figure out how to to update the field current_timesheet_status__c associated with the contact. 
public with sharing class contFlag {
    public contFlag() {

        List<String> timecardApproverIds = new List<String>();
        Set<Id> setofIds = new Set<Id>();

    for(jstcl__TG_Timesheet__c ts : [SELECT Placement__r.TimecardApprover__c FROM Timesheet__c WHERE Placement__r.Status__c = 'Active' AND Status__c = 'Pending']){
              timecardApproverIds.add(String.valueOf(ts));
        }

    for(String a : timecardApproverIds){
            setofIds.add(Id.valueOf(a));
        }
    for(Id c : setofIds){
        c.Current_Timesheet_Status__c = 'Pending';
        // returns error of variable does not exist due to it not being for the contact object
        }
    }
}


 

I am trying to pass 2 object ids to an apex controller in order to use for a SOQL query. I then want to pass the list created in the SOQL query back to the javascript controller. There, I want to see if the list is empty or not and fire a message depending on the result.

component:

<aura:component  implements="flexipage:availableForRecordHome,force:hasRecordId,flexipage:availableForAllPageTypes,force:lightningQuickAction,force:appHostable" controller="getPTM" access="global">
    <aura:attribute name="recordId" type="Id"/>
    <aura:attribute name="plc" type="ts2__Placement__c"/>
    <aura:attribute name="user" type="String"/>
    <aura:attribute name="plan" type="String"/>
     <aura:attribute name="cpaList" type="jstcl__TG_Commission_Plan_Assignment__c[]"/>
    <aura:attribute name="parentId" type="String"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"></aura:handler>
	<aura:handler event="c:selectedsObjectRecordsEvent" action="{!c.submitIt}" />
    <lightning:recordEditForm aura:id="editfrm" recordId="{!v.recordId}" objectApiName="jstcl__PlacementTeamMember__c" onload="{!c.onloadrec}" onsuccess="{!c.successsave}"  > 
        <div class="slds-grid slds-gutters slds-p-horizontal_small">  
            <div class="slds-p-around_xx-small slds-size_2-of-8">   <lightning:inputField aura:id="plc" fieldName="jstcl__Placement__c" value="{!v.parentId}"/></div>
            <div class="slds-p-around_xx-small slds-size_2-of-8">   <lightning:inputField aura:id="user" fieldName="jstcl__User__c" value="{!v.user}"/></div>
            <div class="slds-p-around_xx-small slds-size_2-of-8">   <lightning:inputField aura:id="plan" fieldName="jstcl__CommissionPlan__c" value="{!v.plan}"/></div>
            <div class="slds-p-around_xx-small slds-size_1-of-8">   <lightning:inputField aura:id="split" fieldName="jstcl__SplitPercent__c"/></div>
            <div class="slds-p-around_xx-small slds-size_1-of-8 slds-m-top_large">   <lightning:button variant="brand"
			iconName="utility:add" label="Add User" title="Add User" onclick="{! c.greyOut }" /></div>
        </div>
    </lightning:recordEditForm>
</aura:component>
Component Controller
doInit: function(component, event, helper) {
        //Create the action
       var action = component.get("c.plcGetCPA");
       var user = component.get("v.user");
        var plan = component.get("v.plan");
        action.setParams({
            "user" : user,
            "plan" : plan
        });
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
               component.set("v.cpaList", response.getReturnValue());
            }
            else { console.log("Failed with state: " + state); }
        });
        // Send action off to be executed
        $A.enqueueAction(action);
    },
    greyOut : function(component , event , helper){
        var toastEvent = $A.get("e.force:showToast");
        var user = component.get("v.user");
        var plan = component.get("v.plan");
        var cpaList = component.get("v.cpaList");
		var cpaLength = cpaList.length;
        component.set("v.isOpen", !component.get("v.isOpen"));
        
        if(cpaLength > 0){
        toastEvent.setParams({
            title : 'Success',
            message:'Commission Plan matches.' + cpaList +" -------- "+ plan,
            duration:'5000',
            key: 'info_alt',
            type: 'error',
            mode: 'pester' });
        toastEvent.fire();}   
     else { toastEvent.setParams({
            title : 'Error',
            message:'Commission Plan does not match the user.' + user +' '+ plan,
            duration:'5000',
            key: 'info_alt',
            type: 'error',
            mode: 'pester' });
        toastEvent.fire();}    
    }

Apex Controller:
public class getPTM {
AuraEnabled
    public static List<jstcl__TG_Commission_Plan_Assignment__c> plcGetCPA(List<Id> userId, List<Id> planId){
       
        List<jstcl__TG_Commission_Plan_Assignment__c> cpaList= new List<jstcl__TG_Commission_Plan_Assignment__c>();
        cpaList = [SELECT Id
                   FROM jstcl__TG_Commission_Plan_Assignment__c 
                   WHERE jstcl__User__r.Id IN :userId AND jstcl__Commission_Plan__r.Id IN :planId];
       
    return cpaList;
        
    }

}

 
Hi,
I am trying to get a test class written for this trigger that adds a child record after the creation of the parent record. I am getting the following error -
"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, jstcl.PlacementTeamMember: execution of BeforeInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.jstcl.PlacementTeamMemberTriggerHandler.validateTeamMembers: line 14, column 1
Trigger.jstcl.PlacementTeamMember: line 2, column 1: []"

trigger:
trigger autoAddNAM_VAM on ts2__Placement__c (after insert) {
    List<jstcl__PlacementTeamMember__c> teamMems = new List<jstcl__PlacementTeamMember__c>();
     Set<Id> tsClientSet = new Set<id>();
      Map<ID, Account> tsClientmap = new Map<ID, Account> ();   // Check the API Name of ts2__Client__c object
 for(ts2__Placement__c newTeamMem : Trigger.New)
    {
        
        if(newTeamMem.ts2__Client__c != null)
        {
            
            tsClientSet.add(newTeamMem.ts2__Client__c);
        }
    }
    
    if(tsClientSet.size() > 0)
    {
        tsClientmap = new Map<ID, Account>([SELECT Id, VAM_or_NAM_Member__c from Account where Id IN: tsClientSet]);
    }
    for(ts2__Placement__c newTeamMem : Trigger.New){

        if(tsClientmap.Containskey(newTeamMem.ts2__Client__C))
        {
                      
  try{ 
            if (tsClientmap.get(newTeamMem.ts2__Client__C).VAM_or_NAM_Member__c != null ){
                teamMems.add(new jstcl__PlacementTeamMember__c(
                        jstcl__Placement__c = newTeamMem.Id,
                        jstcl__User__c = tsClientmap.get(newTeamMem.ts2__Client__C).VAM_or_NAM_Member__c,
                        jstcl__CommissionPlan__c = [Select jstcl__Commission_Plan__c
                                                    FROM jstcl__TG_Commission_Plan_Assignment__c 
                                                    WHERE jstcl__Commission_Plan__r.Name LIKE '%Plan%' AND jstcl__User__c = :tsClientmap.get(newTeamMem.ts2__Client__C).VAM_or_NAM_Member__c].jstcl__Commission_Plan__c,
                        jstcl__SplitPercent__c = 100));
            }
  }catch(exception e){
       System.debug('The following exception has occurred: ' + e.getMessage());
  }   
        
    }
   
    insert teamMems;
    }
}

test:
@isTest
public class addNAM_VAMtest {
	
    static testmethod void test1(){
        ts2__Placement__c plc = new ts2__Placement__c(ts2__Client__c = '00137000008cDfrAAE');
		account acct = new account(VAM_or_NAM_Member__c = '00537000003tZkqAAE', Name = 'Northwestern Medicine');  
        jstcl__PlacementTeamMember__c ptm = new jstcl__PlacementTeamMember__c(jstcl__Placement__c = 'a211G000001NrqRQAS', jstcl__User__c = '00537000003tZkqAAE',
                                                                              jstcl__CommissionPlan__c = 'a4g370000008PGJAA2', jstcl__SplitPercent__c = 100);
        
        insert acct;
        insert ptm;
    }
}

 

I am trying to create a child record (jstcl__PlacementTeamMember__c) after the creation of the parent record (ts2__Placement__c). I am able to get all of it populated in the new child record besides the jstcl__User__c field. It seems like the "newTeamMem.ts2__Client__r.VAM_or_NAM_Member__c" portion is incorrect. This is problematic to the IF statement as well because it is being fired everytime a parent record is created when it should only fire when the criteria is met. 

trigger autoAddNAM_VAM on ts2__Placement__c (after insert) {
    List<jstcl__PlacementTeamMember__c> teamMems = new List<jstcl__PlacementTeamMember__c>();
    
    for(ts2__Placement__c newTeamMem : Trigger.New){
        if (newTeamMem.ts2__Client__r.VAM_or_NAM_Member__c != null){
            teamMems.add(new jstcl__PlacementTeamMember__c(
                	jstcl__Placement__c = newTeamMem.Id,
                	jstcl__User__c = newTeamMem.ts2__Client__r.VAM_or_NAM_Member__c,
                	jstcl__CommissionPlan__c = 'a4g370000008PGRAA2',
                	jstcl__SplitPercent__c = 100));
        }
    }
    insert teamMems;
    
}
Thank you.
Hello,

I am trying to update a custom number field on a custom object (placement) from a list of a seperate custom objects (timesheets). The following returns no errors, however when I run this through an anonymous window, it doesn't properly update the TCEndDateAudit__c on the Placement object (it turns up null). 

Here is my code so far: 
public class CamstimecardEndDateAudit{
public void auditTimeCards(){
    List<jstcl__TG_Timesheet__c> myList = new List<jstcl__TG_Timesheet__c>();

     myList = [SELECT jstcl__Placement__r.Name, Period__c, jstcl__Placement__r.TCEndDateAudit__c
                            FROM jstcl__TG_Timesheet__c 
                            WHERE jstcl__Placement__r.ts2__Status__c IN ('Active') 
                             AND jstcl__Week_Ending__c = LAST_N_DAYS:15
                             AND jstcl__Status__c = 'Pending' Limit 199];
    
    for(integer i=0 ; i < myList.size(); i++) {
        IF(myList[i].Period__c == 'Weekly Split'){
    myList[i].jstcl__Placement__r.TCEndDateAudit__c = myList[i].jstcl__Placement__r.TCEndDateAudit__c+ 0.5;}
       else{
    myList[i].jstcl__Placement__r.TCEndDateAudit__c = myList[i].jstcl__Placement__r.TCEndDateAudit__c+ 1;
    }
    }
    
  update myList;
}}

 
I am trying to update a custom number field of a list of custom objects. I keep receiving the error Error: Compile Error: Field is not writeable: jstcl__TG_Timesheet__c.Period__c at line 12 column 22. However, this varible isn't the one being written over, I'm just reading what it's value is on the if statement.

This is what I have so far:
public class CamstimecardEndDateAudit{
public static void auditTimeCards(){
    List<jstcl__TG_Timesheet__c> myList = new List<jstcl__TG_Timesheet__c>();

     myList = [SELECT jstcl__Placement__r.Name, Period__c, TCEndDateAuditB__c
                            FROM jstcl__TG_Timesheet__c 
                            WHERE jstcl__Placement__r.ts2__Status__c IN ('Active') 
                             AND jstcl__Week_Ending__c = LAST_N_DAYS:15
                             AND jstcl__Status__c = 'Pending'];
    
    for(integer i=0 ; i < myList.size(); i++) {
        if(myList[i].Period__c = 'Weekly Split'){
    myList[i].TCEndDateAuditB__c = myList[i].TCEndDateAuditB__c + 0.5;}
       else{
    myList[i].TCEndDateAuditB__c = myList[i].TCEndDateAuditB__c + 1;
    }
    }
    
  update myList;
}}

 
I am trying to return placements that occur in the query more than once and I am getting the error "Only root queries support aggregate expressions." Is there another way to count the placements than using a nested query? I know that GROUP BY is not supported in the sub-query but I'm unsure how else to go about it.

Here is what I have so far:
SELECT jstcl__Placement__r.Name,
(SELECT COUNT(Name) FROM Placements__r Group By Id COUNT(NAME) > 1)
FROM jstcl__TG_Timesheet__c WHERE jstcl__Placement__r.ts2__Status__c IN ('Active') AND jstcl__Week_Ending__c = LAST_N_DAYS:14 AND jstcl__Status__c = 'Pending'

 
I am querying timesheets__c and looking to update the contact associated to the timesheet (timecardApprover__c) that is held in the parent object placement__c. I am able to get a list of ids of the contact I need to update but I can't figure out how to to update the field current_timesheet_status__c associated with the contact. 
public with sharing class contFlag {
    public contFlag() {

        List<String> timecardApproverIds = new List<String>();
        Set<Id> setofIds = new Set<Id>();

    for(jstcl__TG_Timesheet__c ts : [SELECT Placement__r.TimecardApprover__c FROM Timesheet__c WHERE Placement__r.Status__c = 'Active' AND Status__c = 'Pending']){
              timecardApproverIds.add(String.valueOf(ts));
        }

    for(String a : timecardApproverIds){
            setofIds.add(Id.valueOf(a));
        }
    for(Id c : setofIds){
        c.Current_Timesheet_Status__c = 'Pending';
        // returns error of variable does not exist due to it not being for the contact object
        }
    }
}


 

I am trying to pass 2 object ids to an apex controller in order to use for a SOQL query. I then want to pass the list created in the SOQL query back to the javascript controller. There, I want to see if the list is empty or not and fire a message depending on the result.

component:

<aura:component  implements="flexipage:availableForRecordHome,force:hasRecordId,flexipage:availableForAllPageTypes,force:lightningQuickAction,force:appHostable" controller="getPTM" access="global">
    <aura:attribute name="recordId" type="Id"/>
    <aura:attribute name="plc" type="ts2__Placement__c"/>
    <aura:attribute name="user" type="String"/>
    <aura:attribute name="plan" type="String"/>
     <aura:attribute name="cpaList" type="jstcl__TG_Commission_Plan_Assignment__c[]"/>
    <aura:attribute name="parentId" type="String"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"></aura:handler>
	<aura:handler event="c:selectedsObjectRecordsEvent" action="{!c.submitIt}" />
    <lightning:recordEditForm aura:id="editfrm" recordId="{!v.recordId}" objectApiName="jstcl__PlacementTeamMember__c" onload="{!c.onloadrec}" onsuccess="{!c.successsave}"  > 
        <div class="slds-grid slds-gutters slds-p-horizontal_small">  
            <div class="slds-p-around_xx-small slds-size_2-of-8">   <lightning:inputField aura:id="plc" fieldName="jstcl__Placement__c" value="{!v.parentId}"/></div>
            <div class="slds-p-around_xx-small slds-size_2-of-8">   <lightning:inputField aura:id="user" fieldName="jstcl__User__c" value="{!v.user}"/></div>
            <div class="slds-p-around_xx-small slds-size_2-of-8">   <lightning:inputField aura:id="plan" fieldName="jstcl__CommissionPlan__c" value="{!v.plan}"/></div>
            <div class="slds-p-around_xx-small slds-size_1-of-8">   <lightning:inputField aura:id="split" fieldName="jstcl__SplitPercent__c"/></div>
            <div class="slds-p-around_xx-small slds-size_1-of-8 slds-m-top_large">   <lightning:button variant="brand"
			iconName="utility:add" label="Add User" title="Add User" onclick="{! c.greyOut }" /></div>
        </div>
    </lightning:recordEditForm>
</aura:component>
Component Controller
doInit: function(component, event, helper) {
        //Create the action
       var action = component.get("c.plcGetCPA");
       var user = component.get("v.user");
        var plan = component.get("v.plan");
        action.setParams({
            "user" : user,
            "plan" : plan
        });
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
               component.set("v.cpaList", response.getReturnValue());
            }
            else { console.log("Failed with state: " + state); }
        });
        // Send action off to be executed
        $A.enqueueAction(action);
    },
    greyOut : function(component , event , helper){
        var toastEvent = $A.get("e.force:showToast");
        var user = component.get("v.user");
        var plan = component.get("v.plan");
        var cpaList = component.get("v.cpaList");
		var cpaLength = cpaList.length;
        component.set("v.isOpen", !component.get("v.isOpen"));
        
        if(cpaLength > 0){
        toastEvent.setParams({
            title : 'Success',
            message:'Commission Plan matches.' + cpaList +" -------- "+ plan,
            duration:'5000',
            key: 'info_alt',
            type: 'error',
            mode: 'pester' });
        toastEvent.fire();}   
     else { toastEvent.setParams({
            title : 'Error',
            message:'Commission Plan does not match the user.' + user +' '+ plan,
            duration:'5000',
            key: 'info_alt',
            type: 'error',
            mode: 'pester' });
        toastEvent.fire();}    
    }

Apex Controller:
public class getPTM {
AuraEnabled
    public static List<jstcl__TG_Commission_Plan_Assignment__c> plcGetCPA(List<Id> userId, List<Id> planId){
       
        List<jstcl__TG_Commission_Plan_Assignment__c> cpaList= new List<jstcl__TG_Commission_Plan_Assignment__c>();
        cpaList = [SELECT Id
                   FROM jstcl__TG_Commission_Plan_Assignment__c 
                   WHERE jstcl__User__r.Id IN :userId AND jstcl__Commission_Plan__r.Id IN :planId];
       
    return cpaList;
        
    }

}

 
Hi,
I am trying to get a test class written for this trigger that adds a child record after the creation of the parent record. I am getting the following error -
"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, jstcl.PlacementTeamMember: execution of BeforeInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.jstcl.PlacementTeamMemberTriggerHandler.validateTeamMembers: line 14, column 1
Trigger.jstcl.PlacementTeamMember: line 2, column 1: []"

trigger:
trigger autoAddNAM_VAM on ts2__Placement__c (after insert) {
    List<jstcl__PlacementTeamMember__c> teamMems = new List<jstcl__PlacementTeamMember__c>();
     Set<Id> tsClientSet = new Set<id>();
      Map<ID, Account> tsClientmap = new Map<ID, Account> ();   // Check the API Name of ts2__Client__c object
 for(ts2__Placement__c newTeamMem : Trigger.New)
    {
        
        if(newTeamMem.ts2__Client__c != null)
        {
            
            tsClientSet.add(newTeamMem.ts2__Client__c);
        }
    }
    
    if(tsClientSet.size() > 0)
    {
        tsClientmap = new Map<ID, Account>([SELECT Id, VAM_or_NAM_Member__c from Account where Id IN: tsClientSet]);
    }
    for(ts2__Placement__c newTeamMem : Trigger.New){

        if(tsClientmap.Containskey(newTeamMem.ts2__Client__C))
        {
                      
  try{ 
            if (tsClientmap.get(newTeamMem.ts2__Client__C).VAM_or_NAM_Member__c != null ){
                teamMems.add(new jstcl__PlacementTeamMember__c(
                        jstcl__Placement__c = newTeamMem.Id,
                        jstcl__User__c = tsClientmap.get(newTeamMem.ts2__Client__C).VAM_or_NAM_Member__c,
                        jstcl__CommissionPlan__c = [Select jstcl__Commission_Plan__c
                                                    FROM jstcl__TG_Commission_Plan_Assignment__c 
                                                    WHERE jstcl__Commission_Plan__r.Name LIKE '%Plan%' AND jstcl__User__c = :tsClientmap.get(newTeamMem.ts2__Client__C).VAM_or_NAM_Member__c].jstcl__Commission_Plan__c,
                        jstcl__SplitPercent__c = 100));
            }
  }catch(exception e){
       System.debug('The following exception has occurred: ' + e.getMessage());
  }   
        
    }
   
    insert teamMems;
    }
}

test:
@isTest
public class addNAM_VAMtest {
	
    static testmethod void test1(){
        ts2__Placement__c plc = new ts2__Placement__c(ts2__Client__c = '00137000008cDfrAAE');
		account acct = new account(VAM_or_NAM_Member__c = '00537000003tZkqAAE', Name = 'Northwestern Medicine');  
        jstcl__PlacementTeamMember__c ptm = new jstcl__PlacementTeamMember__c(jstcl__Placement__c = 'a211G000001NrqRQAS', jstcl__User__c = '00537000003tZkqAAE',
                                                                              jstcl__CommissionPlan__c = 'a4g370000008PGJAA2', jstcl__SplitPercent__c = 100);
        
        insert acct;
        insert ptm;
    }
}

 

I am trying to create a child record (jstcl__PlacementTeamMember__c) after the creation of the parent record (ts2__Placement__c). I am able to get all of it populated in the new child record besides the jstcl__User__c field. It seems like the "newTeamMem.ts2__Client__r.VAM_or_NAM_Member__c" portion is incorrect. This is problematic to the IF statement as well because it is being fired everytime a parent record is created when it should only fire when the criteria is met. 

trigger autoAddNAM_VAM on ts2__Placement__c (after insert) {
    List<jstcl__PlacementTeamMember__c> teamMems = new List<jstcl__PlacementTeamMember__c>();
    
    for(ts2__Placement__c newTeamMem : Trigger.New){
        if (newTeamMem.ts2__Client__r.VAM_or_NAM_Member__c != null){
            teamMems.add(new jstcl__PlacementTeamMember__c(
                	jstcl__Placement__c = newTeamMem.Id,
                	jstcl__User__c = newTeamMem.ts2__Client__r.VAM_or_NAM_Member__c,
                	jstcl__CommissionPlan__c = 'a4g370000008PGRAA2',
                	jstcl__SplitPercent__c = 100));
        }
    }
    insert teamMems;
    
}
Thank you.
Hello,

I am trying to update a custom number field on a custom object (placement) from a list of a seperate custom objects (timesheets). The following returns no errors, however when I run this through an anonymous window, it doesn't properly update the TCEndDateAudit__c on the Placement object (it turns up null). 

Here is my code so far: 
public class CamstimecardEndDateAudit{
public void auditTimeCards(){
    List<jstcl__TG_Timesheet__c> myList = new List<jstcl__TG_Timesheet__c>();

     myList = [SELECT jstcl__Placement__r.Name, Period__c, jstcl__Placement__r.TCEndDateAudit__c
                            FROM jstcl__TG_Timesheet__c 
                            WHERE jstcl__Placement__r.ts2__Status__c IN ('Active') 
                             AND jstcl__Week_Ending__c = LAST_N_DAYS:15
                             AND jstcl__Status__c = 'Pending' Limit 199];
    
    for(integer i=0 ; i < myList.size(); i++) {
        IF(myList[i].Period__c == 'Weekly Split'){
    myList[i].jstcl__Placement__r.TCEndDateAudit__c = myList[i].jstcl__Placement__r.TCEndDateAudit__c+ 0.5;}
       else{
    myList[i].jstcl__Placement__r.TCEndDateAudit__c = myList[i].jstcl__Placement__r.TCEndDateAudit__c+ 1;
    }
    }
    
  update myList;
}}

 
I currently am working on creating an Apex Class that initiially pulls a specific set of Placements (jstcl__Placement__c) and puts them in a list. 
It then takes that list of Placement Ojects and edits a relevant field called TimecardEnddateAudit__c field. I keep getting errors saying that the field jstcl__Timesheet_Period__c that exists in some of my if logic does not exist. Logically it should edit fields according to the logic:" If the jstcl__Timesheet_Period__c field is equal to 'Weekly Split' then add .5, else add 1. 
public class CamstimecardEndDateAudit{
public static void auditTimeCards(){

List<sObject> placements = [SELECT jstcl__Placement__r.Name
                            FROM jstcl__TG_Timesheet__c 
                            WHERE jstcl__Placement__r.ts2__Status__c IN ('Active') 
                             AND jstcl__Week_Ending__c = LAST_N_DAYS:15
                             AND jstcl__Status__c = 'Pending'];
                             
    for(List<sObject> A : placements){

        if(A.jstcl__Timesheet_Period__c = 'Weekly Split'){
        
        TimecardEndDateAudit__c = TimecardEndDateAudit__c + 0.5;}
        
        else{
        
        TimecardEndDateAudit__c = TimecardEndDateAudit__c ++;
}
}
}}