• Hm_invi
  • NEWBIE
  • 50 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 4
    Replies
I have a requirement to update the address of an account in the Report. 
This address is suposed to the Billing and if it is not updated then shipping address. If both billing and shipping are not available then the address in the report should be blank.

Since this if condition logic is not possible in Report, i have created a bunch of formula fields. 
1. BillingAddress__c- Billing address Text formula field to concate all the billing address in one field-  .
2. ShippingAddress__c- Shipping address Text formula field to concate all the billing address in one field-.

Both the above fields are working fine.

3.DeliveryAddress__c- Text formula field to update the billing address and if it is blank shipping address to be updated else blank.
This field is used in report.
 
IF( NOT( ISBLANK(BillingAddress__c)) , BillingAddress__c, 
     IF(NOT( ISBLANK(ShippingAddress__c)), ShippingAddress__c, ' ')
  )
IF(  ISBLANK(BillingAddress__c) , 
     IF( ISBLANK(ShippingAddress__c), ShippingAddress__c, ''), 
     BillingAddress__c 
  )

No syntax error and same result from both the above formulas.
the billing address is  updating in 3 field when it is not blank.
But when billing address is blank the shipping address is not blank, the filed update in 3 is not happening. 

i have used ISNULL() as well but no difference.

Is there anything that i'm missing?

Thanks.
I have to be able to send an Email to a user X when there is a button clicked on the Case object.
This Email should contain the case details.
How do i implement this?
-I will create an Email Alert and an Email Template. 
But how can i link the button to this Email. 
Does this button needs to be implemented as Aura component or using a Button Action?

(There was also another easier approach which involved checkbox or picklist and a PB or Workflow. But it was ruled out for some reason. So stuck with the button implementation)

Thanks for your time to respond!!!!
  • September 27, 2021
  • Like
  • 0
i have to approve a custom obj record which has it's status field to completed.
Now a process builder is setup which will trigger the approval process setup..
this approval process will send an email notification and upon approval by a queue called 'service group' this status field will update to approved.
this email notification has an email alert which has a case to email id in the additional email addresses. now a new case is created and this email is attached to that case.

Now the requirement is: 
-service group queue shall approve the record from the created case. because the service group does not have access to the custom obj.
-the way they need to approve is by replaying as APPROVED.
any queue user can do this.

challanges i'm facing are:
-i cannot use the queue in the approval process because there is a master-detail relationship and this custom obj is on detail side.
-how can i make sure that APPROVE replay from the case attached Email will tick this approval process record. i dont see the auto approval Email id (the salesforce automated one) in the To address of the Case Email.
-since i cannot use the queue and anyone from the queue can approve these records how can i choose the approver in the approval steps.

-What is custom Email Template for auto email approval and how can i use it here?

The question is on the lengthy side. but please help me if you can.

Thanks in advance.
I have to approve this custom_object__c record-A which has the status as completed.
so i have created a process builder which will call this approval process when status changes to completed. 
As initial action, This will create a case with the Email sent as i added the Case2Email id in the additional field of the Alert.

The approvers from approve queue needs to respond as APPROVE to this Email case record which should approve the record-A.

i cannot assign a queue to this approval process directly because it's in a master-detail relationship.

How can i make this requirement possible.

An approval process should create a case under a queue and if any user from that queue Approves that case Email record then this approval process should be done. 
I'm not supposed to use any code.

Thanks!!!
Hi,
I have a list of Email addresses. I need to find where these are being used in the org. 
Like in which Email Alert or if hardcoded in any component or metadata.
I was told we can find this using the VScode. 
Iam only used to the developer console and new to to the VScode.
Can anyone help me to achieve this?
Thanks!!!!!!!!! 
I'm new to salesforce and coding. please suggest me what to do here!!!

I have three objects opportunities, projects and tasks.
relationship between them is,
Opportunity to projects--> lookup 
projects to tasks-->master-detail.

i need the status field on projects to populate 'complete' when an opportunity is closed won/lost. 
but i can't do this because the projects status field is a managed package formula field which cannot be edited.

The project status field formula is, if all its task records status fields are marked as complete then it will also be completed.

i dont see any relation directly from opportunity and tasks.

