+ Start a Discussion
Manisha ValavalaManisha Valavala 
Hi ,

I am not able to browse third party url in lightning component as it shows below error 

"The domain is not set in 'CSP trusted sites whitelist'

But I have added the third party url in CSP , please assist
Best Answer chosen by Manisha Valavala
SwethaSwetha (Salesforce Developers) 
HI Manisha,
Ensure that you have  added the URL to CSP Errors whitelist using a wildcard like this: https://*.forcecontentuser.com

Also there is a known issue with the lightning:map usage which is worth checking: https://trailblazer.salesforce.com/issues_view?id=a1p3A000001FSlqQAG

If this information helps, please mark the answer as best. Thank you
test vijaytest vijay 
hi developers,
@future (callout=true)
    Public static void sendHTTPRequest(String url, String body){
        
        Http http = new Http();
        HttpResponse res = new HttpResponse();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setBody(body);
        req.setMethod('POST');
        
        try {
            res = http.send(req);
        } catch(System.CalloutException e) {
            System.debug('CalloutException: '+ e);
            System.debug(res.toString());
        }
 }
above is my future callout method. I am trying to cover this method but error is coming : Methods defined as TestMethod do not support Web service callouts. 
following is my test class.

@isTest
public class colloutTest {
@isTest
    public static void testAccTriHandler(){
        test.startTest();
       string key = 'https://orgBaseUrl.salesforce.com/identity/connect/token';
       string body = '{"name" : 'dummy'}';  
  AccountCustomerNumber.sendHTTPRequest(key, body);
        test.stopTest(); 
    }
  
}
can somebody guide me that how to fix this problam.
Thanks in advance
Best Answer chosen by test vijay
ShivankurShivankur (Salesforce Developers) 
Hi Vijay,

You should implement HttpCalloutMock class when testing with Web servoce callouts in Apex.

Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_wsdl2apex_testing.htm

Please modify your test class in following manner:
@isTest 
private class Test_class {

    private class RestMock implements HttpCalloutMock {
        
        public HTTPResponse respond(HTTPRequest req) {
            String fullJson = 'your Json Response';
            
            HTTPResponse res = new HTTPResponse();
            res.setHeader('Content-Type', 'text/json');
            res.setBody(fullJson);
            res.setStatusCode(200);
            return res;
        }
    }
    static testMethod void service_call() {
        
        Test.setMock(HttpCalloutMock.class, new RestMock());
        Test.startTest();
        //your webserive call code
        Test.StopTest();
    }
}
Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
 
Ankit Arora 30Ankit Arora 30 
Hi Everyone,

I need some help. I have recently turned on the domain in the Sandbox. I have uploaded the logo and set the URL for the banner. When I go to the Salesforce login page using the domain URL, everything looks great but when I log in and log out from Salesforce, I don't see my company's Logo anymore.

Logo Dimensions:
Width: 180 px
Height: 113 px
Size: 9.32 KB

LOGO:
Login Salesforce with Logo

NO LOGO:

Login Screen Without Logo

Regards,
Ankit
Best Answer chosen by Ankit Arora 30
ANUTEJANUTEJ (Salesforce Developers) 
Hi Ankit,

>> https://trailblazers.salesforce.com/answers?id=9064S000000CnYWQA0

In the above link there is a similar issue where it is showing a broken image in login screen.

Can you try checking the below answer that is selected as best answer in above link once?
 
One troubleshooting effort I would undertake is to clear your browser cache - or try another browser you haven't used yet. This will help rule out the browser as a cultprit. Salesforce loves to cache data.

