+ Start a Discussion
Yash Kumar GuptaYash Kumar Gupta 
Hi All
I refere "https://help.salesforce.com/s/articleView?id=000321501&type=1" this article and they mention If your org is not on a Public Cloud instance and you would prefer not to allow Public Cloud IP ranges, you do not need to allow Public Cloud (Canada, Australia) IP ranges. And also they have mention 
Please be reminded that our best practice and recommendation is to allow the entire list of Salesforce IP ranges for seamless access.
Which create confusion so can you help me in this Do I need to mention IP range under APNIC, Australia (Public Cloud) and RIPE region even my instance is located at America region  ?
Best Answer chosen by Yash Kumar Gupta
SwethaSwetha (Salesforce Developers) 
HI Yash,
As you rightly pointed out from the documentation, the best practice is to whitelist the entire set of provided IP ranges. This is to avoid unintended service disruptions.

However, as you only want to allow the American region, add ARIN IP ranges.

IPv4 NetworkIPv4 IP Range
ARIN
13.108.0.0/1413.108.0.0 - 13.111.255.255
66.231.80.0/2066.231.80.0 - 66.231.95.255
68.232.192.0/2068.232.192.0 - 68.232.207.255
96.43.144.0/2096.43.144.0 - 96.43.159.255
128.17.0.0/16128.17.0.0 - 128.17.255.255
128.245.0.0/16128.245.0.0 - 128.245.255.255
136.146.0.0/15136.146.0.0 - 136.147.255.255
198.245.80.0/20198.245.80.0 - 198.245.95.255
199.122.120.0/21199.122.120.0 - 199.122.127.255
204.14.232.0/21204.14.232.0 - 204.14.239.255
34.226.36.48/2834.226.36.48 - 34.226.36.63
34.211.108.32/2834.211.108.32 - 34.211.108.47
13.58.135.64/2813.58.135.64 - 13.58.135.79
13.56.32.176/2813.56.32.176 - 13.56.32.191
35.182.14.32/2835.182.14.32 - 35.182.14.47

To be double sure, you can try to test what IP ranges Salesforce uses for your location and try whitelisting only them.

If this information helps, please mark the answer as best. Thank you
Lightning AccountLightning Account 
What is meant by Trailhead in Salesforce. What is the use of it and What is the use of getting points in Trailhead. Please explain and provide details. Thank you!
Best Answer chosen by Lightning Account
SwethaSwetha (Salesforce Developers) 
HI,
Trailhead is an interactive learning platform.Trailhead consists of three basic parts
  • Trails
  • Modules
  • Units

Trails are virtual paths that help a user learn a certain concept or technology by aggregating different modules.

Each module covers one topic, and it's made up of one or more units that both teach and evaluate a subject. A Module can be present in more than one Trail.

By completing Trails and Modules one earns badges (or Superbadges, in certain cases) that help showcase the user's knowledge.

Link: https://trailhead.salesforce.com/today

If this information helps, please mark the answer as best. Thank you
inbox outbox 7inbox outbox 7 
I am actually looking for an answer, kind of like a skeleton, so that I can modify the answer based on what I do.
I am preparing to attend interviews.

How do I answer the following questions as a developer:
What is the deployment strategy in your company?
What is your role in deployment (both in lower and as well as higher environments)?
Best Answer chosen by inbox outbox 7
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Generally it depends on the organization which you work. As per my experiencce till QA we will be merging the code and deploy the code till QA. and from then release team will handle the deployment. 

As per my experience we used to develop in Dev and move the code to QA and once it is passed then we move to INT and then perform regression testing ... etc there.

Thanks,
 
Anastasiya Komar 8Anastasiya Komar 8 

Hi!

I need to add gift cards to an opportunity if the checkbox is enabled, otherwise it will throw an error. In this case, the entered card is deactivated. In the future, I don't have the ability to change any of the opportunity field as the validation fires. How can I solve this problem?
public class OpportunityTriggerHandler {
    
         public void afterInsert (List<Opportunity> newOpportunities){
            List<String> cardNames = new List<String>();
            for(Opportunity oppItem : newOpportunities) {
                cardNames.add(oppItem.Gift_Card__c);
            }
            List<Gift_Card__c> giftCardToUpdate = [SELECT Active__c, Amount__c, Name 
                                                  FROM Gift_Card__c 
                                                  WHERE Name IN :cardNames];    
           
            for(Gift_Card__c giftCard: giftCardToUpdate ) {
                giftCard.Active__c = false;
            }
            
            update giftCardToUpdate;
        } 
        
         
        public void beforeInsert (List<Opportunity> newOpportunities){
            List<String> cardNames = new List<String>();
            for(Opportunity oppItem : newOpportunities) {
                cardNames.add(oppItem.Gift_Card__c);
        }
            List<Gift_Card__c> allGiftCards = [SELECT Active__c, Amount__c, Name 
                                           FROM Gift_Card__c 
                                           WHERE Name IN :cardNames];
            for (Opportunity newOpp: newOpportunities) {
                for(Gift_Card__c giftCard: allGiftCards ) { 
                        if (giftCard.Active__c == true) {
                        newOpp.Amount -= giftCard.Amount__c;
                     } else {
                     newOpp.Gift_Card__c.addError('Gift Card is inactive');
                         }
                    }
                }  
            }
        } 

Best Answer chosen by Anastasiya Komar 8
Maharajan CMaharajan C
Hi Anastasiya,

can you please elaborate your concern little bit more so we can help you much easily... Because am seeing you have already written some code...

Thanks,
Maharajan.C
Best Answer chosen by Justin Thompson 9
Maharajan CMaharajan C
Hey Justin, You can't grey out the field only you can throw the validation msg using standard functionalities.
 
