• Martinez
  • NEWBIE
  • 55 Points
  • Member since 2023

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 12
    Replies
When I go into a Salesforce object, the list view is sorted in ascending order. I want to fix the list view in descending order when I enter the object. Is there a way to do that?
Hello,

I have a requirement to add few texts on home page
Is there any solution so that a users can add few elements on an object and I could add it to homepage, please
 
  • May 16, 2023
  • Like
  • 0
Certainly! Here's a shorter version of the content that covers all the important points:
There are various environmental considerations and sustainable options for custom packaging:
1) Recycled materials: Use packaging made from recycled paper, cardboard, and plastic.
2) Biodegradable and compostable materials: Opt for packaging that can break down naturally without harm, such as plant-based materials.
3) Sustainable sourcing: Choose packaging materials from responsibly managed forests or certified suppliers.
4) Minimalist design: Simplify packaging to reduce material usage and waste.
5) Reusable packaging: Implement sturdy containers or refillable pouches to encourage reuse.
6) Lighter and more efficient packaging: Use lighter materials and optimize the design for reduced transportation emissions.
7) Eco-friendly printing and inks: Select water-based or soy-based inks to reduce pollution.
8) Lifecycle analysis: Evaluate the environmental impact of packaging throughout its lifecycle.
Considering these options helps businesses reduce their carbon footprint, minimize waste, and contribute to a more eco-friendly future.

I'm currently having some trouble deploying my code to my org. The current package I'm working on has a dependent package "BASE_PACKAGE". I was trying to use Custom Labels, the problem is if there's any overlap in the custom labels it causes issues when trying to install.

However, if I try to use the base packages custom labels, if I try to use the namespace when importing in the LWC like,

import MANUFACTURER from '@salesforce/label/BASE_PACKAGE.MANUFACTURER';

I get this error message

Error integration LWC1504: Invalid module id "BASE_PACKAGE.MANUFACTURER" for type "label". Explicit use of namespace "BASE_PACKAGE" in file "customLabels.js" is prohibited. 

When I try to replace it with 

import MANUFACTURER from '@salesforce/label/c.MANUFACTURER';
I'm able to deploy to my scratch org, but when I try to deploy the packaged code, I get this error message instead

Invalid reference c.MANUFACTURER of type label in file customLabels.js 

I'm not sure if I'm missing a setting, or if there's something I'm missing.
When I go into a Salesforce object, the list view is sorted in ascending order. I want to fix the list view in descending order when I enter the object. Is there a way to do that?
Hi,
I am making use of the custom data table to create a data table and then to provide the inline editing feature for picklists.
I have created a LWC component and added 2 such custom datatables there one below another.
When I am selecting a picklist value in table 1 and am moving out of the cell, the Cancel and Save buttons are visible in both the datatables.
What's the cause of it and how can we fix it?
Screenshots have been attached for your reference.
1_Before : Initial state of the 2 custom data tables
2_After : Final state of the custom data tables after updated the value of "Target Priority" for a record.

Before Save :
User-added image
After Save :
User-added image

Thanks and Regards,
Sudhanshu






 
Hello All,  
​​​​​​​How can we track formula fields in salesforce lightning .

I want to create a schedule batch that will take records from multiple Objects and update a field. The objects for which the batch will run are specified in custom metadata.

I've considered using an Iterable batch, but using that approach would require looping over the custom metadata records and querying for the records of each object. However, running a query inside a loop would exceed governor limits.

Does using an Iterable batch limit the number of records compared to using a database.queryLocator? The database.queryLocator approach allows processing up to 50 million records. What are the limitations with the Iterable approach?

Do you have any other suggestion?

  • May 18, 2023
  • Like
  • 0
Hello,

I have a requirement to add few texts on home page
Is there any solution so that a users can add few elements on an object and I could add it to homepage, please
 
  • May 16, 2023
  • Like
  • 0

Hi

