• Ramesh Kosalairaman
  • NEWBIE
  • 129 Points
  • Member since 2015
  • Certified Salesforce Developer
  • Altimetrik India Pvt Ltd


  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 25
    Replies
Hi All ,

I need to know how we can do the test coverage for trigger old value and new value.

Regards
hello ,i need a code whose o/p will be {1,1,2,3,5,8,13,21,34,55}
loop should rotate 10 times 
this scenario add two num every time when loop rotates;
plzzzzzzzz thanks
list<VA_Allowance__c> AdjAllow = new list<VA_Allowance__c>();
       list<VA_Bonus__c> bonusy =new list<VA_Bonus__c>();
       list<string> bonusvaid = new list<string>();
       list<Payslip__c> pays = new list<Payslip__c>();
                
        adjbonus1 = [select name ,Adjustment__c, Adjustment_end_date__c,Acctid__c,Account_Name__c, Amount__c,New_Our_VA__c,Payslip_IDs__c,Type__c,payroll_cycle_year__c,payroll_cycle_start_year__c,Payroll_cycle_end_year__c, Adjustment_start_date__c,Adjustment_End_date1__c,Adjustment_startdate__c,Adjustment_Enddate__c,Mode__c,Bonus_creditdate__c,status__c from VA_Bonus__c
                     where Status__c='Active' and Payroll_Adjustment_only__c=true limit 1];
            adjset.addall(adjbonus);
            system.debug('>>>>>adjset'+adjset);
            adjbonus.addall(adjset);
            
            for(Payslip__c psx1 : pays)
               {
               system.debug('&&&&&&&pays'+psx1.Payslips__c);
                for(VA_Bonus__c bonusx : adjbonus1)
                {
                 if(psx1.Payslips__c == bonusx.New_Our_VA__c&& bonusx.status__c =='active')
                   {
                    if(bonusx.mode__c == 'One time' && bonusx.Bonus_creditdate__c==pc.payroll_cycle_type__c && bonusx.payroll_cycle_year__c ==pc.Payroll_cycle_year__c)
                       {
                         Paysliplineitem__c dedpsl = new Paysliplineitem__c();
                         dedpsl.Payslips__c = psx1.id;
                         dedpsl.Account__c =  bonusx.Acctid__c;
                         dedpsl.Date__c = system.today();
                         dedplx.add(dedpsl);
                        
                        if(bonusx.mode__c == 'One time')
                        {
                         bonusx.Payslip_IDs__c = psx1.name;
                         bonusx.status__c = 'Inactive';
                        }
                        bonusy.add(bonusx);
                        system.debug('************bonusy'+bonusy);
                       }
                       if(bonusx.mode__c == 'Recurring')
                           {
                            date adjstartdate=date.parse(bonusx.Adjustment_startdate__c);
                            date adjenddate = date.parse(bonusx.Adjustment_Enddate__c);
                            if(adjstartdate <= pc.paryoll_enddate__c && adjenddate >= pc.paryoll_enddate__c)
                         {
                         Paysliplineitem__c dedpsl = new Paysliplineitem__c();
                         dedpsl.Payslips__c = psx1.id;
                         dedpsl.Account__c =  bonusx.Acctid__c;
                         dedpsl.Date__c = system.today();
                                                
                          dedplx.add(dedpsl);
                           system.debug('****adddedplx'+dedplx);
                         if(bonusx.mode__c == 'Recurring')
                             {
                              if(bonusx.Payslip_IDs__c == null)
                          {
                          
                            bonusx.Payslip_IDs__c = psx1.name;
                            system.debug('>>>>>  bonusx.Payslip_IDs__c'+  bonusx.Payslip_IDs__c);
                          }
                         else
                           if(bonusx.Payslip_IDs__c != null)
                          {
                            bonusx.Payslip_IDs__c =  bonusx.Payslip_IDs__c + ',' + psx1.name;
                            if(adjenddate <=pc.paryoll_enddate__c)
                            {
                              bonusx.status__c = 'Inactive';
                            }
                          }
                       }
                      
                        }
                         bonusy.add(bonusx);
                      }    
                    }
                }
               }
               insert dedplx;  
               update bonusy;    // Error In this Line
Can Anyone Suggest how to solve this?

Thanks
 
Hi All,

I have one field with RIch Text type, when i render/print this field on PDF i am getting coded text.

Please help with this issue, i dont want this code type text,..

Example:

Rich Text Field Name : Note

