• RarLopz
  • NEWBIE
  • 205 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 46
    Replies

I have granted the 'Transfer Recor' permission to users in a particular profile.  However, this allows the users to transfer records that they don't own.  How do i allow users to transfer only Opportunities thay they own. ? 

 

User-added image
I tried as suggested in this post but that did not work for me.
https://developer.salesforce.com/forums?id=906F0000000AW30IAG

I tried different browsers, still not loading. 

Any suggestions? 

 
I have a Profile with 20 users asssigned to this Profile
Custom_Picklist__c field on the Activity object has several values in it. Now, not all of these values need to be seen by all users in the profile. 

e.g User 1, User 2, User 3, User 4 should only see Val78, Val79,Val80. They  should be able to access all other values. I want to restrict rest of the users from accessing Val78, Val79,Val80.

Any way to achive this ? 
i am trying to display the time from Apex controller to Lightning component. 
is it possible to directly get Datetime.now () in the js controller and display it on the component? 



({	
	ctr : function(cmp, event, helper) {
        var temp = [];
       
        var action = cmp.get("c.getGraph");
        action.setParams({
        	"accountid": cmp.get("v.recordId")
       	});
        action.setCallback(this, function(response){
            if(response.getState() === 'SUCCESS' && response.getReturnValue()){
                temp = response.getReturnValue();
                helper.createGraph(cmp, temp);
            }
        });      
          
       $A.enqueueAction(action);
      
	},
    
    cancelAction: function(component, event, helper) {
   		$A.get("e.force:closeQuickAction").fire();
	}
})



 
Can some one plese assist? 

If you look at my wrapper class, there is an inner class EcPerformanceRecordList .I have declared a list<EcPerformanceRecordList>  for getting and setting values between controller and UI

When i try to create a map so that I have a list of EcPerformaceRecordList per User, I get an error when I declare the map as map<String,<list<EcPerformanceRecordList>>

How can i declare a Map and loop through this map so that I can count how many apps have been submitted per user.
e.g 
    UserID  Total  EC(Yes)     Date
    user1   12      4          06/12/2019
    user1   13      13         06/13/2019
    user2   35      24         06/18/2019
    user3   23      31         07/02/2019    
    user1   17       2          07/10/2019
    user3   12       3          07/10/2019

I am trying something like this 
Map<userid, list<ecRecordList>> mapname = newMap<userid, list<ecRecordList>> 

mapname.put(user1, <{user1 12 4 06/12/2019}, {user1 13 13 06/13/2019},{user1 17 2 07/10/2019} )

mapname.put(user2, <{ user2 35 24 06/18/2019}, {user1 13 13 06/13/2019},{user1 17 2 07/10/2019} ) and so on.

then for each user, i want to loop through the list and calculate the totals. 
 

Here's snippet of my code for reference.  