Clear Chrome Browser Cache (https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en)
Clear Firefox Broswer Cache (https://support.mozilla.org/en-US/kb/how-clear-firefox-cache)

Then, I would jump to the Brand Asset Files
https://help.salesforce.com/articleView?id=files_asset_files_edit_view.htm

Make sure your logo file is there.

User-added image

Then, click on the logo. Once you get to the next page - click view. This will take you to the record page to see if the image is showing there. 


Image in above link:

User-added image

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Samir Mahtani 4Samir Mahtani 4 
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:pc_rollup: execution of AfterUpdate

caused by: System.NullPointerException: Attempt to de-reference a null object

():--

It happens when an integration tried to run a background job. Some of the accounts it is updating do sync but the ones that fail have this error. 
Best Answer chosen by Samir Mahtani 4
ShivankurShivankur (Salesforce Developers) 
Hi Samir,

This error is caused by a line of code that is trying to use an object that has not been instantiated, or an object's attribute that has not been initialized.

If the field Site was left empty, it will generate the error message as(System.NullPointerException: Attempt to de-reference a null object) shown by the operation performed with the Integration done.

In order to avoid such issues, you should write try-catch blocks in your apex code and check if any of the fields which are required to be not null to succeed the operation. The exception can be smoothly handled with this technique.Also, additional logic checks in the code could avoid the records which are not eligible for update(which don't have the required fields) as well.

Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_exception_trycatch_example.htm

The catch block handles the raised exception. Then the finally block executes. It writes a debug message and closes the stream writer, which frees any associated resources.

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
Priya9Priya9 
Hi,

Given there are two fields A and B.
We can only enter values in field A only if field B is empty. 
What validation rule should I write for this?  
Best Answer chosen by Priya9
Priya9Priya9
Hi ANUTEJ,

Thank you for answering my question, but somehow that validation rule didn't work. Although I tried another one and it worked for me. 

( IF(ISBLANK(Field_A__c),0,1) + IF(ISBLANK(Field_B__c),0,1) ) > 1

Thanks!
Jonathan Wolff 7Jonathan Wolff 7 
Hi, 
I wanted to try the data import wizard with an Excel data that I converted to a CSV. When I add the CSV I got the problem that The columns are not seperated by comma but semicolon. What datatype or other option can I use so the problem does not occure?

Greetings Jonathan
User-added image
Best Answer chosen by Jonathan Wolff 7
AbhinavAbhinav (Salesforce Developers) 
Hi Jonathan,

This are consideration while importing data from CSV file in salesforce.
https://help.salesforce.com/articleView?id=000313396&type=1&mode=1
https://help.salesforce.com/articleView?id=000331030&type=1&mode=1

Most probably  your excel setting changes the delimiter to semi-colon (;) instead of comma (,). To resolve this issue:

1. Go to your file and right click on it.
2. Select Open with and select notepad
3. Once the file open in notepad, click on the Edit Tab.
4. Select replace
5. On the "Find what" field enter the value (;) semi-colon
6. On the "Replace with" field enter the value (,) comma
7. Click on the Replace all button.
8. Save the file and add the .CSV on the end of the file name.

Once done with the last step, don't open again the save file on excel. This will ensure that the delimiter of the file is save as comma delimited. The file should be good for import. Please let me know if this answer your query or you can mark it as solved.

Thanks!
 
Admin User 10568Admin User 10568 
Hi, 

Getting the following error: 

The element type "apex:outputPanel" must be terminated by the matching end-tag "</apex:outputPanel>".

For the following apex page: 

<apex:page standardController="REPRO__Project__c" extensions="ProjectAvailableONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "font-family: sans-serif; font-weight: bold; text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "font-family: sans-serif; text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
  
        <apex:pageBlockTable value="{!oncs}" var="onc" align="center" cellpadding="2" border="1"  style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;" >
              <apex:column headerValue="Level" value="{!onc.Property_Level__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                  <apex:column value="{!onc.Price_List_Property_Name__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /> 
                    <apex:column value="{!onc.REPRO__Type__c}" headerValue="Type" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                     
             <apex:column headerValue="Bdr" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bdr__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bdr__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
             
            <apex:column headerValue="Bath" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bth__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bth__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Study" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Study__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Study__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Internal Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Internal_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Internal_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="External Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__External_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__External_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
         
            <apex:column headerValue="Car" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Car__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Car__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
                <apex:column headerValue="List Price" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                    <apex:outputLabel value="{!onc.REPRO__List_Price__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                        <apex:outputField value="{!onc.REPRO__List_Price__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                            <apex:outputLabel value="Reserved" rendered="{!onc.REPRO__Status__c != 'Available'}"  />
                                </apex:column> 
            
        </apex:pageBlockTable>

    </apex:pageBlock> 
</apex:page>

// The intent is to make conditional formating within the apex table.

Any help would be awesome. 
Best Answer chosen by Admin User 10568
ShivankurShivankur (Salesforce Developers) 
Hi Admin, 

Thanks for posting the code snippet.

Try to check with below modified version of the same to see if you still see outputpanel end tag missing.
<apex:page standardController= "REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <table  border="4" align="center" cellpadding="4" style=" border-collapse: collapse; font-family: sans-serif; text-align: center; background-color:white;" >
   <tr style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;">
    <th>Level</th>    
    <th>Name</th>
    <th>Type</th>
    <th>Bdr</th>
    <th>Bath</th>
    <th>Study</th>
    <th>Internal Size m² </th>
    <th>External Size m² </th>
    <th>Car </th>
    <th>Price </th>
    </tr>    
     <apex:repeat id="myRepeatHeader" value="{!LevelList}" var="key">         
         <apex:variable var="count" value="{!1}"/>            
            <apex:repeat id="contactDetails" value="{!oncs[key]}" var="att">
                <tr>
                  <apex:outputPanel layout="none" rendered="{!count==1}">
                        <td rowspan="{!(modulecountMap[key])}"><apex:outputText value="{!att.Level}"/></td>
                    </apex:outputPanel>
              	
                    <td><apex:outputField value="{!att.Price_List_Property_Name__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
            		 <td><apex:outputField value="{!att.REPRO__Type__c}" style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /></td>
     				
             <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),'background-color: #A9A9A9;','')}" >
           				<apex:outputLabel value="{!att.REPRO__Bdr__c}" rendered="{att.REPRO__Status__c ='Available'}" />
                			<td value="{!att.REPRO__Bdr__c}" rendered="{!att.REPRO__Status__c = 'Available'}" />
                    </apex:outputPanel>
             
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Bth__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Bth__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Study__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Study__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Internal_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Internal_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
            <apex:outputPanel  style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__External_Size__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__External_Size__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
         
            <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
           				<apex:outputLabel value="{!att.REPRO__Car__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                			<apex:param value="{!att.REPRO__Car__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
     						</apex:outputPanel>
            
           	 <apex:outputPanel style="{!IF ((att.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
        			<apex:outputLabel value="{!att.REPRO__List_Price__c}" rendered="{att.REPRO__Status__c ='Available'}"  />
                 
                 //have to change the value to parse the list price through as currency. The map in the class changes it to  from currency to integer
                
                 <apex:outputText  value="{0, number, 000,000.00}"/>
                 <apex:param value="{!att.REPRO__List_Price__c}" rendered="{!att.REPRO__Status__c = 'Available'}"  />
                			<apex:outputLabel value="Reserved" rendered="{!att.REPRO__Status__c != 'Available'}"  />
                
           
                    
                    </apex:outputPanel>
    

                </apex:variable var="count" value="{!count+1}"/>
                </tr>
                </apex:repeat>
                    
                </table>
                 
</apex:page>
The problem may be in the quotes. You should use single quotes within double-quotes. Since, you just need to evaluate as a string which is style and should work with it.

If it helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
Vijay KenchuVijay Kenchu 
Hello Friendds,
I am trying to install LWC dev server on my windows 10 laptop. Getting the following error. It would be appreciable if someone can through ideas to fix this issue. When I directly hit URL https://registry.yarnpkg.com/@salesforce%2flwc-dev-server on browser it opens.
User-added image
Best Answer chosen by Vijay Kenchu
SwethaSwetha (Salesforce Developers) 
HI Vijay,
I see you also reached out on https://github.com/forcedotcom/lwc-dev-server-feedback/issues/3

Also, recommend checking https://github.com/nodejs/node-gyp/issues/1136

Can you confirm that you have reinstalled sfdx and npm?

You can also try the below approach:
>Install node gyp by running 
npm install -g node-gyp
>In command prompt or whatever command-line interface you use.
And then after that, you can run 
npm install --global --production windows-build-tools

Hope this helps to fix the problem.

Similar thread for reference:
https://developer.salesforce.com/forums/?id=9062I000000IZKUQA4

If this information helps, please mark the answer as best. Thank you
Luca DebellisLuca Debellis 
Implement a batch that counts the accounts and sends an email with the account number, thanks at all.
Best Answer chosen by Luca Debellis
veer soniveer soni
hi luca,
try following apex Batch Class that sanding email.
public class sendEmailViaApexBatch implements Database.Batchable<SObject> {
    public static Integer noOfAccount = 0;
      public Database.QueryLocator start(Database.BatchableContext context) {
        return Database.getQueryLocator([select Id,AccountNumber from Account WHERE AccountNumber != null order by Name]);
    }
    public void execute(Database.BatchableContext context, List<Account> scope) {
        list<Account> lstAccount = (List<Account>) scope;
        noOfAccount = lstAccount.size();
        sendEmail();
        
    }
       public void finish(Database.BatchableContext BC){
        AsyncApexJob a = [SELECT Id, Status,ExtendedStatus,NumberOfErrors,JobItemsProcessed,TotalJobItems, CreatedBy.Email 
                          FROM AsyncApexJob WHERE Id =:BC.getJobId()];
           system.debug('a===> ' + a);
          }
    public static void sendEmail(){
           Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            List<String> sendTo = new List<String>();
           sendTo.add('test12345@gmail.com');
           mail.setToAddresses(sendTo);
           mail.setSubject('count Account Number ' );
           mail.setPlainTextBody('Total Account Number : ' + noOfAccount  );
           Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

}

above class sanding No Of Accounts Where accountNumber != null
let me know if it helps you and marking it as best so that it can help to others.
Thank you
David Watson 43David Watson 43 
Hello, 

I'm tryng to complete Trailhead beginner training and I'm in the module where I have to modify the help menu. However, I cannot continue because the option to add a new resource is disabled.

Am I doing something wrong here?
Thanks.

User-added image
Best Answer chosen by David Watson 43
ShivankurShivankur (Salesforce Developers) 
Hi David,

To add a new resource, follow the steps below:
  • Hover your mouse on the Label and click on the inline edit icon.
  • Populate the above field.
  • Repeat the same steps for the URL column.
  • Click on Save.
You can refer to this help article for this issue:
https://help.salesforce.com/articleView?id=000355315

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.