Skip to main content
snehal shinde ha fatto una domanda in #Salesforce Developer

I have below scenario 

While filling the JOb Application gives an error message if the Position Status is Closed.

I am trying below code but seems its not working.

trigger jobApplicationAssociatePositionClose on Job_Application__c (after insert,after update) {     if(trigger.IsAfter && (trigger.isInsert || trigger.isUpdate)){         list<Position__c> updatePosition = new list<Position__c>();         for(Job_Application__c jobApp:trigger.new){             if(jobApp.Status__c == 'Closed- Canceled'){                  Position__c pos = new Position__c();                  pos.Id = jobApp.Position__c;                  pos.Status__c = 'Closed- Canceled';                  updatePosition.add(pos);             }         }         update updatePosition;     }        }

Thanks in Advance

 

#Trailhead  #Sales Cloud  #Service Cloud  #Marketing Cloud

4 risposte
  1. 11 feb 2022, 08:01

    Hello @Archana Panda,

    May  know what is ParentId in my case because this is my custom object. so how i can take ParentId.. 

    Thanks 

0/9000