• Mahesh Nirmal
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 10
    Replies

I have a visualforce page which has a pagination with Next and Previous buttons.

This button are only visible if records are more than 50. But the problem is that when I click on next button for 51th record it takes me to the top of the page. And then if I press next button again then it takes me to next page to see the records from 51 to 100.

So the bug is that very first click on next button takes me to the top of the vf page and after trying second time it takes me to next page.

The problem occurs only if the page length increases else it work fine.

Hi,
I am having an Big Object on which I am quering the record from it and inserting the record to Account object and once the data is inserted in account object I am deleting the data from Big Object.

During this process for DML I am getting the below Error-

EXCEPTION_THROWN [95]|System.UnexpectedException: A callout was unsuccessful because of pending uncommitted work related to a process, flow, or Apex operation. Commit or roll back the work, and then try again.

Please assist on this.
Thanks

I am having a public site and I am showing the image from the static resource on the lightning component.

But the image is not loading.

User-added imageNote: I have inserted a zip file in static resource and used that zip in the lightning component.

<img src="{! $Resource.testName + '/assets/icons/utility/'+ severity + '_60.png'}"/>

Can anyone help me out with this. To have an image loaded on the public site.

The scenario is-

I have an email reminder going out to user. I have implemented the email-to-salesforce functionality to Stored the Email on Contact Activity. Used the ref:{!contactId} reference field in template.

The bug is that the activities are getting stored twice on Contact.

SSThis issue is with only a specific Email template for Reminders. For other templates, it stores the email once.

Please suggest a way to fix it.

Thanks

Hi all,

I am facing the below error

Exception Details: Update failed. First exception on row 0 with id *************; first error: TEMPLATE_NOT_FOUND, The record couldn't be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support.: []

The scenario is that we have a WF Rule on the Invoice object which fires the Email Alert after Registration. The Invoice Template is a VF Page.
I researched for it and most of the folks suggest checking the permissions of the fields referenced in the Email template. I do that but still, I am getting the same error.

It's the second time I am facing this particular issue. The first time it was resolved by giving permission to a new field added on the Invoice object. But this time it happens suddenly without adding any new field.

Please suggest a way to resolve it
Thanks.

Hello all,

I'm trying to get the Day of Week in the Flow.

Let's say I got today's date (15th Feb 2021) and on that basis, I need the Day of the week i.e Monday.

So, is it possible in Flow?

I have two List

List<String> filteredValues = New List<String>();
List<Contract__c> valuesForfilteredValues = something query.

And I have to add them to a map

Map<String, String> detailsMap;

How should I do that.

Scenario.
Let's Say-

The first list has values (Name, City, State);
Second List has values (TestName, Mumbai, MH);
I have to perform dynamically as-

detailsMap.put(Name , TestName);
detailsMap.put(City , Mumbai);
detailsMap.put(State , MH);

Please suggest a way to do this.

I am getting the System.LimitException: Too many SOQL queries: 101 error for the test class. Is there any way to skip this exception in test class??

Hi all, I am having an Approval matrix in which I consist of the Approver list as per the venue and sponsorship combination on the opportunity.

When I created an opportunity and submit for approval, the approvers who are the users of the salesforce, the first approver get the mail to approve the opportunity but when the 1st approver approvers the opportunity the second approver should get the mail to approve the same opportunity but it is not working. Only the first approver gets the email to approve the opportunity. I have checked the deliverability setting and it is set to "all emails".

Please help me out with this issue

Hi all,

I am having one field "Source_IP_Address" which is storing the IP address of the user who register for any Event through community portal.
After every Registration an Invoice mail is sent to the user. I want to show the "Source_IP_Address" Field on that email template, But when the invoice is send the field value is not visible on Invoice template. It is showing blank.
When we send a preview from "Send and Test Merge field" from classic email template the field value for "Source IP Address" is Visible.
I have check all permissions for the fields. 
Please suggest any other way ???

Hi,
I am having an Big Object on which I am quering the record from it and inserting the record to Account object and once the data is inserted in account object I am deleting the data from Big Object.

During this process for DML I am getting the below Error-

EXCEPTION_THROWN [95]|System.UnexpectedException: A callout was unsuccessful because of pending uncommitted work related to a process, flow, or Apex operation. Commit or roll back the work, and then try again.

Please assist on this.
Thanks

I am having a public site and I am showing the image from the static resource on the lightning component.

But the image is not loading.

User-added imageNote: I have inserted a zip file in static resource and used that zip in the lightning component.

<img src="{! $Resource.testName + '/assets/icons/utility/'+ severity + '_60.png'}"/>

Can anyone help me out with this. To have an image loaded on the public site.

The scenario is-

I have an email reminder going out to user. I have implemented the email-to-salesforce functionality to Stored the Email on Contact Activity. Used the ref:{!contactId} reference field in template.

The bug is that the activities are getting stored twice on Contact.

SSThis issue is with only a specific Email template for Reminders. For other templates, it stores the email once.

Please suggest a way to fix it.

Thanks

Hi all,

I am facing the below error

Exception Details: Update failed. First exception on row 0 with id *************; first error: TEMPLATE_NOT_FOUND, The record couldn't be saved because it triggered an email alert that failed. Please contact salesforce.com Customer Support.: []

