• Serah
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I'm working with Opportunity object and OpportunityDetails object that have a master-detail relationship with one another. The master's api name is Opportunity and the detail's api name is Opportunity__Details__c.I have created a custom field in the Master object OppStatus__c.In that field I want to display the minimum status  of field Status__c value of Detail object. The field Status__c is a picklist value field with values Closed,Pending,New . And i have multiple records in the detail object .
(If the Status field in any record contains New, then it should update OppStatus field with New. 
I meant if in the records, 
for eg, Record 1 the field Status has value Closed
            Record 2 value is New, Record 3 value is Pending
           Record 4 value is Closed 

Then value should be updated in oppstatus is New. 
If in Record 2 , the value is pending or closed insted of new., the min value is pending. 

If all the values are closed, then the value closed should be updated. 

Like new is the minimum if new is not present, pending is the min. 
if pending is not present, closed is the min.) 
How to populate the field in master object. 
Thanks. 
  • January 03, 2023
  • Like
  • 0