So now i need to make a trigger/process builder/workflow/lightning flow so when an opportunity is closed it will mark these tasks as complete which in turn marks the project as complete and make that unavailable to edit. 

How can i achieve this. I'm new to coding, so if it is a trigger how should the code be. 

Your help is really appreciated!!!!!!!
I have three objects Opportunity(A), Project(B) and Project Task(C). 

Project records are created from opportunity record. 
Project Task records are from Project record.

Projects should be closed when opportunity is closed won/lost.
There is a status formula field on project which should be set to 'complete' when opportunity stage is closed.
But the project will only be 'complete' when i manually close the status Picklist field in all the project task child records.

But This project and Project task are a part of some managed package. so their field formula cannot be edited.

So is there any way i can modify the 'C' object records fields when 'A' is set to Closed won/lost. 
Will it be possible to using process builder, lightning flows etc. 
I dont want to implement trigger in this.

Thanks for all your time.

 
Hi Devs, 
Iam new to salesforce and I have this requirement  to be implemented.

As a lead project manager, I should receive an email when a new opportunity is created and a separate email when the project manager is changed on the opportunity. 

As a project manager, I should receive an email notification when I am assigned to an opportunity as the project manager. 

Iam confused between using process builder and workflow rules. 
Can anyone help me how should the approach be for this?

THANKS IN ADVANCE.


 
Hello devs, 

I have to delete many Account record types . i have been deactivating and deleting them in the sandbox by manually removing them from mainly sharing settings and then from each profile. 

The profile part is where i'm facing the issue. There are almost 40 profiles for which the record types are default. 

I have manually changed the default record type in the sandbox. then in the changeset i have included these profiles and some unreleated apex classes for deployment. 

Deployment was successfull in the production but the profile default record types for the  account are not changed. 

Is there anything else i need to include in the changeSet?

is there any other approach for this? Like deploying using xml in workBench?

We are not authorized to use ANT in production. Thats why workbench. 

In the sandbox i can use ANT but i couldn't retrieve the profiles. 
    <types>
      <members>Account</members>
      <name>CustomObject</name>
    </types>
    <types>
       <members>*</members>
       <name>Profile</name>
    </types>
I was able to retrieve Account object but not the profiles.

It says **BUILD FAILED with java IOException: syntax incorrect.**
this is the short version of it. 

Is there any easy approach for this?

Thanks for your help!!!
 
Hi, 
There are almost 500 fields in Accounts and Iam trying to delete the fields of a couple of page layouts and fields not used in any page layout (and any custom logic). 
It is not practical to check each field if it is being used in any page layout. 
Using this tooling API SOQL
SELECT Layout.Name, Layout.TableEnumOrId FROM ProfileLayout WHERE Layout.TableEnumOrId = 'Account'
i was able to retrieve the page layout names. 
Is there any way for me to retrieve the fields of these page layouts. 

I have built a vf page and a controller from here:
https://developer.salesforce.com/forums/?id=906F0000000DD9aIAG

but i get 'Collection size exceeds maximum size of 1000 error'. 

and our org dont use LWC so is there any other not so complicated approach for this issue.

Thanks for your time.

May the Force be with you!!!!!!!!!!!!! 
 
Hi, 
Thanks in advance for your response.

I have these Portal roles that are not getting displayed in roles hierarchy tree but are there which i'm only able to view while i click on delete of that role. but i dont see edit, delete buttons in these portal roles. 
i was able to query those from the workbench, dataloader.io, data loader. 

SELECT Id, Name, ParentRoleId, PortalRole, PortalType FROM UserRole WHERE ParentRoleId='00Ew0000x01xNxIxxx'

When iam deleting these queried portal roles it displays deletion is success. 
But they are still there in the sandbox. 
No matter how many times i query and delete it still shows success but i cant delete. 

I dont know what iam missing here.
Hi, 
I'm new to salesforce deployments. 
I have a task to delete some 20 fields and records. 

I have made changes to all the dependent apex classes, removed the necessary fieldsets in lightning pages inorder to delete these fields.
Developed a SOQL query to remove the necessary records.
I hade done all of this successfully in the sandbox. 

