+ Start a Discussion
I am trying to install the Marketing Cloud for Nonprofits app but I'm recieving the following deployment error: Key Error: "rest_instance_url". I couldn't find anything on google. Any suggestions on how to fix?
Best Answer chosen by Spencer_Berk
SwethaSwetha (Salesforce Developers) 
HI Spencer,
This error is specific to the package you are trying to install. The package's internal details are not visible to the subscribers(end users). Therefore you will need to reach out to the package provider with the error details so they can help with the fix.

On a general note,"rest_instance_url" is one of the response parameters when Marketing Cloud returns an access token
Reference: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/access-token-s2s.html#access-token-request
rest_instance_url : Your tenant’s REST base URL for making REST API calls.
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Vijayakumar KenchugunduVijayakumar Kenchugundu 
Hello Friends,

Your thoughts on my issue is highly appreciable. 
The scenario what I am trying to do here using Process Builder is updating child accounts when there is update on Parent account.
I have a custom picklist field Org Type (not used global picklist value set) on Account object. I am trying to set this value to all child accounts in the hierarchy where there is update the same field on Parent account.
I tried all these methods.
1st: I tried directly mapping field reference field [Account].Parent.Organization_Type__c to child account field. 
2nd: Used a formula with CASE (shown below) using both TEXT([Account].Parent.Organization_Type__c) and withouth TEXT. 

"Sole Proprietorship", "Sole Proprietorship",
"Partnership", "Partnership",
"Unincorporated", "Unincorporated",
"Limited Liability Company", "Limited Liability Company",
"Other", "Other",

The issue is the custom picklist field update on Parent is not at all updating on child records. Am I doing something wrong here?
Best Answer chosen by Vijayakumar Kenchugundu
Vijayakumar KenchugunduVijayakumar Kenchugundu
Oh my bad. I over complicated by adding ParentId in Field Reference. I changed and just considered direct Account fields, it worked even without using Formula.
[Account].Parent.Organization_Type__c (DID NOT WORK)
[Account].Organization_Type__c (WORKED PERFECT)
Timothy SmithTimothy Smith 
Please help me solve the reason for the two errors:

Line 8: Expression cannot be assigned
Line 17: Illegal assignment from List to Id
trigger SelectVacationPackage on Vacation_Package__c (after insert, after update) {
	List<Vacation_Package__c> PackagesToUpdate = new List<Vacation_Package__c>();
    List<Vacation_Package__c> WorkingPackages = [SELECT Id, Package_Type__c, Sales_Company__c, Package_Status__c 
												  FROM Vacation_Package__c WHERE Id In :Trigger.New];
    for(Vacation_Package__c vp: WorkingPackages){        
            if(vp.Package_Type__c = 'Select' && vp.Package_Status__c = 'Active'){

    for (Vacation_Package__c vsp : PackagesToUpdate){
        //Sales_Company__c is a Lookup field requiring an ID
        vsp.Sales_Company__c = [Select ID from Account WHERE Name = 'Upgrade Sales'];

    if(PackagesToUpdate.size() > 0){
        update PackagesToUpdate;       

Thank you
Best Answer chosen by Timothy Smith
Ajeet Singh 259Ajeet Singh 259
vsp.Sales_Company__c = [Select ID from Account WHERE Name = 'Upgrade Sales'];

Query return list object. Here require an id of record. used instead of :-

vsp.Sales_Company__c = [Select ID from Account WHERE Name = 'Upgrade Sales'].Id;
Dan Lambeth 31Dan Lambeth 31 
    static void setup() {
        List<Account> accounts; 
        // get some account Ids -- we will just create a couple of dummies
        System.debug ('AccountProcessorTest.setup() entered');
        try {
             accounts.add (new Account (name = 'who cares'));
             accounts.add (new Account (name = 'who cares 2'));
             insert accounts;
             System.debug (accounts.size() + ' accounts created');
        catch (Exception e) {
           System.debug('The following exception of type ' + e.getTypeName() + ' has occurred: ' + e.getMessage());

The method consistently fails at the first accounts.add() call.  

09:37:52:002 USER_DEBUG [19]|DEBUG|The following exception of type System.NullPointerException has occurred: Attempt to de-reference a null object

There are no validation rules on account.   I can create this account via the UI supplying nothing but the name.

thanks in advance
Best Answer chosen by Dan Lambeth 31
Suraj Tripathi 47Suraj Tripathi 47


Please try the below code.

public class TestSetupMethodExample {
     @testSetup static void setup() {
        List<Account> testAccts = new List<Account>();
		Account ac=new Account();
		ac.name='who cares';
		Account acc=new Account();
		acc.name='who cares2';
		  insert testAccts;
    @isTest static void testMethod1() {
	  List<Account> Accts = new List<Account>();
           Accts  = [SELECT Id FROM Account];

Please mark it as the Best Answer if it helps you.

Thank You

public class UpdateOpportunity {
    public static void descriptionUpdate() {
        List<Opportunity> opp = [SELECT  Id,Name,Description From Opportunity WHERE StageName='Closed Won'limit 5];
        for ( Opportunity opps :opp)
            if(opps.Description == Null){
                opps.Description = 'This Opportunity is converted into Account';
            else if(opps.Description == ''){
                opps.Description = 'This Opportunity is converted into Account';
              Update opp;
Best Answer chosen by Neela
Suraj Tripathi 47Suraj Tripathi 47
Hi Neela,

You can take reference from the below test class:-
Public class descriptionUpdateTest{
    @isTest public static void test(){
        List<opportunity> oppList= new List<opportunity>();
        for(integer i=0;i<5;i++){
            opportunity opp= new opportunity();
            opp.name='test '+i;
            opp.stageName='closed Won';
        insert oppList;

However, if you make these changes it will cover 100 %.
public class UpdateOpportunity {
    public static void descriptionUpdate() {
        List<Opportunity> opp = [SELECT  Id,Name,Description From Opportunity WHERE StageName='Closed Won'limit 5];
        for ( Opportunity opps :opp)
            if(opps.Description == Null || opps.Description == '' ){
                opps.Description = 'This Opportunity is converted into Account';
              Update opp;

In case you find any other issue please mention. 
If you find your Solution then mark this as the best answer. 

I Just tried giving validation rules DATEVALUE(Order_Date__c) <= TODAY() .
Getting an error,How to reslove this?

Best Answer chosen by MOHAMMED AL IMAM
Hii Maohammed
Try Below Validation
Order_Date__c <= TODAY()
Please Mark it As Best Answer If it Helps
Thank You!

User-added imageUser-added imageUser-added image--> I am working on the Module " Web Chat Basics"
--> i face the problem on the Topic " Add Your Branding to Embedded Chat "
-->  At the Testing Phase, when i hit button "Chat with..." the systems starts loading to open the Chat Window, but Fails
---> When i inspect the page with Google Chrome Debugger, I see the error : ERROR AT NEW AURA....
---> TO FIX, i ve add new elements on the CORS, but this attempt does not fix the problem.

Thank you for your help,
Best Answer chosen by GUY BELOMO DIAKIESE
SwethaSwetha (Salesforce Developers) 
HI Guy,
Please note that Questions about how to pass Trailhead challenges are not on topic, because these challenges are intended to be independent demonstrations of your abilities.

Trailhead Help (https://trailhead.salesforce.com/en/help?support=home)can provide assistance for situations where Trailhead does not appear to be functioning correctly. You can reach out to them if this is the case.

Related posts for this error: https://github.com/douglascayers/sfdx-lightning-api-component/issues/2

Please close the thread by selecting as best answer so that we can keep our community clean. Thank you
Nasif Hasnain 6Nasif Hasnain 6 
I want to write a trigger on Contact , when a contact insert an email should be sent to contact email id.

I have written the below code and when I try to create a new contact, contact is not receiving an email. Can anyone help me.

trigger conss on Contact (before insert) {
    set<id> conlist = new set<id>();
    for(contact cons : trigger.new){
    public static void emailsent(){
        list<Messaging.SingleEmailMessage> maillist = new list<Messaging.SingleEmailMessage>();
        EmailTemplate et = [select id,
                             body from EmailTemplate where DeveloperName = 'contact_test' ];
        contact cont = [select id,email from contact where id in : conlist];
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage ();
Best Answer chosen by Nasif Hasnain 6
Maharajan CMaharajan C
Hi Nasif,

Please refer the below link:

Simran Nandla 5Simran Nandla 5 
I am trying to change fiscal year in Company-wide Org Settings module, but I am not able to change it in my org. I have tried different org, also tried logout and login but it is still not working.
Help me! 
Best Answer chosen by Simran Nandla 5
Akshay ShahAkshay Shah
Hi Simran

If you are still facing the same issue then try changing fiscal year in Salesforce Classic.

Click on your profile > Click Switch to Salesforce Classic > Click Setup > Search for Fiscal Year in Quick Find box > Click Fiscal Year > Change to February > Click Save button > Click OK on Are you sure? Popup window.

If it helps then mark this as Best answer !
Thanks, Akshay
Hemant Mittal 2Hemant Mittal 2 
when i check in schema builder then also i don't see any relationship between OpportunityLineItem and PriceBookEntry

But in object manager, when i check OpportunityLineItem object it doesn't have any field or relationship named PricebookEntryIdUser-added image
Best Answer chosen by Hemant Mittal 2
AbhinavAbhinav (Salesforce Developers) 
Hi Hemant,

Please check below link which will help you to understand  the relationship