public with sharing class MyController {

		public list<MyWrapper> wrapper {get;set;}
    	public integer appTotal {get;set;} 
    	public integer mtdappTotal {get;set;} 
    	public integer previousmonthappTotal {get;set;} 
    	public integer idlplusmtdTotal {get;set;}
    	public integer idlpluspreviousmonthTotal {get;set;}
    	public integer caTotal {get;set;}
    	public integer ecmtdTotal {get;set;}
    	public integer ecpreviousmonthTotal {get;set;}
    	public integer ecEligibleYesMTDTotal {get;set;}
    	public integer ecEligibleYesPreviosMonthTotal {get;set;}
    	public set<String> userid {get;set;}
		public Map<String,list<EcPerformanceRecordList>> ecperuserMap {get;set;}
    
    	
    	@AuraEnabled(cacheable=true)
		public void getdeserialize() {
		
			try{
                string jsonresponse = 'SOME STRING'
			   
			 	
                wrapper = (list<MyWrapper>) JSON.deserialize(jsonresponse, list<MyWrapper>.class);
			 	
                
                // call the method that aggregates the MonthToDate app count, and PreviousMonth app count per user 
                getTotalECBookedByUser(wrapper);
               
              
		     	
			} catch (Exception e){
				system.debug('Error---->' +  e.getLineNumber() + e.getMessage());
				
			}
    	}
    
    	
    
    // This method calclates the total EC Booked current month and previous month by each user 
    public integer getTotalECBookedByUser(list<MyWrapper> wrapper) {
        	     
        
		Map<String,list<EcPerformanceRecordList>> ecperuserMap = new Map<String,list<EcPerformanceRecordList>>();  
		for(MyWrapper jw: wrapper){
            
            jw.ecpreviousmonthTotal=0;
			jw.ecmtdTotal = 0;   
        	// create a map of submitUserID and ECSubmittedRecordList 
			Map<String,list<EcPerformanceRecordList>> ecperuserMap = new Map<String,list<EcPerformanceRecordList>>();  
        	 
        	for (MyWrapper.EcPerformanceRecordList ec : jw.ecPerformanceRecordList) {
            	
				if(ecperuserMap.containsKey(ec.submitUserID)){
				
					 ecperuserMap.get(ec.submitUserID).add(ec);

				}else {
				
					ecperuserMap.put(ec.submitUserID,ec);
				}
				          	  
            }
        }
		
		// loop through the map ecperuserMap and count the total apps submitted by each user this month and previous month 
		
		
        
        return ecpreviousmonthTotal;
        return ecmtdTotal;
	
    }
    
  
     
}




------------------------Wrapper Class ------------------


public class MyWrapper {
@AuraEnabled	
    public List<CaPerformanceRecordList> caPerformanceRecordList{get;set;}
    public List<EcPerformanceRecordList> ecPerformanceRecordList{get;set;}
    public Map<String,List<EcPerformanceRecordList>> ecPerUser {get;set;}
    public integer appTotal{get;set;}
    public integer mtdappTotal {get;set;} 
    public integer previousmonthappTotal {get;set;} 
    public integer idlplusmtdTotal {get;set;}
    public integer idlpluspreviousmonthTotal {get;set;}
    public integer caTotal {get;set;}
    public integer ecmtdTotal {get;set;}
    public integer ecpreviousmonthTotal {get;set;}
    public integer ecEligibleYesMTDTotal {get;set;}
    public integer ecEligibleYesPreviosMonthTotal {get;set;}
    public string name {get;set;}
    public integer data {get;set;}
    public integer data1 {get;set;}		// bar chart EC
    public string ecname {get;set;}  // bar chart EC 
    public integer ecdata {get;set;} // bar chart EC 
    public string ecname1 {get;set;}  // bar chart EC 
    public integer ecdata1 {get;set;} // bar chart EC 
    
     
   
	public class EcPerformanceRecordList {
		public String DealerID{get;set;}
		public String submitUserID{get;set;}
		public String bookedDate{get;set;}
		public String ecEligible{get;set;}
		public Integer caBookedCount{get;set;}
		public Integer ecBookedCount{get;set;}
       
        
	}
	
    
	public class CaPerformanceRecordList {
		public String DealerID{get;set;}
		public String dealerName{get;set;}
		public String reportingPeriod{get;set;}
		public String financeSourceIntegrationTypeCode{get;set;}
		public String idlPlus{get;set;}
		public String creditApplicationSourceCode{get;set;}
		public Integer submissionCount{get;set;}
    }
    

}

 
Why does my chart has month names on wedges but the sample example doesn't ? 

In my sandbox I  copied and pasted exact code from the salesforce documentation as shown here https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_charting_overview_simple_example.htm

Created a Apex Controller, Created a Wrapper Class, Created a VFP.
 
The output as shown in this example doesn't have month names on the wedges. However the output I get has month names on the wedges. This example doesn't uses rendererFn property. I am wondering why i see month names and the example shown does'nt?

This is my output 
User-added imageHowever I was expecting to see this 

User-added image

Here the Code exactly as copied from the documentation 
 
<apex:page controller="PieChartController" title="Pie Chart">
    <apex:chart height="350" width="450" data="{!pieData}">
        <apex:pieSeries dataField="data" labelField="name"/>
        <apex:legend position="right"/>
    </apex:chart>
