• Ch Salman
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 11
    Replies
How to display stagename and other fields on maps using lwc.
Currently, i am displaying only opportunity name and marker on map using location (Address fields salesforce). But how to display stagename and other fields on maps). (or) any account fields.
Please advise.Image of opportunities displayed on maps with only address
Before I forget these were the exact steps I took to finally make it work.

CLEAN UP
  • Clean up your current installations:
  • Delete Folders .sf  and .sfdx and local installation
  • Uninstall all your previous versions of node and python
FRESH INSTALL (NODE, PYTHON, NODE-GYP)
  1. Make sure you have Python 3 installed
    1. During NPM Install of Plugin, it will look for a version of Python installed, else it will fail
  2. Install NodeJS LTS 18
    1. Install Node-Gyp using NPM Install command (NPM comes with NodeJS)
    2. Otherwise, the NPM installation of the Plugin will automatically install NODE-GYP for you
Install SF CLI
  • Install SF CLI using NPM!!!!!!  not the stupid Windows MSI Installer
    • https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_npm
    • NPM is a two step process
      • Install .sfdx
      • Install .sf
TEST SF CLI
  • After you have installed .sf and .sfdx  (This will get you the latest version)
  • AUTHENTICATE an ORG
  • Test it by connecting to your Sandbox
    • If you can't authenticate using standard web login try this
      • sfdx force:auth:device:login --instanceurl <your custom or test.salesforce.com> --setdefaultusername
      • This will display a user code within the cmd window
      • Enter that Code after  you open 
      • YOU MUST Enter the URL that you started with
      • https://<The URL You specified above>/setup/connect in a browser
Now here is the FUN
Several repeat steps were needed

Step1: sfdx plugins:install @salesforce/lwc-dev-server 
  • This will fail with that stupid YARN Error Message
Step2: npm install -g @salesforce/lwc-dev-server
  • This will properly install Node-Gyp for you
  • It will also pass the python check sinced you installed it at the very beginning
  • gyp info it worked if it ends with ok
    gyp info using node-gyp@9.3.1
    gyp info using node@18.16.0 | win32 | x64
    gyp info find Python using Python version 3.11.3 found at "C:\Python311\python.exe"
  • But it will Burp about not having Visual Studio
    • 7756 error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
      7756 error gyp ERR! find VS looking for Visual Studio 2015
      7756 error gyp ERR! find VS - not found
      7756 error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
      7756 error gyp ERR! find VS 
      7756 error gyp ERR! find VS **************************************************************
      7756 error gyp ERR! find VS You need to install the latest version of Visual Studio
      7756 error gyp ERR! find VS including the "Desktop development with C++" workload.
    • NO PROBLEM 
    • RUN npm install --global windows-build-tools
      •  This will also FAIL, but it downsloads the VS17 exe file for you
      • This is saved in
      • C:\Users\your name\.windows-build-tools\vs_BuildTools.exe
      • Install it and MAKE SURE YOU Select
      • VS including the "Desktop development with C++" workload.
Step3: RUN IT AGAIN npm install -g @salesforce/lwc-dev-server
  • This time it will detect Python and the Version of Visual Studio 17
  • It will load all the packages with no errors, but the plug in is still not installed
  • you will see something like this
  • added 1218 packages, and changed 1 package in 7m
    102 packages are looking for funding
  • I ALMOST QUIT AT THIS POINT
Step4: RUN IT AGAIN the SFDX command PLUGIN again
  • sfdx plugins:install @salesforce/lwc-dev-server 
  • GOSH DARN IT - IT FINALLY Installed
    • @salesforce/lwc-dev-server... \ [2/4] Fetching packages...
      warning "@salesforce/lwc-dev-server > @rollup/plugin-alias@3.1.9" has unmet peer dependency "rollup@^1.20.0||^2.0.0".
      warning "@salesforce/lwc-dev-server > request-promise-native@1.0.9" has unmet peer dependency "request@^2.34".
      warning "@salesforce/lwc-dev-server > request-promise-native > request-promise-core@1.1.4" has unmet peer dependency "reqInstalling plugin @salesforce/lwc-dev-server... installed v2.11.0

In Summary
Python 3
Nodejs 18 LTS
Visual Studio 17 and Desktop Build
Multiple Plug-in Install steps
(See my step by step above)

 

Anyways, I HOPE THIS IS Useful, because I scoured the internet for answers.  TRUST ME.  All the answers had some truth, but none worked for me.  UNTIL THIS DAY!!!!!

Hello,
I have a profile called PartnerPortal Profile in that profile i have some user in it. So whenever there partner user login to the portal, i want thenm to only see the case of specific record types.
RecordType like : "LVID Support" & "LVID Implementation".
I want thenm to see only these recordtype cases.
How can i achieve this? Thanks.
Quality education essay, how to write it, don’t lose your motivation during you are study at university