Content Below:
  1. The product shall be delivered as a ESD. ESD stands for Electronic Software Distribution wherein the product has to be downloaded from the Internet and the license keys shall be provided via email.
  2. The above product includes1 year technical support, free patches and point updates via internet from Intel Corporation, USA.
  3. Please provide the End Users Details with Email ID.
  4. The above mentioned price is exclusive of Training and Installation of the software.
  5. Tax Deduction at Source (TDS) should not be applicable as per the CBDT notification No. 21/2012 [F.No.142/10/2012-SO(TPL)] S.O. 1323(E), DATED 13-6-2012 and Notification No. SO 1323 (E), dated 13-06-2012.
  6. The quoted price is subjected to change if there is any deviation in the exchange rate by +/-5%.
  7. Any new taxes applicable at the time of billing will be to your account.

In pdf file i am getting:

<ol><li>The product shall be delivered as a ESD. ESD stands for Electronic Software Distribution wherein
the product has to be downloaded from the Internet and the license keys shall be provided via
email.</li><li>The above product includes1 year technical support, free patches and point updates via
internet from Intel Corporation, USA.</li><li>Please provide the End Users Details with Email
ID.</li><li>The above mentioned price is exclusive of Training and Installation of the software.</li><li>Tax
Deduction at Source (TDS) should not be applicable as per the CBDT notification No. 21/2012
[F.No.142/10/2012-SO(TPL)] S.O. 1323(E), DATED 13-6-2012 and Notification No. SO 1323 (E), dated
13-06-2012.</li><li>The quoted price is subjected to change if there is any deviation in the exchange rate by
+/-5%.</li><li>Any new taxes applicable at the time of billing will be to your account.</li></ol>


APEX code i am using to print on pdf:
 
{!Quotation__c.Note__c}

 
The problem when trying to retrieve child relationships values/layouts using getRecordUI.

childRelationships array always blank.

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_wire_adapters_record_ui