</apex:page>



public class PieChartController {
    public List<PieWedgeData> getPieData() {
        List<PieWedgeData> data = new List<PieWedgeData>();
        data.add(new PieWedgeData('Jan', 30));
        data.add(new PieWedgeData('Feb', 15));
        data.add(new PieWedgeData('Mar', 10));
        data.add(new PieWedgeData('Apr', 20));
        data.add(new PieWedgeData('May', 20));
        data.add(new PieWedgeData('Jun', 5));
        return data;
    }

    // Wrapper class
    public class PieWedgeData {

        public String name { get; set; }
        public Integer data { get; set; }

        public PieWedgeData(String name, Integer data) {
            this.name = name;
            this.data = data;
        }
    }
}

 
I am trying to get the total count of all records in the list, and display it. Value not displaying . 
 
<apex:page controller="CASReportController">
<apex:form >
    <apex:pageBlock title="JSON Deserialized Response">
    <apex:pageBlockButtons >
        <apex:commandButton value="submit" action="{!deserialize}" reRender="DealerBlock"/>
    </apex:pageBlockButtons>
			
    <apex:pageBlockSection id="DealerBlock" columns="1" title="RollUp Summary >

    <apex:repeat value="{!wrapper}" var="cap1">
                    
    <apex:pageBlockTable value="{!cap1.caPerformanceRecordList}" var="cap" width="100%">

    <apex:column headerValue="Reporting Period" value="{!cap.reportingPeriod}"/>
                            
    <apex:column headerValue="FS Integration Type Code" value="{!cap.financeSourceIntegrationTypeCode}"/>
                            
    <apex:column headerValue="IDL Plus" value="{!cap.idlPlus}"/>
                            
    <apex:column headerValue="Credit Application Source Code" value="{!cap.creditApplicationSourceCode}"/>
                            
    <apex:column headerValue="Submission Count" value="{!cap.submissionCount}" />
                               

<!-- Generating CASubmissionCount total --> 

<apex:variable var="total" value="{!cap1.appTotal}" />		 							

<!--footer of the SubmissionCount -->
     <apex:facet name="footer">           									
          Total Count: <span class="t1"></span>   			   <!--  expecting Total Count = 7 --    submissionCount of one record is 2 and other record is 7 as seen in json string >							
     </apex:facet> 
                             
 </apex:pageBlockTable>
</apex:repeat>            
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

------------------------------------------------------------
public with sharing class CASReportController {
    
@AuraEnabled
    
public list<JSONWrapperController> wrapper {get;set;}

    public void deserialize() {

        try{
            string jsonresponse = '[{ "caPerformanceRecordList": [ {  "submissionCount": 2 }, {  "submissionCount": 5 } ], "ecPerformanceRecordList": [ {   } ] }]';

           
            wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, list<JSONWrapperController>.class);

            
        } catch (Exception e){
            system.debug('Error---->' +  e.getLineNumber() + e.getMessage());

        }
    }


---------------------------------------------

public class JSONWrapperController {

	public List < CaPerformanceRecordList > caPerformanceRecordList{get;set;}


	public class CaPerformanceRecordList {
	  public String motorDealerID{get;set;}
	  public String dealerName{get;set;}
	  public String reportingPeriod{get;set;}
      public String   financeSourceIntegrationTypeCode{get;set;}
	  public String idlPlus{get;set;}
	  public String creditApplicationSourceCode{get;set;}
	}
	
	@AuraEnabled
         public integer getTotalAppCount() {
              // loop through each element in the     caPerformanceRecordList, till the end of the list.
             // get grand total of submissionCount 
             // return grand total  
        
             integer appTotal = 0;
             for(CaPerformanceRecordList cp : caPerformanceRecordList) {
                 appTotal += cp.submissionCount;
              }
              return appTotal;
         }

}

 
Save error: Unknown property 'VisualforceArrayList.caPerformanceRecordList'	
 