When you are student you want to show what you can do in the easiest way, because all academy papers are helpful for tour research and for passing exams in the end of semester or for the global test “For many students it".

How to make Youromena interesting for worldwide auditory, as a thesis diploma in economy, technology, psychology, literature, oveschool, diagnosis, specially the dissertation is most used when are making it for the college or for going to the professional classes, but not in short terms

As usual, everystudent has a personal life writemypaper.help (https://writemypaper.help/), for example, someone have a young kids’ home, another one have a family, for some people have a part-time job, so if you decide to manage with them, in the best way, you need to be comfortable and readable As we know, when a lot of information are tending to be reading on the web, if you have a not good knowledge it’s menace that you will have a hard time, for in this moment, somebody have a really bad Idea, or something terrible happened. This will be a discouraging forstudents and other peoples, which they cause a difficulties with their work and reproach, for example, there exists a think like a scam company, which wants to concentration just for the huge numbers of employers and promote their products for the customers of such companies. So, if You are trying to make your subject more unique and attractive, try to find the most attract to interesting in the shortest manner.

Often, students after having completed the basic requirements of the essays and began to practice in preparing and writing, They thinking that it’s not enough, after that, they have a harder exam for passed exams in the few months, But in general, When you will be become to doing your homework, it’s will be more easy, than you would first thought.

Very important to understand, that our lectures have a personal Jane in whose hand, you will receive for the reports, article, coursework and the likes of numerous others articles, It’s means, that you will be using her voice and storyline in the latest news, Sometimes it’s will be worth it. Because, in the long term, the less the quality education essay, the longer it will be, the higher the grades.

If you must to pass in your article for the popular type, it’s always called‘No plagiarism.’ Of Couse,t suits does your article have a real title, which usuallycifies to scientific director, meaning that he told about the uniqueness of your works, and henceforth it’s mean that in conclusion, yes, you have a normal book, with actual data, but in not in another way, it’s a high typical error of copying.
I have created a flow that is set to run in system mode (System context without sharing).
Based on the documentation, this is supposed to ignore all object permissions.

The flow I have built is meant to create a record of an object that certain profiles don't have the create permission for. I assumed that, if I run the flow in system context this wouldn't cause issues for these profiles. But it does. All profiles that don't have create permissions for that object get an error when they launch the flow. When I change the profile it works fine.

To me that sounds like the behavior of the flow is different from what the documentation describes.

Does anybody have an idea on how to handle that? I tried opening a case with SF but it is considered a development case which is not covered by our support package so I was advised to post the question here. 
The Certificate was uploaded and visible in the “Certificate and Key Management” section.    

Your support or any guidance is greatly appreciated.

Thank you!
User-added image
Error Message    System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
Stack Trace    Class.homeReport.getperformcallout: line 55, column 1
Class.homeReportTests.Myunittest1: line 33, column 1
@isTest(seeAllData = false)
public class homeReportTests
{
    public List<homeReportwrap> ConsoleWrapperList{get;set;}
  static testmethod void Myunittest1()
    {
      User a = new User();
       a.FirstName = 'rup';
       a.LastName  = 'ran';
       a.Email     = 'rup.ran@gmail.com';
       a.Username  = 'rup1.ran1@gmail.com';
       a.Alias     = 'rupran';
       a.ProfileId = '00e30000000mm8h';
       // Don't worry about these
       a.TimeZoneSidKey    = 'America/Denver';
       a.LocaleSidKey      = 'en_US';
       a.EmailEncodingKey  = 'UTF-8';
       a.LanguageLocaleKey = 'en_US';
       insert a;
       Account account = new Account();
       account.Name = 'Accc';
       insert account;   
       Contact contact = new Contact();
       contact.FirstName = 'rup';
       contact.LastName = 'ran';
       contact.AccountID = account.Id;
       contact.Email = 'rup.ran@gmail.com';
       contact.MobilePhone = '918527116725';
       insert contact;  
       homeReport cp = new homeReport(new ApexPages.StandardController(contact));
       Test.setMock(HttpCalloutMock.class, new homepagemock());
       homeReport testAObj = new homeReport();
       testAObj.getperformcallout();
      HttpResponse res = new HttpResponse();
  
    //String contentType = res.setHeader('Content-Type');
   // System.assert(contentType == 'application/json');
      String actualValue = res.getBody();
     String expectedValue = '{"foo":"bar"}';
     System.assertEquals(actualValue, expectedValue);
       System.assertEquals(200, res.getStatusCode());
       cp.getperformcallout(); 
        
    }
    
   
   
/*  static testMethod void fakeTest(){
  

     homeReport.fakeMethod();
   

     //repeat the same for the rest of classes.
  } */
  
 /*  static testMethod void fakeTest1(){
   
  } */
  
  
}

 
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!

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;
  }
}

 

 

Hai,

 

How do i make a tree view in apex and visualforce page.I am not able to expand and collapse the tree view,

please do help me,i need some guidance at the earliest.

 

Shine