Wednesday, September 13, 2017

Replace Special Characters with Hyphen in a String


String value = 'tstu# is @ ' d ,s . "; dfs:';

value = value.replaceAll('[|,|.|\\,||"||:|~|!|@|#|$|%|^|&|*|_|+|=|<|>|?|\\(|\\)|\\{|\\}|\\;|\\\'"]', '-');

debug value: tstu is d s dfs:

Thursday, August 24, 2017

How do I check the 'Do not create a new opportunity upon conversion' check-box by default upon lead conversion?


The following solution allows an admin to customize a Salesforce org to automatically select the "Do not create a new opportunity upon conversion" checkbox on the lead conversion screen. This solution uses a Custom Button to REPLACE the standard "Convert" button on the Lead Page Layout.




Please note that this solution does not enable one to extend the same functionality when attempting to Convert a Lead after the using the "Find Duplicates" button, as that Page Layout is not currently customizable.

Custom Button Solution
To do this follow these steps:
  • Click on Setup | Customize | Leads | Buttons and Links
  • In the "Custom Buttons and Links" section, click on "New Button or Link"
  • Assign a Name and Label to the button. It is recommend to have the Name as "CustomConvert" and the Label set to "Convert".
  • Choose "Detail Page Button" in the "Display Type" field
  • Choose "Display in existing window without sidebar or header" in the "Behavior" field
  • Choose "URL" in the "Content Source" field
  • In the code section, type the following: /lead/leadconvert.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}&nooppti=1
  • Remove the standard "Convert" button and add this new button on any Lead Page Layouts in the Detail Buttons Section where you would like this to take effect.


Here list of parameters you can use in the custom button:
Convert Lead
  • "Do not create a new opportunity upon conversion" checked -- nooppti=1
  • "Send Email to Owner" checked -- sem=1
  • "Opportunity Name" -- noopptt={!Lead.Name} - opty
  • "Converted Status" -- cstatus=New Status
Task Information
  • "Subject" -- tsk5_fu=Mission Critical Task
  • "Status" -- tsk12_fu=Deferred
  • "Priority" -- tsk13_fu=High
Description Information
  • "Send Notification Email" -- email_followup=0
  • "Comments" -- tsk6_fu=No Comment
Reminder
  • "Reminder" -- IsReminderSet_fu=0


Some old Task/Events not showing in Salesforce


About Archived Activities


Available in: All Editions except Database.com

Salesforce archives activities according to these conditions.

  • Events with a due date greater than 365 days old
  • Closed tasks with a due date greater than 365 days old
  • Closed tasks without a due date and created more than 365 days ago
Additional considerations for activity archiving:
  • Archiving occurs weekly at approximately 5:00 AM Greenwich Mean Time (GMT) on Saturday.
  • Archived activities can be viewed only in export files, printable view, or by clicking View All on the Activity History related list. You can also view an archived activity if you know the URL for the activity.
  • Administrators can delete archived activities using Mass Delete.
  • Archived tasks are not included in reports. However, you can report on open or completed tasks.
Excluding old, closed activities from the activity reports increases the performance of these reports so that managers can quickly see where their reps are spending their time.

Activities that meet the following conditions are archived and not available in reports, list views, or through search:

1. Events with a due date greater than 365 days old.

2. Closed tasks with a due date greater than 365 days old.

3. Closed tasks with no due date will be archived based on the create date.

However, the activities that are more than one year old are still visible from the record they are associated with. Open tasks will not be archived. For example, you can see all activities {ever} delete associated with an account, contact, lead, opportunity, case or campaign when you view that record. Simply click on the "view all" button to see a complete view of all activities. Old activities are also included in the printable view for each record.

If you want, you can log a Feature Activation case with salesforce to extend the archive period. The period can be extended up to 5 years instead of the default archive time limit of one year. Extending this limit for activity archiving may potentially have an impact on performance and data storage.

For example, increasing the time limit for archiving activities may impact the performance of activity reports and list views if they are not efficiently scoped by filter criteria.

For organizations with small activity data volumes, this impact may be negligible.

Thursday, August 17, 2017

Insufficient Privileges error when user tried to create a new Child object record from Master Object.



If particular user has all the permission on child record and having the read/Edit/Create permission on Master record then we can't able to create child record until e have Modify All permissions, but it's not good to give the Modify All to all profiles. Solution: Edit the master detail field and in

Sharing Setting Select the minimum access level required on the Master record to create, edit, or delete related Detail records: Read Only: Allows users with at least Read access to the Master record to create, edit, or delete related Detail records.

as shown in below image:

Thursday, August 10, 2017

How do I check the 'Do not create a new opportunity upon conversion' check-box by default upon lead conversion?


The following solution allows an admin to customize a Salesforce org to automatically select the "Do not create a new opportunity upon conversion" checkbox on the lead conversion screen. This solution uses a Custom Button to REPLACE the standard "Convert" button on the Lead Page Layout.



Please note that this solution does not enable one to extend the same functionality when attempting to Convert a Lead after the using the "Find Duplicates" button, as that Page Layout is not currently customizable.

Custom Button Solution
To do this follow these steps:
  • Click on Setup | Customize | Leads | Buttons and Links
  • In the "Custom Buttons and Links" section, click on "New Button or Link"
  • Assign a Name and Label to the button. It is recommend to have the Name as "CustomConvert" and the Label set to "Convert".
  • Choose "Detail Page Button" in the "Display Type" field
  • Choose "Display in existing window without sidebar or header" in the "Behavior" field
  • Choose "URL" in the "Content Source" field


In the code section, type the following: /lead/leadconvert.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}&nooppti=1 Remove the standard "Convert" button and add this new button on any Lead Page Layouts in the Detail Buttons Section where you would like this to take effect. Note:

Further Customization to the lead convert page is not yet supported. Like making task unrequired. And point to the related ideas link:

https://success.salesforce.com/ideaView?id=08730000000Bra8AAC