function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Reddy@SFDCReddy@SFDC 

Querying help plzzzzzzzzzzz

Hi All,

            my actual query is     

           Select Id, Name,Primary_Province_nes__c, Primary_city_nes__c,
            Primary_postal_code_nes__c,Primary_Address_2_NES__C      
            from Account  where Novartis AND Account_Status_NES__c<>'Inactive'
            and RecordTypeID in ('012A0000000YYzV','012A0000000RhHS','012A0000000Rirq')            now i need to add this  From account a, user b where a.ownerid = b.id and b.novartis_region_nes__c = 'Spain'

 

 

how can i do? please help

Jake GmerekJake Gmerek

            

 

Select Id, Name,Primary_Province_nes__c, Primary_city_nes__c,
            Primary_postal_code_nes__c,Primary_Address_2_NES__C      
            from Account  where Novartis AND Account_Status_NES__c<>'Inactive' and RecordTypeID in ('012A0000000YYzV','012A0000000RhHS','012A0000000Rirq')  and owner.novartis_region_nes__c = 'Spain

 

That should work for you.

Ispita_NavatarIspita_Navatar

            

Hi,

           Please  try this syntax as a workaround for the SOQL Query .

            User usr = [select Profileid,novartis_region_nes__c from User where Profile.name  = 'System Administrator' limit 1];

                                                list<recordType> recodType=[select id from recordType];

                                                List<ID> str = new list<ID>();

                                                For(RecordType r: recodType)

                                                {

                                                  str.add(r.id);

                                                }

            Account[] acc = [Select Id, Name,Primary_Province_nes__c, Primary_city_nes__c,

            Primary_postal_code_nes__c,Primary_Address_2_NES__C     

            from Account  where Novartis AND Account_Status_NES__c<>'Inactive' and RecordTypeID in : str where                  a.ownerid = usr.id and usr.novartis_region_nes__c = 'Spain'];

 

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.