A couple of days ago I started Salesforce Certified Exam, answered 1 question, and then it was paused. The image on the screen said: 'Please wait for our specialist to connect with you as soon as possible'. 20 minutes past nothing happened.
I connected to Kryterion Support, they answered me that no able to reschedule or cancel an exam and I should open a case in Salesforce Support.
SF Support has not been answered for a couple of days.
The exam still suspended now.

Does anyone has a suspended issue or know some solution?

Hello Friends,
I have this  below code.
<apex:page standardController="Account">
    {! Account.Name }
    {! Account.Phone}
</apex:page>
I can comment the code by standard way (" <!-- This is commented part --> ") which I can do with few clicks.

Is there a way using the keyboard shortcut to do so? MS Visual Studio has it. May be the Eclipse too, although not sure.

Please help, thanks!

I'm working with the Force.com Integration Workbook.  Everything is fine until I get to Tutorial #3! 

 

The workbook talks about setting up Remote Access; however Remote Access is no longer available and you're redirected back to App | Connected Apps.  At this point the workbook doesn't match the latest version of Salesforce (Summer 13).

 

Additionally, in Tutorial 3, Step 2, I cannot get the OAuth to work!  I get the error:

 

HTTP Status 401: Authentication Failed: OAuth login invalid or expired access token

 

I've set this up twice and I'm following the steps "exactly" as they are laid out in the workbook.  Was wondering if anyone else has come across this and if I'm simply missing something.  I'm pretty new to the coding side of SFDC; so I'm working through these workbooks to try and get a better understanding!

 

Thank you!

 

Thinking of enabling #Communities for your customer? Then be aware of the current #Gotcha that the default Apex Classes that are created when you enable your first Community do not ALL have code coverage >75%.