But how can i deploy this into production using changesets (or)
Should i make changes to the few lines of code in the production also? and delete the fields manually each in production?
Should i be running this SOQL in the production environment to delete the records or what is the process.

is it manditory to use changesets if the changes are few. My changes to implement may take around 30-45 minutes.

Thanks for your help.
 
Hi, 
I was tasked with the decommissioning of few objects and their metadata, not anymore essential for business. 

based on one of the document by the developer whom i have replaced,  
there are around of 8 objects:
obj1.obj2,......obj8. with around 70 fields each.
51 apex classes and test classes.
triggers,
lightning components,
vf pages,
static resource,
custom label,
custom metadata, 
email alerts, 
email templates, 
named credentials, 
remote sites
quick action, 
workflow rules, 
process builders, 
community, 
sites, 
profile, 
validation rules, 
sharing rules, 
custom settings.

i just have to build a step-by-step process of how to break the links these objects have with the rest ongoing ones and delete these.
like, i cannot delete a field if it is used in a class. 

where should i start , if i should not mess up any ongoing process tied to these.
for what questions i need to have answers.
what all things i need to look into before starting. 

the person who previously worked on this left, so i do not have any one to suggest me. 

please advice me with your approach.

Thanks!!!!!
Hi, i have created a aura table with case fields in it.
no i want to find the id and and values of the row when i click on the case number. 
iam able to find the id using "event.currentTarget.dataset.recordid" but not the field values.
how can i also get the field values as they are already in the instance.
i made a server call to apex but it is only happening after firing the event. 
how to solve this?
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="1"  >
            <thead>
                <tr>
                    <th>Case Number</th>
                    <th>Subject</th>
                    <th>Created Date</th>
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.filterlstCases}" var="cas">
                    <tr >
                        <td onclick="{!c.handleRowAction}" data-recordid="{!cas.Id}">
                            <a>{!cas.CaseNumber}</a>  
                        </td>
                        <td onclick="{!c.handleRowAction}" data-recordid="{!cas.Id}">
                            <a>{!cas.Subject}</a>  
                        </td>
                        <td>
                            <lightning:formattedDateTime value="{!cas.CreatedDate}" year="numeric" month="numeric" day="numeric"  hour="2-digit" minute="2-digit" hour12="false"/>
                        </td>
                    </tr>
                </aura:iteration>  
            </tbody>
        </table>
 
handleRowAction : function(component, event, helper){
        var selectedItem = event.currentTarget;
        var recordId = selectedItem.dataset.recordid;

//call to apex

       var getCaseAction = component.get("c.fetchCaseDetails");
        getCaseAction.setParams({
            'fetchId': recordId
        });
        getCaseAction.setCallback(this, function(response){
            var actionState = response.getState();
            
            if(actionState == 'SUCCESS') {
                console.log(response.getReturnValue());                 
            }
        });
        $A.enqueueAction(getCaseAction);
       
 //event call

        var evt = $A.get("e.c:myCasesDetailsEvent");
        evt.setParams({
            "caseIdfromChild" : recordId            
        });
        evt.fire();
        
    }
 
public class portalCases {
@AuraEnabled
    public static list<Case> fetchCaseDetails(string fetchId) {        
        list<case> detailList = [SELECT CaseNumber, Subject, CreatedDate, Status,origin FROM Case WHERE id= :fetchId];
        system.debug(detailList);
        return detailList;
        
    }
}

 
Hi guys,
Been working on this for a while but unable to fugure out. 
i want to render the table only based on the click of the buttons i.e,
if i click the open cases the table should  filter and load all the open cases and 
if i click the closed cases the table should filter and load all the closed cases and like that.
but iam not able to comprehend this. 
can anyone please help me figure this out.
User-added image