I am trying to create a VFP to display a table  with values from a JSONWrapperController Class. 

<apex:page controller="CASReportController">
    <apex:form >
        <apex:pageBlock title="JSON Deserialized Response"> 
            <apex:pageBlockButtons >
                <apex:commandButton value="submit" action="{!deserialize}" reRender="dealerBlock"/>
            </apex:pageBlockButtons>
           
           
           	<apex:pageBlockSection id="DealerBlock" columns="1">
                 <apex:repeat value="{!wrapper.caPerformanceRecordList}" var="cap">
                    
                  <apex:pageBlockSection columns="2">
                   <apex:facet name="header">Dealer Name {!cap.dealerName}</apex:facet>
                         <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Dealer Id" for="dlrid" />
                            <apex:outputText value="{!cap.motorDealerID}" id="dlrid" />
                         </apex:pageBlockSectionItem>
                         <apex:pageBlockSectionItem >
                            <apex:outputLabel value="Reporting Date " for="rptdt" />
                            <apex:outputText value="{!cap.statementDate}" id="rptdt" />
                         </apex:pageBlockSectionItem>
                        </apex:pageBlockSection>
           
               
        		 </apex:repeat>
			</apex:pageBlockSection>                                                                                         
        </apex:pageBlock> 
    </apex:form>
</apex:page>


==================================

Related components for this visualforce page

This is a snapshot of the actual JSON Response from Endpoint as obtained from Postman: 

{
    "caPerformanceRecordList": [
        
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-05-18",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "STEONE",
            "submissionCount": 2
        },
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-06-27",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "STEONE",
            "submissionCount": 5
        }
    ],
    "ecPerformanceRecordList": [
        {
            "motorDealerID": "XL1HX",
            "submitUserID": "BCUSER1",
            "bookedDate": "2019-05-22 00:00:00.0",
            "ecEligible": "Y",
            "caBookedCount": 1,
            "ecBookedCount": 0
        },
        {
            "motorDealerID": "XL1HX",
            "submitUserID": "BCUSER1",
            "bookedDate": "2019-06-05 00:00:00.0",
            "ecEligible": "Y",
            "caBookedCount": 1,
            "ecBookedCount": 0
        }
    ]
}



=========================================================

public with sharing class CASReportController {
@AuraEnabled
		public list<JSONWrapperController> wrapper {get;set;}
		
		public void deserialize() {
		
			try{
				string jsonresponse = '[{ "caPerformanceRecordList": [ { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-05-18", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 2 }, { "motorDealerID": "XL1HX", "dealerName": "Subaru Auto Dealer", "reportingPeriod": "2019-06-27", "financeSourceIntegrationTypeCode": "FIFS", "idlPlus": "Y", "creditApplicationSourceCode": "STEONE", "submissionCount": 5 } ], "ecPerformanceRecordList": [ { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-05-22 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 }, { "motorDealerID": "XL1HX", "submitUserID": "BCUSER1", "bookedDate": "2019-06-05 00:00:00.0", "ecEligible": "Y", "caBookedCount": 1, "ecBookedCount": 0 } ] }]';
			  
			 	system.debug('json string is ' +jsonresponse);
			 	wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, list<JSONWrapperController>.class);
			 
		     	system.debug('This is the wrapper class: ' +wrapper);
			 } catch (Exception e){
				system.debug('Error---->' +  e.getLineNumber() + e.getMessage());
				
			}
       }
}

========================================

public class JSONWrapperController {

     public List<CaPerformanceRecordList> caPerformanceRecordList{get;set;}
     public List<EcPerformanceRecordList> ecPerformanceRecordList{get;set;}	
     
     public class EcPerformanceRecordList {
		public String motorDealerID{get;set;}
		public String submitUserID{get;set;}
		public String bookedDate{get;set;}
		public String ecEligible{get;set;}
		public Integer caBookedCount{get;set;}
		public Integer ecBookedCount{get;set;}
	}

	