"records": {
        "0039D000009qkFNQAY": {
            "apiName": "Contact",
            "childRelationships": {},
            "id": "0039D000009qkFNQAY",
            "lastModifiedById": "0052x000003CFVAAA4",
            "lastModifiedDate": "2020-10-29T08:03:53.000Z",
            "recordTypeId": "012000000000000AAA",
            "recordTypeInfo": null,
            "systemModstamp": "2020-10-29T08:03:53.000Z",
            "fields": {
                "Account": {
Is it possible to assign Case and Lead same time for the Task object in salesforce

If possible how to do that? tell me its very urgent
Hi All

I am getting Error Please select a choice while run the flow with Dynamic choice screen

User-added image
I am facing problem with Filter options not working properly When creating report in salesforce
 
The problem when trying to retrieve child relationships values/layouts using getRecordUI.

childRelationships array always blank.

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_wire_adapters_record_ui


"records": {
        "0039D000009qkFNQAY": {
            "apiName": "Contact",
            "childRelationships": {},
            "id": "0039D000009qkFNQAY",
            "lastModifiedById": "0052x000003CFVAAA4",
            "lastModifiedDate": "2020-10-29T08:03:53.000Z",
            "recordTypeId": "012000000000000AAA",
            "recordTypeInfo": null,
            "systemModstamp": "2020-10-29T08:03:53.000Z",
            "fields": {
                "Account": {
Hi,
 I have the following code in my controller.
----------------------------------------------------
 Pattern findMethodPattern = Pattern.compile('/\bSREV_[a-zA-Z0-9]+Handler[.]([a-zA-Z0-9]+)(?=)/gi');
 string str = 'SREV_TaskHandler.TaskBeforeUpdate(Trigger.new , Trigger.old);';
 Matcher tgrBodyMatter = findMethodPattern.matcher(str);
 system.debug('>>>'+ tgrBodyMatter.matches());//is always false.
----------------------------------------------------
 From the above code, the tgrBodyMatter.matches() should return true and with a value "TaskBeforeUpdate" but it is always false. if I use the same input and expression is working fine on https://regex101.com/r/oJ8xL2/1
Please guide.

 
HI iam new to salesforce. i got a requirement that to import data into salesforce.backend is data is coming from SAP .they used .netconnector to import data. i want to know how salesforce is connecting to other applications through API. what are the steps inorder to connect to salesforce.
any video links or documents are there please send me. i want to know how salesforce is getting data through API.
Hi,

While capturing a lead by Lead Capture Form we are checking whether Lead exists in existing accounts data. For this we are reducing the Lead compnay name by exluding few keywords (Inc, Technology, Llc etc) and then searching it in Accounts using like query.

e.g. Compnay name of inserted Lead is "Macro Tech Inc" then reduced compnay name is "macro" and SOQL query is "Select Id from Account where Name Like '%macro%'". Query returns these 2 companies - Macronetics and Macro Technology. Our code then picks first compnay i.e. Macronatics. Which is wrong, 'Macro Tech Inc' and 'Macronetics' are different companies. So there is requirement to search by whole work. %macro% returns all Acounts where the string is a substring of any account name.

Please help in writing the query to get accounts where I can search by whole word to find near match. Or do you have any better idea to search for near match of account?

Thanks,
Shruti
Hi All,
         If any price book price is amended, including the standard price book,How can I get an emailed alert?

Regards,
Bala 
Is it possible to assign Case and Lead same time for the Task object in salesforce

If possible how to do that? tell me its very urgent
Hi All

I am getting Error Please select a choice while run the flow with Dynamic choice screen

User-added image
I created a public force.com site and added a VF page called 'download'. I can open this page from a browser as an anonymous user. But in some cases, a user gets the default 'unauthorised' page.

This works fine: https://letterenfonds.secure.force.com/vertalingendatabase/download?languageCode=en&taal=Bulgaars&type=search&query=

This doesn't https://letterenfonds.secure.force.com/vertalingendatabase/download?languageCode=en&taal=Duits&type=search&query (https://letterenfonds.secure.force.com/vertalingendatabase/download?languageCode=en&taal=Duits&type=search&query)=

There are more German books in the datase compared to the Bulgarian ones, so I expect the problem to be caused by the number of results. The debug log does not give a clue that the user is being forwarded to the unautorized page.

31.0 APEX_CODE,INFO;APEX_PROFILING,FINEST;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,FINER;WORKFLOW,INFO
11:41:19.029 (29147173)|EXECUTION_STARTED
11:41:19.029 (29188955)|CODE_UNIT_STARTED|[EXTERNAL]|066b0000001Re3o|VF: /apex/download
11:41:19.044 (44800885)|CODE_UNIT_STARTED|[EXTERNAL]|01pb0000004VFVA|PageLanguageController <init>
11:41:19.066 (66093101)|CODE_UNIT_FINISHED|PageLanguageController <init>
11:41:19.066 (66138583)|CODE_UNIT_STARTED|[EXTERNAL]|01pb0000004VFVA|PageLanguageController get(requestLanguage)
11:41:19.066 (66159994)|CODE_UNIT_STARTED|[EXTERNAL]|01pb0000004VFVA|PageLanguageController invoke(getrequestLanguage)
11:41:19.066 (66219490)|CODE_UNIT_FINISHED|PageLanguageController invoke(getrequestLanguage)
11:41:19.066 (66229172)|CODE_UNIT_FINISHED|PageLanguageController get(requestLanguage)
11:41:19.096 (96463483)|CODE_UNIT_STARTED|[EXTERNAL]|01pb0000004VFV2|DownloadController <init>
11:41:19.124 (124120595)|SOQL_EXECUTE_BEGIN|[84]|Aggregations:0|SELECT COUNT_DISTINCT(Id) totalResults FROM Titel__c WHERE isZichtbaar__c = true AND isVertaling__c = true AND Taal__c  =  'Duits'
11:41:19.286 (286629508)|SOQL_EXECUTE_END|[84]|Rows:1
11:41:19.311 (311909509)|SOQL_EXECUTE_BEGIN|[46]|Aggregations:0|SELECT Id,Zoekresultaat_NL__c FROM Titel__c WHERE isZichtbaar__c = true AND isVertaling__c = true AND Taal__c  =  'Duits' ORDER BY Sorteernaam_Oorspronke__c, Taal__c, Titel__c, Publicatiedatum__c ASC NULLS LAST
11:41:30.419 (11419051984)|SOQL_EXECUTE_END|[46]|Rows:5000
*** Skipped 4598855 bytes of detailed log
...
11:41:32.071|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 2 out of 100
  Number of query rows: 10000 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 1709 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10
...
11:41:32.071|CUMULATIVE_LIMIT_USAGE_END

11:41:32.091|CUMULATIVE_PROFILING_BEGIN
11:41:32.091|CUMULATIVE_PROFILING|SOQL operations|
Class.FreeSearchRestService.doInternalSearch: line 46, column 1: Database.query(String): executed 1 time in 11114 ms
Class.FreeSearchRestService.getResultCountSOQL: line 84, column 1: Database.query(String): executed 1 time in 165 ms

11:41:32.091|CUMULATIVE_PROFILING|No profiling information for SOSL operations
11:41:32.091|CUMULATIVE_PROFILING|No profiling information for DML operations
11:41:32.091|CUMULATIVE_PROFILING|method invocations|
Class.DownloadController.<init>: line 10, column 1: private JSONDetailedOutputWrapper executeSearch(SearchQueryParameters): executed 1 time in 12470 ms
Class.DownloadController.executeSearch: line 39, column 1: public String __sfdc_query(): executed 13 times in 12461 ms
Class.FreeSearchRestService.doInternalSearch: line 49, column 1: public static String getSummaryFieldName(String): executed 10000 times in 308 ms
Class.FreeSearchRestService.doInternalSearch: line 51, column 1: public JSONOutputWrapper(String, String): executed 10000 times in 190 ms
Class.FreeSearchRestService.doInternalSearch: line 39, column 1: private static Integer getResultCountSOQL(String, String, String, String, String, String, String, String): executed 1 time in 172 ms
Class.FreeSearchRestService.doInternalSearch: line 42, column 1: public static String getSummaryFieldName(String): executed 1 time in 24 ms
Class.FreeSearchRestService.doInternalSearch: line 48, column 1: global public system.Iterator iterator(): executed 5002 times in 16 ms
Class.JSONOutputWrapper.<init>: line 16, column 1: public void __sfdc_id(String): executed 5000 times in 16 ms
Class.SearchOptionQueryBuilder.getSummaryFieldName: line 25, column 1: public static Boolean isEmpty(String): executed 10002 times in 15 ms
Class.JSONOutputWrapper.<init>: line 17, column 1: public void __sfdc_text(String): executed 5000 times in 5 ms
Class.FreeSearchRestService.doInternalSearch: line 50, column 1: public static Boolean isEmpty(String): executed 5000 times in 3 ms

11:41:32.091|CUMULATIVE_PROFILING_END
11:41:31.584 (12584158465)|CODE_UNIT_FINISHED|VF: /apex/download
11:41:31.585 (12585418733)|EXECUTION_FINISHED


 
I'm trying to access chatter in visualforce using iframe in customer portal.
Reason why I'm not using the default chatter tab is because I'm adding some custom styling in visualforce and I also don't want to see the sidebar and header.
The iframe works under force.com but when trying to access through community it throws an error page

<apex:page sidebar="false" showHeader="false" standardStylesheets="true" doctype="html-5.0">
    
        <apex:pageBlock >
           <apex:iframe id="iframe" src="/_ui/core/chatter/ui/ChatterPage?isdtp=vw" 
                        scrolling="true" width="100%" height="500px"/> 
        </apex:pageBlock>
        
</apex:page>

Can somebody help me understand why it does not display in community?
Hi All ,

I need to know how we can do the test coverage for trigger old value and new value.

Regards
Hi,

I wrote a big class with a lot of calculation, but all the calculation use the account id as inidicator.
If I open the visualforce/class it use the account id.
current: https://domain--dev--c.csXX.visual.force.com/apex/Parentanalyse?scontrolCaching=1&id=001b000000XUVdv <-- account id

Now I want to change the account id to a customfield parentanalyse_id__c. How can I use the customfield with the code below.
future: https://domain--dev--c.csXX.visual.force.com/apex/Parentanalyse?scontrolCaching=1&id=001b000000XUVdv <-- parentanalyse_id__c

Is this the correct way to get this information? If not, pleas let me know.
 
public class ParentAnaylse_class {

private Id KaccId {get; set;}
public ParentAnaylse_class(ApexPages.StandardController stdcontroller) { 
    KaccId = stdcontroller.getRecord().Id;

Thanks,
Sascha
hello ,i need a code whose o/p will be {1,1,2,3,5,8,13,21,34,55}
loop should rotate 10 times 
this scenario add two num every time when loop rotates;
plzzzzzzzz thanks
list<VA_Allowance__c> AdjAllow = new list<VA_Allowance__c>();
       list<VA_Bonus__c> bonusy =new list<VA_Bonus__c>();
       list<string> bonusvaid = new list<string>();
       list<Payslip__c> pays = new list<Payslip__c>();
                
        adjbonus1 = [select name ,Adjustment__c, Adjustment_end_date__c,Acctid__c,Account_Name__c, Amount__c,New_Our_VA__c,Payslip_IDs__c,Type__c,payroll_cycle_year__c,payroll_cycle_start_year__c,Payroll_cycle_end_year__c, Adjustment_start_date__c,Adjustment_End_date1__c,Adjustment_startdate__c,Adjustment_Enddate__c,Mode__c,Bonus_creditdate__c,status__c from VA_Bonus__c
                     where Status__c='Active' and Payroll_Adjustment_only__c=true limit 1];
            adjset.addall(adjbonus);
            system.debug('>>>>>adjset'+adjset);
            adjbonus.addall(adjset);
            
            for(Payslip__c psx1 : pays)
               {
               system.debug('&&&&&&&pays'+psx1.Payslips__c);
                for(VA_Bonus__c bonusx : adjbonus1)
                {
                 if(psx1.Payslips__c == bonusx.New_Our_VA__c&& bonusx.status__c =='active')
                   {
                    if(bonusx.mode__c == 'One time' && bonusx.Bonus_creditdate__c==pc.payroll_cycle_type__c && bonusx.payroll_cycle_year__c ==pc.Payroll_cycle_year__c)
                       {
                         Paysliplineitem__c dedpsl = new Paysliplineitem__c();
                         dedpsl.Payslips__c = psx1.id;
                         dedpsl.Account__c =  bonusx.Acctid__c;
                         dedpsl.Date__c = system.today();
                         dedplx.add(dedpsl);
                        
                        if(bonusx.mode__c == 'One time')
                        {
                         bonusx.Payslip_IDs__c = psx1.name;
                         bonusx.status__c = 'Inactive';
                        }
                        bonusy.add(bonusx);
                        system.debug('************bonusy'+bonusy);
                       }
                       if(bonusx.mode__c == 'Recurring')
                           {
                            date adjstartdate=date.parse(bonusx.Adjustment_startdate__c);
                            date adjenddate = date.parse(bonusx.Adjustment_Enddate__c);
                            if(adjstartdate <= pc.paryoll_enddate__c && adjenddate >= pc.paryoll_enddate__c)
                         {
                         Paysliplineitem__c dedpsl = new Paysliplineitem__c();
                         dedpsl.Payslips__c = psx1.id;
                         dedpsl.Account__c =  bonusx.Acctid__c;
                         dedpsl.Date__c = system.today();
                                                
                          dedplx.add(dedpsl);
                           system.debug('****adddedplx'+dedplx);
                         if(bonusx.mode__c == 'Recurring')
                             {
                              if(bonusx.Payslip_IDs__c == null)
                          {
                          
                            bonusx.Payslip_IDs__c = psx1.name;
                            system.debug('>>>>>  bonusx.Payslip_IDs__c'+  bonusx.Payslip_IDs__c);
                          }
                         else
                           if(bonusx.Payslip_IDs__c != null)
                          {
                            bonusx.Payslip_IDs__c =  bonusx.Payslip_IDs__c + ',' + psx1.name;
                            if(adjenddate <=pc.paryoll_enddate__c)
                            {
                              bonusx.status__c = 'Inactive';
                            }
                          }
                       }
                      
                        }
                         bonusy.add(bonusx);
                      }    
                    }
                }
               }
               insert dedplx;  
               update bonusy;    // Error In this Line
Can Anyone Suggest how to solve this?

Thanks
 
My code is,

list<VA_Allowance__c> AdjAllow = new list<VA_Allowance__c>(); 
set<VA_Allowance__c> adjallowset=new set<VA_Allowance__c>();
 
 AdjAllow = [select Amount__c,VA__c,Status__c from VA_Allowance__c where Status__c='Active' and Payroll_Adjustment_only__c=true and (Frequency__c=: pc.Payroll_Cycle_type__c or Frequency__c=:mode or Frequency__c='Both') and Payroll_cycle_year__c =:pc.Payroll_cycle_year__c];
         
         adjallowset.addall(Adjallow); // Adding to Set 
         adjallow.addall(adjallowset); // Still Duplicate Exists  

         System.debug('>>>>>>>adjallow'+adjallow);
         for(VA_Allowance__c adjallowx:adjallow)
         {
           allowvaid.add(adjallowx.VA__c);
         }
    }
    
      for(Payslip__c psx:pays)
        {
         for(VA_Allowance__c allowx :adjallow)
         {
            if(psx.Payslips__c == allowx.VA__c && allowx.status__c =='active')
                   {
                       Paysliplineitem__c allpsl = new Paysliplineitem__c();
                        
                       if(allowx.mode__c == 'One time' )
                        {
                         allowx.Payslip_IDs__c = psx.name;
                        }
                       allowy.add(allowx);
                   }
            }
          }
              insert allplx; 
              update allowy;     

This should be simple, but I'm having a hard time with it. I want to create a formula field that gives me the number of minutes between the record's CreateDate and LastModifiedDate. What does that formula need to look like?

 

Thanks for your help!