AND(
    NOT(ISPICKVAL(At_Risk_Reason__c,"Other")),
	NOT(ISBLANK(Other_Reason_Explanation__c))
)

Thanks,
Maharajan.C
Nimisha Rajshri 7Nimisha Rajshri 7 
We are facing thie error on Account detail page in Lightning experience because of which I cannot see any fields on the accounts pagelayout. However, I can see the fields on details page for Accounts in classic. 

ui.services.connection.api.PartnerConnectionException: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 14994162-106344 (-1574478963)

Error
I don't understand this error id. anyone else facing the same issue?
Best Answer chosen by Nimisha Rajshri 7
SwethaSwetha (Salesforce Developers) 
I see below details in the logs for org (00D8K0000004eOQ)
java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected DATE UNIT got NUMBER
Record Id : 001F0000010jF4rIAE
Please also review the associated SOQL query

Also, you might want to recheck the timezone as it is
26 May 2022, Pacific Time (PT) 9:17 am at the time of writing this comment :) 

Hope this helps.Thank you
Best Answer chosen by Sanket Jadhav 15
AnkaiahAnkaiah (Salesforce Developers) 
Hi Saket,

A standard object has a standard tab already by default. You control the visibility at the profile level whether this tab is visible at all. Custom objects, you have control whether you create a tab for that object or not as it's "custom".
You'd have to create a Lightning/VF page tab if you'd like to do something completely custom at a standard object level through a tab.

Refer the below link

https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000A7bloSAB

If this helps, Please mark it as best answer.

Thanks!!
Prashant GulvePrashant Gulve 
Hi Team Need your Help on this trigger detail info provide please help..

On this trigger while creatig new contact record when i select Child Sham record on 'Account Name' field then Parent website getting auto populate on contact website but when i Select Parent Account Ram in contact 'Account Name' filed then it's showing Contact Website field blank. so it should reflect parent website in both scenario. Below is details
[when ever new contact record will created parent account website filed should get update on contact. even if child selected]

Created a trigger on Contact object (before update) to auto populate  Website__c field on creation of New Contact record. on update of Account Parent -Account-Website field and Child Account Website field.
1- I have created Website Field in both account and conatct object data type URL
2- Account Parent Record created. e.g- Ram and website filed updated www.Ram@pareant.com
3- Account Child record created. e.g- Sham and Parent account name is Ram selected website updated www.sham@child.com
4- On New Contact creation always Pareant Account Website should get display on contact object. e.g- www.Ram@pareant.com  even if we select Sham on contact object Account name field still www.Ram@pareant.com should get display on Contact object website filed.
Trigger:-
trigger WebsiteAutopopuoonContactTrigger on Contact (before insert) {
    WebsiteAutopopuoonContact.createWebsite(trigger.new);
  }
Handler:-
public class WebsiteAutopopuoonContact {
    public static void createWebsite(List<Contact> contList) {
        
       Set<Id> accSet = new Set<Id>();
        
        for(Contact Con : contList) {
            accSet.add(Con.AccountId);
            System.debug('accSet===='+accSet);
        }
        List<Account> accList = [Select Id
                                       , Name
                                        , Website
                                         , Account.Parent.Website
                                 from Account where Id IN:accSet];
        
        map<Id, String> idvswebsite = new map<Id, String>();
        for(Account acc : accList){
            idvswebsite.put(acc.id, acc.Parent.Website);
        }
        System.debug('accList==='+accList);
        
        Map<Id,Contact> conNameKeys = new Map<Id,Contact>();
        for(Contact Con : contList) {
            conNameKeys.put(Con.AccountId, Con);
            Con.Website__c = idvswebsite.get(Con.AccountId);
            System.debug('conNameKeys==='+conNameKeys);
        }
    }
}
 
Best Answer chosen by Prashant Gulve
AnkaiahAnkaiah (Salesforce Developers) 
Hi Prasanth,

try with below code.
trigger WebsiteUpdate on Contact (before insert,before update) {
    
    set<id> accids = new set<id>();
    if(trigger.isbefore && (trigger.isinsert || trigger.isupdate)){
        
    for(contact con:trigger.new){
        
        if(con.accountid != NULL){
            accids.add(con.accountid);
        }
     }
   }    
    map<id,account> accmap = new map<id,account>([SELECT id,parentid,website__c,parent.Website__c from account where ParentId!=Null AND id=:accids]);
    
    map<id, string> parentaccmap = new map<id,string>();
    for(account acc: accmap.values()){
        
       parentaccmap.put(acc.ParentId,acc.parent.Website__c);
        
    }
    
    for(contact con:trigger.new){
        for(Account acc :accmap.values()){
            
            if(con.accountid==acc.id && parentaccmap.containsKey(acc.ParentId) ){
                con.Website__c = parentaccmap.get(acc.ParentId);
            }
        }
    }
    
    

}

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​
shimy josshimy jos 
whenever an invoice(Invoice__c is the custom object) is created ,the opportunity status must change to open .How can i do using validation rule?
Best Answer chosen by shimy jos
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Shimy,

Can you try the below validation rule as you said in the question the validation should fire only when created so included isnew().
 
AND(ISNEW(),Text(Opportunity__r.Status__c) <>'Open')

Thanks,
​​​​​​​
Best Answer chosen by Amar123
Prateek Prasoon 25Prateek Prasoon 25
String SobjectApiName = 'Contact'; Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap(); for(String fieldName : fieldMap.keyset() ) { system.debug('fieldName->>'+fieldName); // This will give you the api name of the field name. }