	public class CaPerformanceRecordList {
		public String motorDealerID{get;set;}
		public String dealerName{get;set;}
		public String reportingPeriod{get;set;}
		public String financeSourceIntegrationTypeCode{get;set;}
		public String idlPlus{get;set;}
		public String creditApplicationSourceCode;
		{get;set;}public Integer submissionCount;
	}

	
	
}
As seen in debug logs , why is the string json on deserializing returning null ? 
 
{
    "caPerformanceRecordList": [
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-05-01",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "ECKNWNSPT",
            "submissionCount": 2
        },
        {
            "motorDealerID": "XL1HX",
            "dealerName": "Subaru Auto Dealer",
            "reportingPeriod": "2019-05-02",
            "financeSourceIntegrationTypeCode": "FIFS",
            "idlPlus": "Y",
            "creditApplicationSourceCode": "RTEONE",
            "submissionCount": 15
        }
    ]
}


public with sharing class CASReportController {

		public list<JSONWrapperController> wrapper {get;set;}

		public void deserialize() {
		
		string jsonresponse = '{"caPerformanceRecordList":[{"motorDealerID":"XL1HX","dealerName":"Subaru Auto Dealer","reportingPeriod":"2019-05-01","financeSourceIntegrationTypeCode":"FIFS","idlPlus":"Y","creditApplicationSourceCode":"ECKNWNSPT","submissionCount":2 },{"motorDealerID":"XL1HX", "dealerName":"Subaru Auto Dealer", "reportingPeriod":"2019-05-02","financeSourceIntegrationTypeCode":"FIFS","idlPlus":"Y","creditApplicationSourceCode":"RTEONE","submissionCount": 15 },{"motorDealerID": "XL1HX", "dealerName":"Subaru Auto Dealer","reportingPeriod":"2019-05-02","financeSourceIntegrationTypeCode":"FIFS","idlPlus":"Y","creditApplicationSourceCode":"RTEONE","submissionCount":14}]}';
		  
		 system.debug('json string is ' +jsonresponse);
		 wrapper = (list<JSONWrapperController>) JSON.deserialize(jsonresponse, lis<JSONWrapperController>.class);
        
        system.debug('This is the wrapper class: ' +wrapper);
	}
}



public class JSONWrapperController {
	
	    public class CaPerformanceRecordList {   
	    	
		public string dealerName {get; set;}
	        public String motorDealerId {get;set;}
	        public DateTime mtd {get; set;}
	        public Integer submissionCount{get;set;}
		public String idlPlus{get;set;}
		public String creditApplicationSourceCode{get;set;}
		    
    	}
	
	 public List<CaPerformanceRecordList> caperfreclist {get;set;} 
   
}


DEBUG|This is the wrapper class: JSONWrapperController:[caperfreclist=null]

 
Hi all,

I'm new to Apex but have been tasked with making one small change to an old Apex Class.
 
