function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Snehal Gaware 15Snehal Gaware 15 

help needed on after update trigger which is not updating field value

Hi I have written a trigger where Case is parent object and SC_Problem_Case_Link__c is child object. this trigger working fine when child object is having any status other than Ready for testing, at that by using this trigger i am bale to change the status as tested.

But when status of child object is 'Ready For testing' i am not able to change it to tested.
if((Trigger.isAfter && Trigger.isUpdate))
{
Set<Id> Ids = new Set<Id>();
List<SC_Problem_Case_Link__c> scprblm = new List<SC_Problem_Case_Link__c>();

 for (Case cs: Trigger.new)
{
    Case oldLead = Trigger.oldMap.get(cs.Id);

    if (cs.Status == 'Tested')
    { 
        Ids.add(cs.Id);
    }
}

for (SC_Problem_Case_Link__c rateSheet: [select Id,Status__c from SC_Problem_Case_Link__c where Case__c in :Ids])
{
// List<SC_Problem_Case_Link__c> accts = [Select Id, Status__c from SC_Problem_Case_Link__c where Id in : Trigger.old];

    if (rateSheet.Status__c != 'Tested') {
        rateSheet.Status__c = 'Tested';
        scprblm.add(rateSheet);
    }
}

if (!scprblm.isEmpty()) {
    update scprblm;
}}

is there any suggestion how to resolve this.