The scenario is that we have a WF Rule on the Invoice object which fires the Email Alert after Registration. The Invoice Template is a VF Page.
I researched for it and most of the folks suggest checking the permissions of the fields referenced in the Email template. I do that but still, I am getting the same error.

It's the second time I am facing this particular issue. The first time it was resolved by giving permission to a new field added on the Invoice object. But this time it happens suddenly without adding any new field.

Please suggest a way to resolve it
Thanks.

In VS code all the components of an LWC is getting created in another folder like HTML is in s separate folder and js is in another folder. Anyone else id also facing the same. Due to this I am not able to deploy lwc changes to org.
Image for the folder structure of lwc.
LWC folder structure

Any help will be appreciated. 

Hi all, I am having an Approval matrix in which I consist of the Approver list as per the venue and sponsorship combination on the opportunity.

When I created an opportunity and submit for approval, the approvers who are the users of the salesforce, the first approver get the mail to approve the opportunity but when the 1st approver approvers the opportunity the second approver should get the mail to approve the same opportunity but it is not working. Only the first approver gets the email to approve the opportunity. I have checked the deliverability setting and it is set to "all emails".

Please help me out with this issue

Hi All,
     I have a simple apex method used in ligthing lookup to search name and phone fields.
apex method:
   @AuraEnabled  
     public static List<sObject> getRecordList(String objName,String searchText,String fieldInSearch,String phone){
        string searchKey = '%' + searchText + '%';
        string Query =' select ' +fieldInSearch+ ',' +phone;
        Query+=' from '+objName;
        Query+=' where '+fieldInSearch+ ' like  \''+searchKey+'\' LIMIT 5';
            system.debug('Query == >> '+Query);
        List<sObject> sObjectList = Database.query(Query);
        system.debug(' #### sobjectList ' + sObjectList);
        return sObjectList;
    }
Test class :
 @isTest static void searchAcc(){
        String searchText = 'test';
        string field = 'name';
        string obj = 'Account';
        string phone='12345';
        List<account> a = apexHandler.getRecordList(obj,searchText,field,phone);
        system.debug('Account'+a);
        system.assertEquals(1, a.size());
    }
when i run the test the method gets failed and showing error System.QueryException: unexpected token: '12345' and at line no Database.query(Query) from apex method.
I gone through different solutions but unable to resolve, could any one help me with this to resolve and run test method succesfully.
Hello Gurus,

I faced the following exception when I am closing a case. The behaviour with the rest of the cases is normal. Something is missing with this, which I am not able to identify. FYR, I providing the code and the exception. Please help me understand.

Exception/Error:
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger Email2CaseSharing caused an unexpected exception, contact your administrator: Email2CaseSharing: execution of BeforeUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Email2CaseSharing: line 30, column 1




Code:
trigger Email2CaseSharing on Case (before insert, before update, after insert, after update) {
  
  Set<Id> contactIds = new Set<Id>();
    
    for(Case c : Trigger.new) {
        
        if(c.Origin != null && c.Origin == 'Email' && c.ContactId != null) {
            contactIds.add(c.ContactId);
        }
    }
    
    if(!contactIds.isEmpty()) {
      Map<String, String> contactEmails = new Map<String, String>();
      Map<String, User> emails = new Map<String, User>();
        for(Contact c : [SELECT Id, Email FROM Contact WHERE Id IN :contactIds]) {
            contactEmails.put(c.Id, c.Email);
            emails.put(c.Email, null);
        }
        for(User u : [SELECT Id, Email FROM User WHERE Email IN :emails.keySet()]) {
            emails.put(u.Email, u);
        }
        
        List<CaseShare> shares = new List<CaseShare>();
        
        for(Case c : Trigger.new) {
        
            if(c.Origin != null && c.Origin == 'Email' && c.ContactId != null) {
                
                Id uid = emails.get(contactEmails.get(c.ContactId)).Id;
                
                if(Trigger.isBefore) {
                  c.Submitter__c = uid;
                } else {
                  CaseShare cs = new CaseShare(
                    CaseId = c.Id,
                      UserOrGroupId = uid,
                      CaseAccessLevel = 'Read'
                  );
                  shares.add(cs);
                }
            }
        }
        
        try {
          if(!shares.isEmpty()) {
              insert shares;
          }
        } catch(Exception e) {
          System.debug(e.getStacktraceString());
        }
    }
}

 
|FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object

I'm getting the above error in this piece of code
//Returns the Rating Release date or the 'rating pending'
        IF (Today < currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = 'Rating Pending';
        } else IF(Today > currentQRpCase.Rating_Externally_Visible_Date__c){
            RatingRelease = currentQRpCase.Rating_Externally_Visible_Date__c.format();
        } else {
            RatingRelease = '';
        }

On my test record, Rating_Externally_Visible_Date__c is not null.
 
Help troubleshooting!
i am getting error "System.QueryException: List has no rows for assignment to SObject"  in 

List<Account> ac = [SELECT Id,Name,(SELECT LastName FROM Contacts) FROM Account WHERE Name = 'Acme'];
List<Contact> con = new List<Contact>();
for(Account a : ac){    
     System.debug(a.Contacts);
    if(a.Contacts == null){
        System.debug('null');
    }
    else{
        con.add(a.Contacts);
    }
}

 plz tell me how i can fill null value in my con list