• vijendahr k
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 8
    Replies
Hello All,

 I have SOQL Query as follows

list<account> acclist= new list<accout>[SELECT Id,(SELECT Id FROM Opportunities) FROM Account limit ]

Now account have 3 records each child have 3 records. now tell me some one the list of acclist size will be 3 or 9.

 I had scenario where i have query like [parent,(child)(child)(child)]  in this query parent getting 1500 or bit more records. even though i am getting error like  more then 50,000  in query.

Can some one please answer my query. - Thanks Advance.






 
Hello All, 

  i have scenairo, where i have to compare with single record with list of records and if i found duplicate record i will have to return duplicate record.

 Example : List<account> listAcc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account]

  Account  acc= [select id, name, type,startdate, enddate, designation, ( select id , name , email, from contact), (select name, id, stage from oppty) from account where id='XXXXXXXX'];

now i have to compare account (acc) record with all the list of records from listAcc  data with parent and child records. if i found  same record in then i have to return duplicate record found. 

Thanks 


 
Hello all, 

 could you please help me get all the distinct records basaed  on changed by(Emp id)  and changed on fie( datetime) ,below is query 
list<Contact_Audit__c> aulitList =[SELECT Name, Changed_By_Name__c, Contact_ID__c, Changed_By__c, Changed_On__c, Change_Type__c FROM Contact_Audit__c where Contact_ID__c = 'xxxxxxx']

in this query Changed_On__c is list of employess emp1, emp2, emp3..
Change_Type__c captures last modifed by records, but i need a distinct record of employee based on recent last modified by records Example
Changed_On__c--Change_Type__c
emp1 ------- 01
emp1 ------- 02
emp1 ------- 03
emp2 ------- 01
emp2 ------- 02
emp2 ------- 03
emp3 ------- 01
emp3 ------- 02
emp3 ------- 03

in this list i need only records like
Changed_On__c--Change_Type__c(date)
emp1 ------- 01
emp2 ------- 01
emp3 ------- 01

Can any one tel me how to get distinct records based on employee and his changged type(dateTime) using salesforce or some method. 
Please suggest me correct way


 


i have written below code for post method , an trying to insert response in salesforce, but i am enable to create response in proper format, could you help me why is the issue in below code

