• Pradeepgore
  • NEWBIE
  • 90 Points
  • Member since 2017

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 11
    Replies

We have a nightly queueable job that runs on the Contact object that does ranking.  All the process does is update 1 field, possibly on up to 12,000 contacts.  No extra processing needs to occur since this field isn't used for anything else (read-only, info only).  We are running into CPU limits because of all the normal processing in the Trigger.  I have decided to exit the trigger if it detects if that field has changed (the batch job is the only thing that can change it).  I've got this working and wanted to know if the below was the best way to do this:

trigger MasterContactTrigger on Contact (
    before insert, after insert, 
    before update, after update) {

   if (Trigger.isUpdate) {
      for(Contact cont : Trigger.new) {
         Contact oldContact = Trigger.oldMap.get(cont.Id);
         if (cont.field__c != oldContact.field__c) return;
      }
   }

...........
Hello guys,
I'm trying to find out if there's a way to remove a certain number of characters from a string.
Challenge is, let's say we have string str = 'I get 7 hours of sleep'. I want to remove 'I get x' meaning that I want to remove 'I get' ( which will always be 'I get' ) and another 2 characters ( whatever they are, including the space between ).
I'm trying to do this with:
str.removeStartIgnoreCase('I GET '); - but can't find a way to tell the code about the next 2 characters, which I want removed from str.
Does this make sense?
I am rendering the boolean value to the Outputfield, which displays as a checkbox (checked or not checked). But I need to increase the size of the checkbox for visibility
I tried below code,  with and without style attribute inside the Outputfield.
​<apex:column
<span style="height: 40px !important; width: 40px !important;">
<apex:outputField value="{!a.aAttendee.evt__Attended__c}" style="height: 40px !important; width: 40px !important;" />
</span>
                            
 </apex:column>

But still the checkbox display as a default size of 21 X 16.

User-added image
Can anyone help me to increase the size of the checkbox ?

Thanks,
Kiruba

Is it possible for the Email-to-Case functionality to recognise the Country of the originating Email by IP Address?

When Email-to-Case creates a Case, we would like to automatically update the Country (custom picklist) field on case object based on IP address. or if any other way to do it I please let me know.

Any thoughts would be greatly appreciated.
 

Thanks!

We have a nightly queueable job that runs on the Contact object that does ranking.  All the process does is update 1 field, possibly on up to 12,000 contacts.  No extra processing needs to occur since this field isn't used for anything else (read-only, info only).  We are running into CPU limits because of all the normal processing in the Trigger.  I have decided to exit the trigger if it detects if that field has changed (the batch job is the only thing that can change it).  I've got this working and wanted to know if the below was the best way to do this:

trigger MasterContactTrigger on Contact (
    before insert, after insert, 
    before update, after update) {

   if (Trigger.isUpdate) {
      for(Contact cont : Trigger.new) {
         Contact oldContact = Trigger.oldMap.get(cont.Id);
         if (cont.field__c != oldContact.field__c) return;
      }
   }

...........
We are using a text field in apex, validation rules, flows etc.  Typically checking whether one value is contained in the text field.  Recently we had a requirement to go over the 255 character limit of a text field.  I had the idea to replace it with a series of text fields and then hide that by always referencing a formula field the combines them.  So this all *seems* to be working but my gut tells me I'm going to hit a brick wall somewhere, seems too good to be true :).  Does anyone know a restriction on this approach?
I am inserting new record using apex code. My code is correct. But whenever I check this new record in my org by clicking on Account tab the record is not displaying. Can you help me. I inserted the record using VF and clicked on Account tab . There is no new record only old accounts are there. why this happening.
public class YB_RCUReportVFController {
    
     public Id caseId;
     public YB_RCUReportWrapper rcuReportData{get;set;}
    
      public YB_RCUReportVFController()
    {
        this.caseId = Apexpages.currentpage().getparameters().get('id');
        this.rcuReportData = new YB_RCUReportWrapper(this.caseId);
        
        
    }

}

Hi, 

I would like to know that how can we search based on a custom field which we get as a parameter in a method.

For example if I create a custom field Mobilephone for the standard object Account, then how can I search this custom field Mobilephone? 

String phone_number = '1';
String param = 'MobilePhone__c';
Account[] a = [select Name, Id, phone, :param from Account where param =: phone_number];

Both the search field and value to be searched have to be used from the variable.

If you know, please help me with this.

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
Hi all,
I have a scheduled flow which will delete records from a custom object if one of the checkbox is false. This object shares master detail relationship with opportunity. 

But for some records, I get the error UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record or 1 records when the flow attempts to delete the reecord, Any suggestion on how we can fix this?
Thanks,
Adarsh
Hello guys,
I'm trying to find out if there's a way to remove a certain number of characters from a string.
Challenge is, let's say we have string str = 'I get 7 hours of sleep'. I want to remove 'I get x' meaning that I want to remove 'I get' ( which will always be 'I get' ) and another 2 characters ( whatever they are, including the space between ).
I'm trying to do this with:
str.removeStartIgnoreCase('I GET '); - but can't find a way to tell the code about the next 2 characters, which I want removed from str.
Does this make sense?
I am rendering the boolean value to the Outputfield, which displays as a checkbox (checked or not checked). But I need to increase the size of the checkbox for visibility
I tried below code,  with and without style attribute inside the Outputfield.
​<apex:column
<span style="height: 40px !important; width: 40px !important;">
<apex:outputField value="{!a.aAttendee.evt__Attended__c}" style="height: 40px !important; width: 40px !important;" />
</span>
                            
 </apex:column>

But still the checkbox display as a default size of 21 X 16.

User-added image
Can anyone help me to increase the size of the checkbox ?

Thanks,
Kiruba
public class YB_RCUReportVFController {
    
     public Id caseId;
     public YB_RCUReportWrapper rcuReportData{get;set;}
    
      public YB_RCUReportVFController()
    {
        this.caseId = Apexpages.currentpage().getparameters().get('id');
        this.rcuReportData = new YB_RCUReportWrapper(this.caseId);
        
        
    }

}

Hi, 

I would like to know that how can we search based on a custom field which we get as a parameter in a method.

For example if I create a custom field Mobilephone for the standard object Account, then how can I search this custom field Mobilephone? 

String phone_number = '1';
String param = 'MobilePhone__c';
Account[] a = [select Name, Id, phone, :param from Account where param =: phone_number];

Both the search field and value to be searched have to be used from the variable.

If you know, please help me with this.

Thanks.