---------------------------------apex controller----------------------------
public class portalCases {
    @AuraEnabled
    public static list <Case> fetchCase() {
        Return [SELECT CaseNumber,Category__c,Case_Sub_Category__c,Subject,CreatedDate FROM Case];
        
    }
}
----------------------------------component------------------------------
<aura:component controller="portalCases" implements="force:appHostable,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">
        
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
    
    <aura:attribute name="lstAllCase" type="Case[]"/>
    
    <div class="slds-m-around_xx-large, slds-align_absolute-center" id="myDIV">
        &nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn active" onclick="{!c.myAction}">Open Cases</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn" onclick="{!c.myAction}">Closed Cases</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn" onclick="{!c.myAction}">All Cases</button>&nbsp;&nbsp;&nbsp;&nbsp;
    </div>
    
    <div class="slds-m-around_medium">
        <table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%" >
            <thead>
                <tr>
                    <th>Case Number</th>
                    <th>Category</th>
                    <th>Sub Category</th>
                    <th>Subject</th>
                    <th>Created Date</th> 
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.lstAllCase}" var="cas">
                    <tr>
                        <td>{!cas.CaseNumber}</td>
                        <td>{!cas.Category__c}</td>
                        <td>{!cas.Case_Sub_Category__c}</td>
                        <td>{!cas.Subject}</td>
                        <td>{!cas.CreatedDate}</td>
                    </tr>
                </aura:iteration>  
            </tbody>
        </table>
    </div>
    
</aura:component>

----------------------------------JScontroller-------------------------------------
({    
    doInit : function(component,event,helper){
        //call apex class method
        var action = component.get('c.fetchCase');
        action.setCallback(this, function(response) {
            //store state of response
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set('v.lstAllCase', response.getReturnValue());          
            }
        });
        $A.enqueueAction(action); 
    },
    
    myAction : function(component, event, helper) {
        // Get the container element
        var btnContainer = document.getElementById("myDIV");
        
        // Get all buttons with class="btn" inside the container
        var btns = btnContainer.getElementsByClassName("btn");
        
        // Loop through the buttons and add the active class to the current/clicked button
        for (var i = 0; i < btns.length; i++) {
            btns[i].addEventListener("click", function() {
                var current = document.getElementsByClassName("active");
                current[0].className = current[0].className.replace(" active", "");
                this.className += " active";
            });
        }
    },
})
----------------------------CSS---------------------------
.THIS {
}

.THIS .btn {
    border: none;
    outline: none;
    padding: 10px 16px;
    border-radius: 8px;
    background-color: #f1f1f1;
    cursor: pointer;
}

/* Style the active class (and buttons on mouse-over) */
.THIS .active, .THIS .btn:hover {
    background-color: #1f0663;
    color: white;
}
Guys i'm looking for how to use knowledge articles for community cloud. 
I have gone through the trailblazer but i just feel like iam missing something. want some more deeper understanding of how knowledge articles used in community cloud. 
Can you provide any reference regarding the same. 
Thanks. 

Hi,
Iam new to apex. this is one of the trigger scenario bothering me.
Please help me with this.

I have a status checkbox field on accounts.
status picklist field with "open","closed" on contacts.
1) if status="closed" in all the related contacts then checkbox on account should be true.
2) if status="open" in any one of the related contacts then checkbox on account should be false.  
-------------------------------------------------------------------------------------------
Trigger:
trigger contactTrigg on contact(after insert, after update, after delete, after undelete){
    if(trigger.isInsert || trigger.isUpdate){
        accProgress.method1(trigger.new,trigger.old);
    }
}