@RestResource(urlMapping='/Wrp/WrapCaseManager/*')
global with sharing class WrapCaseManager {

    @HttpPost

    global static WrapCaseManager.Caseinsert doPost(WrapCaseManager.Caseinsert  ACCREQ) {

        account acc=(account)ACCREQ.Ac;
        return ACCREQ;
    /*

    }


    global class outerinsert
    {
        public Caseinsert  cin;
    }
    global class Caseinsert {


        public Account Ac;


    }
}

below is response :

{
    "Ac" :
    {
        "AccountNumber" : "12345",
        "BillingCity" : "Billing City",
        "BillingPostalCode" : "123456",
        "BillingState" : "Billing State/Provinc",
        "BillingStreet" : "street",
        "Industry" : "Agriculture",
        "Name" : "sample"
    }
}

----- issue in valid AccountNumber, can any one help me to fix it.

 
Due to some email field in my org, i cant query use email fields in soql query on ontact object. hence i developed below logic,
conset i am using it just for sample puruose, in my code source of email address are different . i collectd in set.

list<contact> conset=[select email from contact where email != null];
list<contact> conlist= new list<contact>();
set<string> emailids= new set<string>();
for(contact c:conset)
{
    if(c.email!='' || c.email != null )
    {
         emailids.add(c.email);
    
    }
 }

string querystring='';
string querystringACt='';
boolean Soslflg=false;
for(string str:emailids)
{
    querystring+=str+ ' OR ';
    if(querystring.length() >300)
    {
        system.debug('querystring==>'+querystring);
       querystringACt=querystring;
        querystring='';
        Soslflg=true;
    }
    if(Soslflg)
    {
        system.debug('inside soslflag'+querystringACt );
        List<List<SObject> > contacts = [FIND :querystringACt IN ALL FIELDS RETURNING Contact (id,name,email)];
       system.debug('sosl query'+contacts );
   conlist=contacts[0];
        system.debug('conlist== '+conlist);
       querystringACt ='';
        Soslflg=false;
 }
}
in the qbove query List<List<SObject> > contacts = [FIND :querystringACt IN ALL FIELDS RETURNING Contact (id,name,email)]; is always cming as blank. could you tell me what is the reason.

i tried below snippet . its working but inside loop its not working :--
string querystringACt='soslflagnullrose@edge.com OR sean@edge.com OR jrogers@burlington.com OR pat@pyramid.net OR a_young@dickenson.com OR barr_tim@grandhotels.com OR bond_john@grandhotels.com OR spavlova@uog.com OR lboyle@uog.com OR b.levy@expressl&t.net OR j.davis@expressl&t.net OR jane_gray@uoa.edu OR asong@uog.com OR ajames@uog.com';
List<List<SObject> > contacts = [FIND :querystringACt IN ALL FIELDS RETURNING Contact (id,name,email)];
system.debug('conlist== '+contacts[0]);


can any please help me fix it up


Thanks Advance

 
Hello all,
 
 In my org contact email Field is ecnryped fields , but i need to query list of email address using soql, like

 list< contact> con= [select id, name , email from contact where email=:listofUniqueemail];
but i am unable to use this command,

 i tryed to use sosl query to get contacts related to email address

list<list<contacts>> conlist= [find :listofUniqueemail retrun all  contact (id, name , email ))];

issue in this query is listofUniqueemail  we cant use the set in soql query , its giving error unable to handle list.

can you please tel me how to fix this issue. your help is very needed to fix issue.
i tried https://www.codescience.com/blog/2017/salesforce-platform-encryption-the-good-the-bad-and-the-ugly-3-areas-to-review-closely link its not worked. please give me dirct solution

Thanks
Vijendhar






 
User-added image
Hello All, i have to write one trigger on stagging object records, all the stageing object records shold be stored in 

Object A(Parent), Child1(child 1)Object Chiild 2(child 2) as shown in the image, after saving the record, parent id come and save in 
"Object A(Parent)(ID)", can any one help me with adivce how to insert data in the above format, 

Thanks to all Advance 
Hello All, 

 can any one suggest me to verify the pattren like below using date
:2014-09-15 00:00:00
 if(ob.Datestring__c == null ||date.valueOf(ob.Datestring__c) != date.valueOf(ob.Datestring__c.datevalue('yyyy/MM/dd') ) )//format('yyyy/MM/dd hh:mm:ss');
        {
            system.debug('inside lp');
           // if(date.valueOf(ob.Datestring__c) == date.parse('yyyy/MM/dd hh:mm:ss')) 2014-09-15 00:00:00
             ob.dateformat__c=date.valueOf(ob.Datestring__c);
            
        }
hello all, 

 i want to validate date format by using apex in trigger. currnly date is comming from java callout, need to check they are sendig valid date or not before save record in salesforce.

Thanks Advance
 
 
Hello all, 

 I have date with (dd-mmm-yy) ex: 20-may-17, in Excel sheet with text type , i need to update this date format  and load in salesforce. can anyone suggest me how to convert it proper date format in salesforce.
  
its bit urgenet requrement.
Thanks 
Vijendahr
Hello all, 

 i have scenario, where i need to insert data from obe object ot another object check snippt below
 
   for( account a: acclist)
list<contact> conlist= new list<contact>();
a.f1= aa.f1;
a.f2= aa.f2;0
string[] childemail=aa.childemail__c.split('''); // line 1: childemail__c field contains list of email address, based on email address i have to query                                                                                 contact object and insert, childemail__c contains email1, email2, email 3 data;
    for( contact con: select id, name, email from contact where in:childemail)  // line 2: i am uisng for loop inside for loop to add query records. hoe can i control both scenaios ;
   {  
           contact c= new contact();
          c.email= con.email;
           conlist.add(c);
      
   }
}

Can any one hlep me to remove Soql statement inside for loop and remove anoter for loop inside for loop, your help is very much needed to me to fix this issue. thanks advance. its very urgent to me. 



 
Hello all, 

  I have one urgent requrement, i have two objects integration_object, and integration_staging object , we have callouts to insert record in integration_staging object.after inserting record in the stageing object, i have to replicate all the values in  integration_object objet . for that i have to crate field mapping dynamically and assign values to it. like 

 stagingreclist= new integration_staging ();
for( integration_staging is: stagingreclist)
{
  integration_object  io= new integration_object ();
i0.f1 = 1s.f1;
i0.f2= is.f3;
  i have to map above fields dynamically , 


}


Can any one help me achive scenario or help me better approch for it. your help is very help full for me.
 
Hello All,
   
 How can we do " Sandbox Refresh steps Automation through Apex ".

Any one worked on automation of sandbox refreshment using scripts, let us know the best approches. suggestions will helps us lot.

Thanks 
vijay
Hello All,

 I have SOQL Query as follows

list<account> acclist= new list<accout>[SELECT Id,(SELECT Id FROM Opportunities) FROM Account limit ]

Now account have 3 records each child have 3 records. now tell me some one the list of acclist size will be 3 or 9.

 I had scenario where i have query like [parent,(child)(child)(child)]  in this query parent getting 1500 or bit more records. even though i am getting error like  more then 50,000  in query.

Can some one please answer my query. - Thanks Advance.






 


i have written below code for post method , an trying to insert response in salesforce, but i am enable to create response in proper format, could you help me why is the issue in below code

@RestResource(urlMapping='/Wrp/WrapCaseManager/*')
global with sharing class WrapCaseManager {

    @HttpPost

    global static WrapCaseManager.Caseinsert doPost(WrapCaseManager.Caseinsert  ACCREQ) {

        account acc=(account)ACCREQ.Ac;
        return ACCREQ;
    /*

    }


    global class outerinsert
    {
        public Caseinsert  cin;
    }
    global class Caseinsert {


        public Account Ac;


    }
}

below is response :

{
    "Ac" :
    {
        "AccountNumber" : "12345",
        "BillingCity" : "Billing City",
        "BillingPostalCode" : "123456",
        "BillingState" : "Billing State/Provinc",
        "BillingStreet" : "street",
        "Industry" : "Agriculture",
        "Name" : "sample"
    }
}

----- issue in valid AccountNumber, can any one help me to fix it.

 
Hello all,
 
 In my org contact email Field is ecnryped fields , but i need to query list of email address using soql, like

 list< contact> con= [select id, name , email from contact where email=:listofUniqueemail];
but i am unable to use this command,

 i tryed to use sosl query to get contacts related to email address

list<list<contacts>> conlist= [find :listofUniqueemail retrun all  contact (id, name , email ))];

issue in this query is listofUniqueemail  we cant use the set in soql query , its giving error unable to handle list.

can you please tel me how to fix this issue. your help is very needed to fix issue.
i tried https://www.codescience.com/blog/2017/salesforce-platform-encryption-the-good-the-bad-and-the-ugly-3-areas-to-review-closely link its not worked. please give me dirct solution

Thanks
Vijendhar






 
User-added image
Hello All, i have to write one trigger on stagging object records, all the stageing object records shold be stored in 

Object A(Parent), Child1(child 1)Object Chiild 2(child 2) as shown in the image, after saving the record, parent id come and save in 
"Object A(Parent)(ID)", can any one help me with adivce how to insert data in the above format, 

Thanks to all Advance 
hello all, 

 i want to validate date format by using apex in trigger. currnly date is comming from java callout, need to check they are sendig valid date or not before save record in salesforce.

Thanks Advance
 
 
Hello all, 

  I have one urgent requrement, i have two objects integration_object, and integration_staging object , we have callouts to insert record in integration_staging object.after inserting record in the stageing object, i have to replicate all the values in  integration_object objet . for that i have to crate field mapping dynamically and assign values to it. like 

 stagingreclist= new integration_staging ();
for( integration_staging is: stagingreclist)
{
  integration_object  io= new integration_object ();
i0.f1 = 1s.f1;
i0.f2= is.f3;
  i have to map above fields dynamically , 


}


Can any one help me achive scenario or help me better approch for it. your help is very help full for me.