+ Start a Discussion
Victor BogolyubovVictor Bogolyubov 
Hello,
I got Unknown error parsing query error. Can somebody explain what is going on, please? Thank you.

1. This is OK
SELECT Contact__r.Id, Contact__r.OwnerId, Account__r.Id, Account__r.OwnerId, Student__r.OwnerId
FROM Student_Relationship__c
WHERE Student__r.OwnerId  !='0056C000003GwJnQAK'
  AND Account__r.OwnerId != '0056C000003GwJnQAK'
LIMIT 20

2. This is OK too
SELECT Contact__r.Id, Contact__r.OwnerId, Account__r.Id, Account__r.OwnerId, Student__r.OwnerId
FROM Student_Relationship__c
WHERE Student__r.OwnerId  !='0056C000003GwJnQAK'
  AND Contact__r.OwnerId != '0056C000003GwJnQAK'
LIMIT 20

3. But THIS one is Unknown error parsing query
SELECT Contact__r.Id, Contact__r.OwnerId, Account__r.Id, Account__r.OwnerId, Student__r.OwnerId
FROM Student_Relationship__c
WHERE Student__r.OwnerId  !='0056C000003GwJnQAK'
  AND Contact__r.OwnerId != Account__r.OwnerId
LIMIT 20
 
Best Answer chosen by Victor Bogolyubov
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Victor,

This is expected behaviour from salesforce. We cannot compare two fields in SOQL query. Please find the below article for the same.

https://help.salesforce.com/s/articleView?id=000331053&type=1 (https://help.salesforce.com/s/articleView?id=000331053&type=1)

If this solution helps, Please mark it as best answer.

Thanks,
 
Silvio AmbrosoneSilvio Ambrosone 

Hello and sorry for the banal question but I'm struggling with this. 

So let's say i have this Object that is related with Account, and i need to know how many records of this Object are related with a specific account. Is there a specific method or something i don't know.

Best Answer chosen by Silvio Ambrosone
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Silvio,

Can you check the below question. This will give the number of child records for a parent.

https://salesforce.stackexchange.com/questions/36690/soql-count-number-of-child-records

If this solution helps, Please mark it as best answer.

Thanks,
 
roni shoreroni shore 
Hi guys, I have renamed the internal comments standard field on case  object to comments but it still appears on the layout as internal comments.
plz suggest
 
Best Answer chosen by roni shore
roni shoreroni shore
I got it, there's a language selection box on top of rename tabs page, need to select the language which the user is having and then change the label. I dont know how I missed that
Charlene NguyenCharlene Nguyen 
I keep receiving the "Houson, we have a problem," message - I've logged in before and I can't reset my password. What should I do?
Best Answer chosen by Charlene Nguyen
Mahesh DMahesh D
Hi Charlene,

Could you please use both Email ID and User Name unique from old ids.

Make sure that you never used this User Name any time with Salesforce.

Safe side, create one new Gmail Account and provide that id in both email and user name.

Please do let me know if it helps you.

Regards,
Mahesh
surya singh 9surya singh 9 
Configure appropriate organization-wide defaults
You’ve been asked to create a custom object for tracking projects. The Project custom object records should only be visible to the owner of the record and users above the owner on the role hierarchy. Create the Project custom object and then create an organization-wide default for the Project object to accommodate for this use case.
The custom object must be named 'Project' with a resulting API name of 'Project__c'.
 What I have tried is that I made in organization's sharing settings  for object Project below settings
Object: Project
Default Internal Access:Public Read/Write
Default External Access:Public Read Only
Grant Access Using Hierarchies:Tick yes
 Got below error
"Challenge Not yet complete... here's what's wrong:
The organization-wide default for the Project custom object was not configured correctly"

Please guide me

 
Best Answer chosen by surya singh 9
Arti KulkarniArti Kulkarni
Hi Surya,

OWD settings should be private and Grant Access Using Hierarchies should be checked

Thanks!
Arati
Peter Guzman Garcia 22Peter Guzman Garcia 22 
Hi;
I am hoping to get some help on this trigger. I am new to Apex programming. I have a custom object called Dues Calculator. For which I have a picklist depency, when the user selects one option "Unit Type" two additional picklist fields that need to be filled out are pre-populated with the correct options. Since I need to use those fields in formula. I created addtional fields that end in "selected". The purpose of my trigger is to automatically populate the "selected" fields with the options from the picklist depencies.
This is my trigger:
trigger NumberofUnitsPerTypeSelected on Dues_Calculator__c (before insert) {
    for(Dues_Calculator__c dues : Trigger.New){
        
       // Converting and Assigning the Picklist Value to the Selected Field to be used in a formula
        Decimal numberUnitTypeSelected   = Dues.Number_of_Units_Per_Type_Selected__c;
        String  numberUnitType           = Dues.Number__c;
        numberUnitType                     = numberUnitTypeSelected.format(); 
            
        // Converting and Assigning the Picklist Value to the Selected Field to be used in a formula
        Decimal percentageSelected       = Dues.Percentage_of_Ownership_Type_Selected__c;
        String  percentageOwnershipShare = Dues.Percentage_of_Ownership_Share__c;
        percentageOwnershipShare         = percentageSelected.format();
        
        insert dues;
        }
}

I get a Null Pointer Exception error, I tried to add the option to create a list. I am stuck here.