-------
Handler:
public class accProgress{
    public static void method1(list<contact> newInsert, list<contact> oldInsert){
        
        set<id> conSet = new set<id>();
        
        for(contact con1 : newInsert){
            if(con1.Accountid != null){
                conSet.add(con1.accountid);
            }
        }
 for(contact con2 : oldInsert){
                conSet.add(con2.accountid);
        }

        List<account> accList =[SELECT id, progress_field__c,(SELECT id, progress_field_contacts__c FROM contacts) FROM account WHERE id IN :conSet];
        if(accList != null){
            for(account acc : accList){
                for(contact con : acc.contacts){
                    
                    if(con.progress_field_contacts__c == 'open' ){
                        acc.progress_field__c = false;
                    }
                    else{
                        acc.progress_field__c = true;
                    }
                }
            }
            update accList;
        }
    }
---------------------------------------------------------------------------------------------
1st one is working. i.e, whenever i make all related contacts "close" . the check box is getting checked(true).
2nd one is where iam failing. when i'm changing any contacts picklist values to open the account status checkbox is not unchecking(false).
please help me.
Hi, 
There are almost 500 fields in Accounts and Iam trying to delete the fields of a couple of page layouts and fields not used in any page layout (and any custom logic). 
It is not practical to check each field if it is being used in any page layout. 
Using this tooling API SOQL
SELECT Layout.Name, Layout.TableEnumOrId FROM ProfileLayout WHERE Layout.TableEnumOrId = 'Account'
i was able to retrieve the page layout names. 
Is there any way for me to retrieve the fields of these page layouts. 

I have built a vf page and a controller from here:
https://developer.salesforce.com/forums/?id=906F0000000DD9aIAG

but i get 'Collection size exceeds maximum size of 1000 error'. 

and our org dont use LWC so is there any other not so complicated approach for this issue.

Thanks for your time.

May the Force be with you!!!!!!!!!!!!! 
 
Hi, 
Thanks in advance for your response.

I have these Portal roles that are not getting displayed in roles hierarchy tree but are there which i'm only able to view while i click on delete of that role. but i dont see edit, delete buttons in these portal roles. 
i was able to query those from the workbench, dataloader.io, data loader. 

SELECT Id, Name, ParentRoleId, PortalRole, PortalType FROM UserRole WHERE ParentRoleId='00Ew0000x01xNxIxxx'

When iam deleting these queried portal roles it displays deletion is success. 
But they are still there in the sandbox. 
No matter how many times i query and delete it still shows success but i cant delete. 

I dont know what iam missing here.
Hi, i have created a aura table with case fields in it.
no i want to find the id and and values of the row when i click on the case number. 
iam able to find the id using "event.currentTarget.dataset.recordid" but not the field values.
how can i also get the field values as they are already in the instance.
i made a server call to apex but it is only happening after firing the event. 
how to solve this?
<table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="1"  >
            <thead>
                <tr>
                    <th>Case Number</th>
                    <th>Subject</th>
                    <th>Created Date</th>
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.filterlstCases}" var="cas">
                    <tr >
                        <td onclick="{!c.handleRowAction}" data-recordid="{!cas.Id}">
                            <a>{!cas.CaseNumber}</a>  
                        </td>
                        <td onclick="{!c.handleRowAction}" data-recordid="{!cas.Id}">
                            <a>{!cas.Subject}</a>  
                        </td>
                        <td>
                            <lightning:formattedDateTime value="{!cas.CreatedDate}" year="numeric" month="numeric" day="numeric"  hour="2-digit" minute="2-digit" hour12="false"/>
                        </td>
                    </tr>
                </aura:iteration>  
            </tbody>
        </table>
 
handleRowAction : function(component, event, helper){
        var selectedItem = event.currentTarget;
        var recordId = selectedItem.dataset.recordid;

//call to apex

       var getCaseAction = component.get("c.fetchCaseDetails");
        getCaseAction.setParams({
            'fetchId': recordId
        });
        getCaseAction.setCallback(this, function(response){
            var actionState = response.getState();
            
            if(actionState == 'SUCCESS') {
                console.log(response.getReturnValue());                 
            }
        });
        $A.enqueueAction(getCaseAction);
       
 //event call

        var evt = $A.get("e.c:myCasesDetailsEvent");
        evt.setParams({
            "caseIdfromChild" : recordId            
        });
        evt.fire();
        
    }
 
public class portalCases {
@AuraEnabled
    public static list<Case> fetchCaseDetails(string fetchId) {        
        list<case> detailList = [SELECT CaseNumber, Subject, CreatedDate, Status,origin FROM Case WHERE id= :fetchId];
        system.debug(detailList);
        return detailList;
        
    }
}

 
Hi guys,
Been working on this for a while but unable to fugure out. 
i want to render the table only based on the click of the buttons i.e,
if i click the open cases the table should  filter and load all the open cases and 
if i click the closed cases the table should filter and load all the closed cases and like that.
but iam not able to comprehend this. 
can anyone please help me figure this out.
User-added image

