Sunday, June 19, 2022

Salesforce Einstein Products

 Salesforce Einstein Products

-----------------------------------------------------

As we know Salesforce has it's own artificial intelligence, natural language processing and deep learning technologies embedded product named it as "Einstein".

Some of this product features are already part of Salesforce clouds like sales cloud, service cloud and marketing cloud etc.. 

As a developer if you want to use these feature to build out of box features use it as well. 

Some of the key products of einstein are listed below. 

1. Einstein Bot

2. Einstein Next Best Action

3. Einstein Case Classification

4. Einstein Discovery

5. Einstein Prediction Builder

6. Einstein Language

7. Einstein Vision






Wednesday, June 15, 2022

Write A Test Class For Getter and Setter Methods in Salesforce Apex

Please use the below code snippet in you case you have getter and setter methods in your apex class and want to cover up the same lines in test class.

Main Class:

Public class SreeTestCase
{
 public List<SelectOption> caseStatusList 
 {
  get {
	List<SelectOption> options = new List<SelectOption>();
	for( Schema.PicklistEntry f : Case.Status.getDescribe().getPicklistValues()) 
        {
	  options.add(new SelectOption(f.getValue(), f.getLabel()));
	}
	return options;
  }
		set;
 }
}

Test Class:

@isTest 
private class SreeTestCaseTestClass 
{
    static testMethod void testStatusList() 
	{
		SreeTestCase st = new SreeTestCase();
		List<SelectOption> options = new List<SelectOption>();
		options = st.caseStatusList;
	}
}


Please comment or write us if you have any queries/requirements.

Please like,follow,bookmark,subscribe this site to receive daily updates.


FaceBook Page - I Love Coding. You?


Hope this helps you..Enjoy..!

How to Delete (Bulk) Custom Metadata Records in Salesforce.

 Scenario:

You might have used the "Custom Metadata Loader" to perform the bulk insert and bulk update. Sometimes it's might be required to perform the bulk delete also ,but unfortunately this tool doesn't support as of today.

Solution:

So as a workaround we can have apex code snippet which can be used to perform the bulk deletion(in a single run max 200 records) of metadata .Please use the below code snippet for the same.

Source Code:

MetadataService.MetadataPort service = new MetadataService.MetadataPort();

// Set the session id
service.SessionHeader = new MetadataService.SessionHeader_element();
service.SessionHeader.sessionId = UserInfo.getSessionId();

//Add all your metadata records developer name to list
List<String> recordsToDelete = new List<String>();
For(YourMedataDataName__mdt m :[SELECT Developername from YourMedataDataName__mdt Limit 200])
{
	String s = 'YourMedataDataName__mdt.'+m.Developername;
	recordsToDelete.add(s);
}

//Perform the bulk deletion at a time max of 200 records
MetadataService.DeleteResult [] results = new MetadataService.DeleteResult []{};
results = service.deleteMetadata('CustomMetadata', recordsToDelete);

Please comment or write us if you have any queries/requirements.

Please like,follow,bookmark,subscribe this site to receive daily updates.


FaceBook Page - I Love Coding. You?


Hope this helps you..Enjoy..!

Thursday, June 9, 2022

How can we setup different work item capacity for agents in Salesforce Omni-Channel

 Scenario:

Let's assume we have group of users assigned under the omni channel for handling of incoming chat request.
How can we set the different maximum chat limit for user basis on experience. Ex For new joiner we want to setup of maximum cap as 5 and others as 7 chats.

Solution:
Ideally in omni channel the agent capacity and which Omni-channels features can be accessed like auto decline or auto accept of the work items can be performed using the "Presence Configuration" settings.

So in our case also we can create two presence configurations ,one for the new joiners and second for the others. Under the new joiners configuration we will add all the new joiners so when they logged into Omni channel the chat capacity will be picked up from here automatically.



Please comment or write us if you have any queries/requirements.

Please like,follow,bookmark,subscribe this site to receive daily updates.


FaceBook Page - I Love Coding. You?


Hope this helps you..Enjoy..!