Any help is greatly appreciated;
Peter
Best Answer chosen by Peter Guzman Garcia 22
Moly DolyMoly Doly

Attempt to de-reference a null object” normally occurs when you try to reference an object which has not been initialized or has null values. To avoid this you need to make sure that all the sObjects in your class are initialized, preferably in the constructor. Hope this helps. 


For sone other information please visit: ( https://printerloop.com/ ).

Thank you.

CuerdasCuerdas 
This is my code;

public with sharing class HandlerNavi {
   
        @AuraEnabled (cacheable = true)
            public static List<Evento__c> getEvento() {
                List<Evento__c> even = new List<Evento__c>();
                for(Evento__c event :[SELECT Id, Name, Fecha__c FROM Evento__c ORDER BY Fecha__c]){
                    if(event.Fecha__c >= Date.today()){    
                        listEventos.add(event);        
                    }    
                }
                return listEventos;
            }
}

What is happening?

force-app\main\default\classes\HandlerNavi.cls  Variable does not exist: listEventos (8:25)
force-app\main\default\classes\HandlerNavi.cls  Variable does not exist: listEventos (11:24)
Best Answer chosen by Cuerdas
AnkaiahAnkaiah (Salesforce Developers) 
Hi Andres,

You have declared the list variable as even and you were trying to add values to listEventos. you need to add values to even.

try with below.
public with sharing class HandlerNavi {
   
        @AuraEnabled (cacheable = true)
            public static List<Evento__c> getEvento() {
                List<Evento__c> even = new List<Evento__c>();
                for(Evento__c event :[SELECT Id, Name, Fecha__c FROM Evento__c ORDER BY Fecha__c]){
                    if(event.Fecha__c >= Date.today()){    
                        even .add(event);        
                    }    
                }
                return even ;
            }
}
If this helps, please mark it as best answer.

THanks!!


 
Prakhyat sapraPrakhyat sapra 
Create a field on Account called “is_gold”, checkbox, default off Assignment: When an Opportunity is greater than $20k, mark is_gold to TRUE
Best Answer chosen by Prakhyat sapra
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Can you check the below trigger logic on the Opoortunity object.
 
trigger Opportunity_Amount on Opportunity (after insert, after update) {
  Map<Id, List<Opportunity>> acctIdOpptyListMap = new Map<Id, List<Opportunity>>();
    Set<Id> acctIds = new Set<Id>();
    Set<Id> acctidss= new Set<id>();
    List<Opportunity> opptyList = new List<Opportunity>();
    if(trigger.isUpdate || trigger.isInsert){
        for(Opportunity oppty : trigger.New){
            if(oppty.AccountId != null && oppty.amount>20000){
                acctIds.add(oppty.AccountId);
            }
             if(oppty.AccountId != null && oppty.amount<=20000){
                acctidss.add(oppty.AccountId);
            }
        }    
    }
   
    if(acctIds.size() > 0){
                List<Account> acctList = new List<Account>();
        acctList = [SELECT Is_Gold__c  FROM Account WHERE Id IN: acctIds];
        for(Account acct : acctList){
            //List<Opportunity> tempOpptyList = new List<Opportunity>();
           // tempOpptyList = acctIdOpptyListMap.get(acct.Id);
           // Double totalOpptyAmount = 0;
           
            acct.Is_Gold__c  = true;
        }
        update acctList;
    }
    if(acctidss.size() > 0){
                List<Account> acctLists = new List<Account>();
        acctLists = [SELECT Is_Gold__c  FROM Account WHERE Id IN: acctidss];
        for(Account accts : acctLists){
           // List<Opportunity> tempOpptyList = new List<Opportunity>();
           // tempOpptyList = acctIdOpptyListMap.get(acct.Id);
           // Double totalOpptyAmount = 0;
           
            accts.Is_Gold__c  = false;
        }
        update acctLists;
    }
}

If this solution helps, please mark it as best answer.

Thanks,

 
fiona gentryfiona gentry 
Dear Folks,

I need to build a record triggered flow which route cases for below conditions
  •    Email subject contains Telecommunication OR AWS
  •    Case with Record Types - Airtel OR  Vodafone 
  •    Picklist field when it has value as "Prepaid"

Your help with flow is highly appreciated
REGARDS.
Fiona

 
Best Answer chosen by fiona gentry
AnkaiahAnkaiah (Salesforce Developers) 
Hi Fiona,

Refer the below link have solution for similar kind of ask.
https://knowledgepredator.com/2021/09/17/lightning-flows-in-salesforce-how-to-assign-records-to-queue-using-flows/

If this helps, Please mark it as best answer.

Thanks!!
Kitty BarnesKitty Barnes 
I am new to writing validation rules and am stuck.  I need to write a rule so that a person can not change a project status to active unless a picklist field called foundation type is filled out. This would only apply to projects that fall within certain departments.

User-added image
 
Best Answer chosen by Kitty Barnes
Maharajan CMaharajan C
Hi Kitty,

You have to write the validation rule like below:
 
AND( 
ISPICKVAL(Project_Status__c, "Active"),
ISBLANK(TEXT(Foundation_Type__c)),
OR(
ISPICKVAL(ProjDept__c, "Custom"), 
ISPICKVAL(ProjDept__c, "Commercial"), 
ISPICKVAL(ProjDept__c, "Addition")
)
)

Thanks,
Maharajan.C