---------------------------------apex controller----------------------------
public class portalCases {
    @AuraEnabled
    public static list <Case> fetchCase() {
        Return [SELECT CaseNumber,Category__c,Case_Sub_Category__c,Subject,CreatedDate FROM Case];
        
    }
}
----------------------------------component------------------------------
<aura:component controller="portalCases" implements="force:appHostable,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">
        
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
    
    <aura:attribute name="lstAllCase" type="Case[]"/>
    
    <div class="slds-m-around_xx-large, slds-align_absolute-center" id="myDIV">
        &nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn active" onclick="{!c.myAction}">Open Cases</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn" onclick="{!c.myAction}">Closed Cases</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button class="btn" onclick="{!c.myAction}">All Cases</button>&nbsp;&nbsp;&nbsp;&nbsp;
    </div>
    
    <div class="slds-m-around_medium">
        <table id="tableId" class="slds-table slds-table_bordered slds-table_cell-buffer" cellspacing="0" width="100%" >
            <thead>
                <tr>
                    <th>Case Number</th>
                    <th>Category</th>
                    <th>Sub Category</th>
                    <th>Subject</th>
                    <th>Created Date</th> 
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.lstAllCase}" var="cas">
                    <tr>
                        <td>{!cas.CaseNumber}</td>
                        <td>{!cas.Category__c}</td>
                        <td>{!cas.Case_Sub_Category__c}</td>
                        <td>{!cas.Subject}</td>
                        <td>{!cas.CreatedDate}</td>
                    </tr>
                </aura:iteration>  
            </tbody>
        </table>
    </div>
    
</aura:component>

----------------------------------JScontroller-------------------------------------
({    
    doInit : function(component,event,helper){
        //call apex class method
        var action = component.get('c.fetchCase');
        action.setCallback(this, function(response) {
            //store state of response
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set('v.lstAllCase', response.getReturnValue());          
            }
        });
        $A.enqueueAction(action); 
    },
    
    myAction : function(component, event, helper) {
        // Get the container element
        var btnContainer = document.getElementById("myDIV");
        
        // Get all buttons with class="btn" inside the container
        var btns = btnContainer.getElementsByClassName("btn");
        
        // Loop through the buttons and add the active class to the current/clicked button
        for (var i = 0; i < btns.length; i++) {
            btns[i].addEventListener("click", function() {
                var current = document.getElementsByClassName("active");
                current[0].className = current[0].className.replace(" active", "");
                this.className += " active";
            });
        }
    },
})
----------------------------CSS---------------------------
.THIS {
}

.THIS .btn {
    border: none;
    outline: none;
    padding: 10px 16px;
    border-radius: 8px;
    background-color: #f1f1f1;
    cursor: pointer;
}

/* Style the active class (and buttons on mouse-over) */
.THIS .active, .THIS .btn:hover {
    background-color: #1f0663;
    color: white;
}

Hi,
Iam new to apex. this is one of the trigger scenario bothering me.
Please help me with this.

I have a status checkbox field on accounts.
status picklist field with "open","closed" on contacts.
1) if status="closed" in all the related contacts then checkbox on account should be true.
2) if status="open" in any one of the related contacts then checkbox on account should be false.  
-------------------------------------------------------------------------------------------
Trigger:
trigger contactTrigg on contact(after insert, after update, after delete, after undelete){
    if(trigger.isInsert || trigger.isUpdate){
        accProgress.method1(trigger.new,trigger.old);
    }
}

-------
Handler:
public class accProgress{
    public static void method1(list<contact> newInsert, list<contact> oldInsert){
        
        set<id> conSet = new set<id>();
        
        for(contact con1 : newInsert){
            if(con1.Accountid != null){
                conSet.add(con1.accountid);
            }
        }
 for(contact con2 : oldInsert){
                conSet.add(con2.accountid);
        }

        List<account> accList =[SELECT id, progress_field__c,(SELECT id, progress_field_contacts__c FROM contacts) FROM account WHERE id IN :conSet];
        if(accList != null){
            for(account acc : accList){
                for(contact con : acc.contacts){
                    
                    if(con.progress_field_contacts__c == 'open' ){
                        acc.progress_field__c = false;
                    }
                    else{
                        acc.progress_field__c = true;
                    }
                }
            }
            update accList;
        }
    }
---------------------------------------------------------------------------------------------
1st one is working. i.e, whenever i make all related contacts "close" . the check box is getting checked(true).
2nd one is where iam failing. when i'm changing any contacts picklist values to open the account status checkbox is not unchecking(false).
please help me.