public with sharing class WorkDetailUtilities
{
    public static List<SVMXC__Service_Order_Line__c> AddWorkDetails(SVMXC__Service_Order__c WorkOrder, WorkDetailUtilities.FSGCart FSGCart, 
                                Id WorkDetailRTId, List<FSGItemWrapper> MissingCartItems, Id WorkDetailId) 
    {
        system.debug(LoggingLevel.INFO, 'WorkOrder: ' + WorkOrder + ', FSGCart: ' + FSGCart + ', WorkDetailRTId: ' + WorkDetailRTId + ', WorkDetailId: ' + WorkDetailId);
        List<SVMXC__Service_Order_Line__c> WorkOrderLines = new List<SVMXC__Service_Order_Line__c>();
        Map<String, WorkDetailUtilities.FSGItemWrapper> mapPartQuantity = new Map<String, WorkDetailUtilities.FSGItemWrapper>();
        String STDWorkshopHoursProductCode = Label.STD_Workshop_Hours_Product_Code;
        SVMXC__Service_Order_Line__c PSWorkDetail;
        
        try 
        {
            for(WorkDetailUtilities.FSGItemWrapper FSGCartItem :FSGCart.CartItems) 
            {
                system.debug(LoggingLevel.INFO, 'FSGCartItem: ' + FSGCartItem);
                if (FSGCartItem.Part != STDWorkshopHoursProductCode && !FSGCartItem.Part.contains('-'))
                {
                    mapPartQuantity.put('00-' + FSGCartItem.Part, FSGCartItem);
                }
                else
                {
                    mapPartQuantity.put(FSGCartItem.Part, FSGCartItem);
                }    
            }
            system.debug(LoggingLevel.INFO, 'mapPartQuantity: ' + mapPartQuantity);
            
            if (String.isNotBlank(WorkDetailId))
            {
                PSWorkDetail = [SELECT Id, SVMXC__Serial_Number__c, SVMX_Line_Branch_Code__c FROM SVMXC__Service_Order_Line__c WHERE Id =:WorkDetailId];
            }
            system.debug(LoggingLevel.INFO, 'PSWorkDetail: ' + PSWorkDetail);
            
            List<Product2> lstProducts = new List<Product2>([SELECT Id, ProductCode, Name,SVMX_Extra_Description__c,SVMXC__Product_Cost__c FROM Product2 WHERE ProductCode IN :mapPartQuantity.keySet() 
                        AND SMVX_Sales_Company__c =:WorkOrder.SVMXC__Company__r.SVMX_Sales_Company__c AND IsActive = true]);
            system.debug(LoggingLevel.INFO, 'lstProducts: ' + lstProducts);
The change should be (where marked in bold) that instead of '00-' being added it should take the value from the field prefix__c on the Product object. If I add that in instead like: 

mapPartQuantity.put(prefix__c + FSGCartItem.Part, FSGCartItem);

I get the error Error: Compile Error: Variable does not exist: prefix__c at line 19 column 41. 

I guess I need to add that field in somewhere before, but where?

Any help will be much appreciated.
I am trying to optimize my working code. When i tried to convert a set into a Map, I am getting an error -  
Line: 10, Column: 22
Method does not exist or incorrect signature: void add(Id, String) from the type Map<Id,String>

 
Map<ID, String>  mapAccountBillingAddress = new Map<ID, String>();
for (AggregateResult aggregate : [Select count(Id),BillingStreet str,BillingCity ct, BillingState stt, BillingPostalCode pc 
From Account                                                                Group By BillingStreet,BillingCity,BillingState,BillingPostalCode
HAVING (count(BillingStreet) > 1  AND count(BillingPostalCode) > 1 )
] )
{
mapAccountBillingAddress .add(aggregate.id, ((String)aggregate.get('str')+(String)aggregate.get('ct')+(String)aggregate.get('stt')+(String)aggregate.get('pc')));
	
   
}



 
How Can i get a list of Accounts that has the same BillingAddress? 

I tried this and got the error 'Line: 2, Column: 34
HAVING count(BillingAddress)>1 ^ ERROR at Row:5:Column:49 field BillingAddress does not support aggregate operator COUNT'


Set <String>SameBillingAddress = new Set<String>();
for (AggregateResult aggregate : [Select count(Id),BillingAddress
From Account 
Where BillingStreet!= null AND BillingState!=null AND BillingCity!= null AND BillingPostalCode!=Null
Group By BillingAddress
HAVING count(BillingAddress) > 1 
] )
{
    SameBillingAddress.add((String)aggregate.get('BillingAddress'));
}
for (Account acc : [
    SELECT Name, BillingAddress
    FROM Account
    WHERE BillingAddress IN :SameBillingAddress
]){
    system.debug(+ acc.BillingAddress);
What would be a best solution for this use case: 

If two Contacts have same FirstName, LastName and Email, and one of the Contact Record Custom_CheckBox__c = true, make it true for other record too. 

My appraoch : 
I was thinking, creating a Custom_Formula_Field__c returning text that is a concatenated string 'FirstNamelastNameEmail' 

Then in Developer Console, querying all Contact records that has  same value in Custom_Formula_Field__c

If one has Checkbox_-c = true, make the other record's Checkbox__c = true


Any suggestions?