What this means:
You can enable Communities in Production, however as soon as you attempt to migrate anything from a sandbox into Production that triggers all tests to be run (doesn't have to be just code), your migration will fail as three of the classes only have 33%, 20% and 21%.

Let me repeat that, you might only be migrating a bunch of new custom fields and page layouts and the Change Set (or Eclipse/ANT) will fail.

I hit this problem this week in a go-live deployment so had to update Apex Classes to achieve average total code coverage >75% in order to proceed with our deployment.

The PM of Communities knows about the problem and advises he is looking at a fix, but in the meantime here are the four Apex Classes that need to be updated.

 

CommunitiesLandingControllerTest.cls

Just a one liner for this test class

/**
 * An apex page controller that takes the user to the right start page based on credentials or lack thereof
 */
@IsTest public with sharing class CommunitiesLandingControllerTest {
  @IsTest(SeeAllData=true) public static void testCommunitiesLandingController() {
    // Instantiate a new controller with all parameters in the page
    CommunitiesLandingController controller = new CommunitiesLandingController();

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    PageReference pageRef = controller.forwardToStartPage();
  }
}

 

CommunitiesLoginControllerTest.cls

Just a one liner for this test class

/**
 * An apex page controller that exposes the site login functionality
 */
@IsTest global with sharing class CommunitiesLoginControllerTest {
  @IsTest(SeeAllData=true) 
  global static void testCommunitiesLoginController () {
    CommunitiesLoginController controller = new CommunitiesLoginController ();

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    PageReference pageRef = controller.forwardToAuthPage();
  }  
}

 

CommunitiesSelfRegControllerTest.cls

A few controller variables to set prior to calling the controller method for the original test method, followed by a couple of additional test methods for further coverage.

/**
 * An apex page controller that supports self registration of users in communities that allow self registration
 */
@IsTest public with sharing class CommunitiesSelfRegControllerTest {
  @IsTest(SeeAllData=true) 
  public static void testCommunitiesSelfRegController() {
    CommunitiesSelfRegController controller = new CommunitiesSelfRegController();

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    controller.firstName = 'Bob';
    controller.lastName = 'Jones';
    controller.email = 'bob@jones.com';
    controller.password = '8yhMsHDN&ituQgO$WO';
    controller.confirmPassword = '8yhMsHDN&ituQgO$WO';
    controller.communityNickname = 'bob-jones-testing';

    PageReference pageRef = controller.registerUser();
  }
  // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
  @IsTest(SeeAllData=true) 
  public static void testInvalidPassword() {
    CommunitiesSelfRegController controller = new CommunitiesSelfRegController();
    controller.firstName = 'Bob';
    controller.lastName = 'Jones';
    controller.email = 'bob@jones.com';
    controller.password = '8yhMsHDN&ituQgO$WO';
    controller.confirmPassword = 'not the same';
    controller.communityNickname = 'bob-jones-testing';

    PageReference pageRef = controller.registerUser();
    System.assert(pageRef == null, 'The returned page reference should be null');
  }
  // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
  @IsTest(SeeAllData=true) 
  public static void testNullPassword() {
    CommunitiesSelfRegController controller = new CommunitiesSelfRegController();
    controller.firstName = 'Bob';
    controller.lastName = 'Jones';
    controller.email = 'bob@jones.com';
    controller.communityNickname = 'bob-jones-testing';

    PageReference pageRef = controller.registerUser();
    System.assert(pageRef == null, 'The returned page reference should be null');
  }
}

 

CommunitiesSelfRegController.cls

A few additions to this class to set the Profile and Account Ids for portal user creation. Update the ProfileId value based on the "portal" license(s) (e.g., Customer Portal, Customer Community, etc) and set the AccountId to that of the Account you wish to use for self-registration. Note: this needs to be set even if you're not using self-registration so the class can be tested.

Plus some debug statements so I could see what was happening and needed to be tested.

/**
 * An apex page controller that supports self registration of users in communities that allow self registration
 */
public with sharing class CommunitiesSelfRegController {

  public String firstName {get; set;}
  public String lastName {get; set;}
  public String email {get; set;}
  public String password {get; set {password = value == null ? value : value.trim(); } }
  public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } }
  public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } }
  
  public CommunitiesSelfRegController() {}
  
  private boolean isValidPassword() {
    return password == confirmPassword;
  }

  public PageReference registerUser() {
  
    // it's okay if password is null - we'll send the user a random password in that case
    if (!isValidPassword()) {
      System.debug(System.LoggingLevel.DEBUG, '## DEBUG: Password is invalid - returning null');
      ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match);
      ApexPages.addMessage(msg);
      return null;
    }  

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    //String profileId = ''; // To be filled in by customer.
    //String roleEnum = ''; // To be filled in by customer.
    //String accountId = ''; // To be filled in by customer.

    // Set this to your main Communities Profile API Name
    String profileApiName = 'PowerCustomerSuccess';
    String profileId = [SELECT Id FROM Profile WHERE UserType = :profileApiName LIMIT 1].Id;
    List<Account> accounts = [SELECT Id FROM Account LIMIT 1];
    System.assert(!accounts.isEmpty(), 'There must be at least one account in this environment!');
    String accountId = accounts[0].Id;
    
    String userName = email;

    User u = new User();
    u.Username = userName;
    u.Email = email;
    u.FirstName = firstName;
    u.LastName = lastName;
    u.CommunityNickname = communityNickname;
    u.ProfileId = profileId;
    
    String userId = Site.createPortalUser(u, accountId, password);
   
    if (userId != null) { 
      if (password != null && password.length() > 1) {
        System.debug(System.LoggingLevel.DEBUG, '## DEBUG: User creation successful and password ok - returning site.login');
        return Site.login(userName, password, null);
      }
      else {
        System.debug(System.LoggingLevel.DEBUG, '## DEBUG: User creation successful but password not ok - redirecting to self reg confirmation');
        PageReference page = System.Page.CommunitiesSelfRegConfirm;
        page.setRedirect(true);
        return page;
      }
    }
    System.debug(System.LoggingLevel.DEBUG, '## DEBUG: User creation not successful - returning null');
    return null;
  }
}

 

 

Hello,

 

We have some custom settings defined in our development org.

We create managed package from this org in which custom settings are included

 

But the problem is , when we install this package to some other 

org these custom settings are not getting installed.

 

Means from our new org in which we have installed the package, we can not see

custom settings from Setup -->Develop-->Custom settings.

 

Any help on this please....!!!!!!

Thanks in anticipation