October 31, 2019

How to reference Custom Metadata Type Record in Salesforce Flows?

Use Get Records flow component to fetch and reference Custom Metadata Type Record in Salesforce Flows.


Store the output using "Manually assign variables(advanced)" option.

Could not find the style resource Salesforce Trailhead issue

Open the Lighting Component using Developer Console and make sure to click all the resources in the Lightning Component Bundle.


How to customize the Salesforce Community URL?

1. Go to Domains in Salesforce.


2. Click Add a Domain.

3. Follow the instructions and work with your Website admin.

October 30, 2019

Salesforce Interview Questions with Answers Part 58

1. Unconvert Leads in Salesforce
Once the Lead is converted, we cannot unconvert it in Salesforce.

Using View and Edit Converted Leads permission in the Profile, users can edit the Leads. But, users can’t unconvert leads. Even with this permission if the user updates the Lead to a different status, ConvertedAccountId and ConvertedOpportunityId fields cannot be updated through a trigger. These are system fields.

It is better to delete the opportunity and create a new Leads.

http://www.infallibletechie.com/2018/10/profile-permission-to-view-and-edit.html

Vote for the below Idea
https://success.salesforce.com/ideaView?id=08730000000ksj0AAA

2. Id token Vs access token
ID Token
You will get id token if you are using the scope as OpenID. Id token is specific to the OpenID scope. With OpenID scope you can get both id token and access token.

Access Tokens
Access tokens are used as bearer tokens. A bearer token means that the bearer (who holds the access token) can access authorized resources without further identification. Because of this, it’s important that bearer tokens are protected. If I can somehow get ahold of and “bear” your access token, I can pretend as you.
These tokens usually have a short lifespan (dictated by its expiration) for improved security. That is, when the access token expires, the user must authenticate again to get a new access token limiting the exposure of the fact that it’s a bearer token.

3. What is the difference between JWT & JWT Token Exchange in Salesforce Named Credentials?
JWT Token: 
Salesforce will issue the token for the external system. When your code uses the named credential to call your third party service, Salesforce will send the newly issued JWT token to your third party service as a bearer token.

JWT Token Exchange: 
Salesforce will issue a JWT token and send it to the external authorization service( Token Endpoint URL). The authorization service will exchange the provided JWT token for the access token. When your code uses the named credential to call your third party service, Salesforce will send the access token received from authorization service to your third party service as a bearer token to authenticate into the external system.

4. JWT Token
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.

Although JWTs can be encrypted to also provide secrecy between parties, we will focus on signed tokens. Signed tokens can verify the integrity of the claims contained within it, while encrypted tokens hide those claims from other parties. When tokens are signed using public/private key pairs, the signature also certifies that only the party holding the private key is the one that signed it.

JSON Web Token structure
In its compact form, JSON Web Tokens consist of three parts separated by dots (.), which are:

Header
Payload
Signature
Therefore, a JWT typically looks like the following.

xxxxx.yyyyy.zzzzz

5. Difference between OAuth 2.0 and Service Account for authentication in Salesforce Outlook Integration
OAuth 2.0
1. For Exchange Online with Office 365.
2. It doesn't support On-Premises Exchange.
Service account
1. For On-Premises Exchange 2016, 2013, and Exchange Online with Office 365

6. OpportunityHistory and OpportunityFieldHistory
OpportunityHistory object represents the history of a change to the Amount, Probability, Stage, or Close Date fields of an Opportunity. The OpportunityFieldHistory object represents the history of a change to any of the fields of an Opportunity.

7. Federate Id Vs Delegate Id
Federated ID: Federated solution means that you establish a trust/agreement with few third party identity service providers and use them for authentication. Users can any of those services. It makes no difference to you which (from the allowed ones) account/service is being used for authentication. It is one of the ways to implement SSO. Usually based on SAML and OpenID.

Delegated ID: Delegated ID solution is to outsource your authentication part to one fixed site. Only that website will be trusted for login to your site/app.

8. Asset sharing Controlled By Parent
If asset sharing is set to the Controlled by Parent—the default setting—the Account field, Contact field, or both must be completed for an asset to be saved. If asset sharing is not set to Controlled by Parent, assets can be saved without an associated account or contact.

9. Zones in Salesforce Idea
Zones organize ideas and questions into logical groups, with each zone having its own focus and unique ideas and questions. Zones are shared by the Ideas, Answers, and Chatter Answers applications, allowing you to view and create zones from those locations. Professional Edition organizations can have only one internal zone. All other editions can have up to 50 zones shared between Ideas, Answers, and Chatter Answers.

10. DKIM
Salesforce DKIM KeysSalesforce uses DKIM keys to sign outbound emails that your organization sends from the Salesforce platform.
Use the DKIM (DomainKeys Identified Mail) key feature to let Salesforce sign outbound email sent on your company’s behalf. These signatures give recipients confidence that the email was handled in a way that’s consistent with your company.
To ensure your email message from Salesforce does not end up unread in the recipient’s spam folder, you can easily implement DomainKeys Identified Mail (DKIM). Use the DKIM (DomainKeys Identified Mail) key feature to enable Salesforce to sign outbound emails sent on your organization’s behalf. A valid signature provides recipients confidence that the email was handled by a third party such as Salesforce in a way authorized by your organization.
Make sure you add the public key to your DNS record before you make your key active in Salesforce and start DKIM signing. DKIM signing is active whenever your DKIM key is in the active state.
Note: DKIM avoid sending emails to Spam.

11. Datorama
The Datorama marketing intelligence and analytics platform eliminates the time-intensive, manual process of combining disparate data sources to gain a comprehensive understanding of marketing campaigns. With Datorama, you get back valuable time and bandwidth to analyze data, optimize performance within campaigns, discover insights in real-time, and then take action on them. That’s how Datorama drives transparency, speed, and growth.

12. What is the use of Maintenance Plans in Field Service Lightning
Maintenance Plans are used to schedule and create Work Orders for the future.

Create preventive maintenance plans for specific assets so your customers never miss a beat. Maintenance plans let you define how often maintenance visits occur and mass-generate work orders for future visits.

13. Experienced Page Time (EPT) in Salesforce
Salesforce defines EPT as the time when a page starts loading to the time when no activity has occurred for at least two frames (about 33 milliseconds). We need two extra frames to catch asynchronous activities, such as data transfer or user interaction.
Enable Lightning Component Debug Mode from Setup. When this setting is enabled, it adds a counter to the Lightning Experience header that shows page load time and network bandwidth. One thing to keep in mind when enabling this setting is that performance may be impacted because the component code will be minified and caching is disabled.

14. Database.RaisesPlatformEvents
Batch Apex classes can fire platform events when encountering an error or exception. Event records provide more granular tracking of errors than the Apex Jobs UI because they include the record IDs being processed, exception type, exception message, and stack trace. You can also incorporate custom handling and retry logic for failures. Clients listening on an event can tell how often it failed, which records were in scope at the time of failure, and other exception details. Events are also fired for Salesforce Platform internal errors and other “uncatchable” Apex exceptions like LimitExceptions that are caused by reaching governor limits.

The BatchApexErrorEvent object represents a platform event associated with a batch Apex class.
This object is available in API version 44.0 and later.
If the start, execute, or finish method of a batch Apex job encounters an unhandled exception, a BatchApexErrorEvent platform event is fired.

To fire a platform event, a batch Apex class declaration must implement the Database.RaisesPlatformEvents interface.

15. Delegated Approver
Delegated Approver is an alternate approver.

This user receives the same approval requests as you do.

Delegated approvers can't reassign approval requests. But, they can approve or reject approval requests.

Having the "Record Editability" setting set to "Administrator OR Current Approver" does not apply to the delegated approver.

https://success.salesforce.com/ideaview?id=08730000000BrJYAA0

16. What is the use of @track?
By using @track, we take advantage of a relatively new JavaScript feature called a decorator. This decorator attaches functionality to the property that ensures that when its value changes, the component’s DOM is rerendered.

17. Difference between Federated authentication and Delegated authentication in Salesforce
Federated authentication uses SAML, an industry-standard for secure integrations.
Federated authentication using Security Assertion Markup Language (SAML) lets you send authentication and authorization data between affiliated but unrelated web services. You can log in to Salesforce from a client app. Salesforce enables federated authentication for your org automatically.

Use delegated authentication if you have mobile users in your organization, or if you want to enable single-sign-on for partner portals or Customer Portals. You must request that this feature be enabled by salesforce.com.
You can manage delegated authentication at the permission level, not at the org level, giving you more flexibility. With permissions, you can require some users to use delegated authentication and others to use their Salesforce-managed password.
Delegated authentication still sends the username and password (possibly even your network password) over the internet to Force.com.

1. When a user tries to log in—either online or using the API—Salesforce validates the username and checks the user’s permissions and access settings.
2. If the user has the Is Single Sign-On Enabled user permission, Salesforce doesn’t validate the username and password. Instead, a web service call is made to the user’s org to validate the username and password. When this user permission is enabled, Salesforce no longer manages the policies for user passwords, such as when passwords expire or the required minimum length. Instead, the delegated authentication endpoint’s service enforces password policies.
Note
Salesforce doesn’t store, log, or view the password. It’s disposed of immediately after the process completes.
3. The web service call passes the username, password, and source IP to your web service. The source IP is the address where the login request originated. You must create and deploy an implementation of the web service that Salesforce servers can access.
4. Your web service implementation validates the passed information and returns either true or false.
5. When the response is true, the login process continues, a new session is generated, and the user proceeds to the app. When false, the user gets an error message that the username and password combination is invalid.
Note
With delegated authentication, a user can experience a slight delay when logging in while the user account becomes available in the org.

18. Factory Function
Since functions are first-class objects, another way to declare a function is when a function returns another function. This pattern is often referred to as a factory function.

// when invoked, this function will assign a function
function gearFactory(){
  return function(driverGear, drivenGear){
    return (driverGear / drivenGear);
  }
}
// calculateGearRatio can now be invoked as a function
const calculateGearRatio = gearFactory();
// and all the rest

While the above example is simplistic, it’s valid. Factory functions are useful for one-off reusable functions, especially to capture variable references in a closure.

19. Can we define a method inside an object in JavaScript?
Yes. Object literals are a great way to create ad hoc data structures to pass data between functional parts of a JavaScript program, but you should avoid defining a function in an object literal.
Example:
const bike = {
  gears: 10,
  currentGear: 3,
  changeGear: function(direction, changeBy) {
    if (direction === 'up') {
      this.currentGear += changeBy;
    } else {
      this.currentGear -= changeBy;
    }
  }
}
console.log(bike.gears); // 10
console.log(bike.currentGear); //3
bike.changeGear('up', 1);
console.log(bike.currentGear); //4

20. Email Opt Out in Salesforce
The Email Opt Out field will allow you to exclude marked contacts from mass e-mail.
Email Opt Out field shows a message/warning when the user tries to send an email.

This field doesn't block to send an email. Check-in apex, workflow rule, and process builder before sending email alerts. 

21. Define the primitive data type

A primitive value is a value that has no properties or methods.
A primitive data type is data that has a primitive value.

22. Closures and Copy
Closures:
When a function is declared, it holds a reference to any variables or arguments declared within it, and any variables it references in the scope that it is contained within. This combination of its variables and arguments along with local variables and arguments from its containing scope is called a closure.

Consider this function, and the function it returns.

const greetingMaker = function(greeting){
  return function(whoGreeting){
    return greeting + ", " + whoGreeting + "!";
  }
}
const greetingHello = greetingMaker("Hello");
const greetingBonjour = greetingMaker("Bonjour");
const greetingCiao = greetingMaker("Ciao");
console.log(greetingHello("Gemma")); // Hello, Gemma!
console.log(greetingBonjour("Fabien")); // Bonjour, Fabien!
console.log(greetingCiao("Emanuela")); // Ciao, Emanuela!

Copy:
When greetingMaker is invoked, we might normally imagine its greeting argument to last only for the life of it being called.

But the returned function keeps a reference to the greeting argument in greetingMaker’s scope. So that finally when it is invoked through greetingHello/Bonjour/Ciao, it’s still accessible.

23. Using the prototype Property
The JavaScript prototype property allows you to add new properties to object constructors:

Example
function Person(first, last, age, eyecolor) {
  this.firstName = first;
  this.lastName = last;
  this.age = age;
  this.eyeColor = eyecolor;
}

Person.prototype.nationality = "English";

The JavaScript prototype property also allows you to add new methods to objects constructors:

Example
function Person(first, last, age, eyecolor) {
  this.firstName = first;
  this.lastName = last;
  this.age = age;
  this.eyeColor = eyecolor;
}

Person.prototype.name = function() {
  return this.firstName + " " + this.lastName;
};

24. Difference between var and let in JavaScript
var and let are both used for function declaration in javascript but the difference between them is that var is function scoped and let is block scoped.
It can be said that a variable declared with var is defined throughout the program as compared to let.
An example will clarify the difference even better
Example of var:

Input:
console.log(x);
var x=5;
console.log(x);
Output:
undefined
5

Example of let:

Input:
console.log(x);
let x=5;
console.log(x);
Output:
Error

25. What Is the Difference Between the Salesforce Events?
Platform Events
Platform events enable you to deliver secure, scalable, and customizable event notifications within Salesforce or from external sources. Platform event fields are defined in Salesforce and determine the data that you send and receive. Apps can publish and subscribe to platform events on the Force.com Platform using Apex or in external systems using CometD.

Streaming API Events
Streaming API provides two types of events that you can publish and subscribe to: PushTopic and generic. PushTopic events track field changes in Salesforce records and are tied to Salesforce records. Generic events contain arbitrary payloads. Both event types don’t provide the level of granular customization that platform events offer. You can send a custom payload with a generic event, but you can’t define the data as fields. You can’t define those types of events in Salesforce, and you can’t use them in Apex triggers.

26. Publish Behavior in Salesforce Platform Event
Indicates when a platform event message is published in a Lightning Platform transaction.

Choose:
Publish After Commit to have the event message published only after a transaction commits successfully. With this option, a subscriber receives the event message after the data is committed. If the transaction fails, the event message isn't published.
Publish Immediately to have the event message published when the publish call executes, regardless of whether the transaction succeeds. With this option, a subscriber might receive the event message before the data is committed.

27. API Calls for Data Replication
The API supports data replication with the following API calls:
getUpdated() Retrieves the list of objects that have been updated (added or changed) during the specified timespan for the specified object.
getDeleted() Retrieves the list of objects that have been deleted during the specified timespan for the specified object.

Polling no more frequently than every five minutes. There are built-in controls to prevent errant applications from invoking the data replication API calls too frequently.

Salesforce limits the number of queries that a user can execute concurrently. A user can have up to 10 query cursors open at a time. If 10 QueryLocator cursors are open when a client application, logged in as the same user, attempts to open a new one, then the oldest of the 10 cursors is released. If the client application attempts to open the released query cursor, an error results.

28. Opportunity Closed Date must be in current month Salesforce Validation Rule
https://www.infallibletechie.com/2019/10/opportunity-closed-date-must-be-in.html

29. Whenever Case record is created task should be created to system admin
Create a Workflow Rule and define Workflow action as Task. Set the admin in the Assigned To field.

30. Whenever Lead is converted into opportunity, the stage value should be prospecting(field update)
On lead conversion Opportunity stage by default is the one on top of the picklist "Stage" in Opportunity. To change the default value, move the desired default value on top of the list.

https://help.salesforce.com/articleView?id=000321509&language=en_US&type=1&mode=1

Opportunity Closed Date must be in current month Salesforce Validation Rule

Validation Rule:

AND(
IF( IsNew(), true, IF( PRIORVALUE( IsClosed ), ISCHANGED( CloseDate ) , false ) ),
MONTH( CloseDate ) != MONTH( TODAY() ),
IsClosed
)


October 28, 2019

SQL JOIN

A JOIN clause is used to combine rows from two or more tables, based on a related column between them.

Different Types of SQL JOINs
The different types of the JOINs in SQL:

(INNER) JOIN: Returns records that have matching values in both tables

LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table

RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table

FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table

SELF JOIN 
A self JOIN is a regular join, but the table is joined with itself.

SELF JOIN Syntax
SELECT column_name(s) FROM table1 T1, table1 T2 WHERE condition;

October 22, 2019

How to enable App Launcher in Salesforce1 Mobile App

With the new Salesforce mobile app, your users can have a truly seamless experience across desktop and mobile devices. Users will have access to their favorite Lightning apps, improved navigation, and deeper functionality on every page.

1. Go to New Salesforce Mobile App QuickStart in the Setup and enable it.


2. Create a permission set or profile to give the permissions.


App Launcher in Salesforce1 Mobile App


October 20, 2019

DUPLICATE_VALUE, duplicate value found: duplicates value on record with id

Check whether you are affected by this known issue - https://success.salesforce.com/issues_view?id=a1p30000000T5hTAAS. If yes, contact Salesforce support.

DML Error
If you're getting this error from a DML operation, then check the below

1. Check whether there are any fields with Unique attribute selected. If yes, check whether you are entering unique value to this field while doing data loading. Also, check whether any processes are updating this unique field value. Setting debug log, helps to find it or search through the metadata.
2. Check this - https://developer.salesforce.com/forums/?id=906F00000009A2vIAE

Deployment Error
If you're getting this error while trying to deploy. then check the below

1. Check whether there are any fields with Unique attribute selected. If yes, check whether test class is creating unique value for these fields.
2. Check whether you are trying to deploy picklist field. If yes, make sure the value is not inactive in the target org.

Field can not be filtered in a query call Salesforce

1. Check whether it is Text(Encrypted) field since it cannot be used.

http://www.infallibletechie.com/2014/11/textencrypted-field-in-salesforce.html

Encrypted fields that use the probabilistic encryption scheme can’t be used with the following SOQL and SOSL clauses and functions:
Aggregate functions such as MAX(), MIN(), and COUNT_DISTINCT()
WHERE clause
GROUP BY clause
ORDER BY clause

2. You can't filter by text area fields in SOQL.

NULL check in SQL

IS NULL is used to do NULL check in SQL.

Sample Query:

SELECT * FROM CustomersWHERE Column IS NULL

What is the difference between JWT & JWT Token Exchange in Salesforce Named Credentials?

JWT Token: 
Salesforce will issue the token for the external system. When your code uses the named credential to call your third party service, Salesforce will send the newly issued JWT token to your third party service as a bearer token.

JWT Token Exchange:
Salesforce will issue a JWT token and send it to the external authorization service( Token Endpoint URL). The authorization service will exchange the provided JWT token for the access token. When your code uses the named credential to call your third party service, Salesforce will send the access token received from authorization service to your third party service as a bearer token to authenticate into the external system.



October 17, 2019

How to do Mass Email ( List Email ) in Salesforce Lightning?

1. Go to Leads Tab.

2. Select your list view.

3. Select the Leads.

4. Click Send List Email.


5. Enter the Content and click Send button.


6. Select the Template or save the content as template for future reference.


Note:
1. Permission to be enabled for users to have the List Email is "Allow sending of List Emails".

2. Check the below link for Limitations.

https://help.salesforce.com/articleView?id=limitations_email_mass.htm&type=5

October 16, 2019

October 15, 2019

Quip for Salesforce

Embed real-time document collaboration inside Salesforce, so your teams can easily create, discuss, and execute on Account Plans, Opportunity Notes, Live Deal Feeds and much more.

Quip’s commitment to data security is at the core of the product

Open Salesforce report in Quip - http://www.infallibletechie.com/2017/08/how-to-use-salesforce-report-data-in.html

Pricing - https://www.salesforce.com/products/quip/pricing/

Companies may block it for Security purposes since it allows us to upload and download files.

1. Quip allows us to edit Quip documents live in Salesforce.
2. Supports Spreadsheets with live Salesforce data.
3. 2-Way sync with Salesforce data.
4. Quip mobile app allows us to open and edit the documents from mobile phones.

October 14, 2019

Calendar Tab is missing issue in Salesforce

Make sure the profile have Events tab set to Default Off or Default On to view the Calendar tab. It should not be Tab Hidden.


October 9, 2019

Synchronize data between Salesforce using Skyvia

1. Go to Integrations.


2. Click.


3. Select Source and Target in Connections. Click Add Task to add source and target objects. Use schedule option to schedule the Synchronization.


October 8, 2019

How to add fields to existing Salesforce object dataset in Analytics?

1. Go to Data Manager.


2. Navigate to Dataflows & Recipes. Click Edit from the menu.


3. Click Select Fields to add additional fields.


October 7, 2019

October 4, 2019

Difference between Federated authentication and Delegated authentication in Salesforce

Federated authentication uses SAML, an industry standard for secure integrations.
Federated authentication using Security Assertion Markup Language (SAML) lets you send authentication and authorization data between affiliated but unrelated web services. You can log in to Salesforce from a client app. Salesforce enables federated authentication for your org automatically.

Use delegated authentication if you have mobile users in your organization, or if you want to enable single-sign on for partner portals or Customer Portals. You must request that this feature be enabled by salesforce.com.
You can manage delegated authentication at the permission level, not at the org level, giving you more flexibility. With permissions, you can require some users to use delegated authentication and others to use their Salesforce-managed password.
Delegated authentication still sends the username and password (possibly even your network password) over the internet to Force.com.

1. When a user tries to log in—either online or using the API—Salesforce validates the username and checks the user’s permissions and access settings.
2. If the user has the Is Single Sign-On Enabled user permission, Salesforce doesn’t validate the username and password. Instead, a web service call is made to the user’s org to validate the username and password. When this user permission is enabled, Salesforce no longer manages the policies for user passwords, such as when passwords expire or the required minimum length. Instead, the delegated authentication endpoint’s service enforces password policies.
Note:
Salesforce doesn’t store, log, or view the password. It’s disposed of immediately after the process completes.
3. The web service call passes the username, password, and source IP to your web service. The source IP is the address where the login request originated. You must create and deploy an implementation of the web service that Salesforce servers can access.
4. Your web service implementation validates the passed information and returns either true or false.
5. When the response is true, the login process continues, a new session is generated, and the user proceeds to the app. When false, the user gets an error message that the username and password combination is invalid.
Note:
With delegated authentication, a user can experience a slight delay when logging in while the user account becomes available in the org.

Zones in Salesforce Idea

Zones organize ideas and questions into logical groups, with each zone having its own focus and unique ideas and questions. Zones are shared by the Ideas, Answers, and Chatter Answers applications, allowing you to view and create zones from those locations. Professional Edition organizations can have only one internal zone. All other editions can have up to 50 zones shared between Ideas, Answers, and Chatter Answers.


October 3, 2019

How to auto assign topics to records in Salesforce?

Sample Code:

  1. trigger AccountTrigger on Account ( after insert ) {  
  2.   
  3.     Set < String > setBillCountries = new Set < String >();  
  4.       
  5.     for( Account acc : trigger.new ) {  
  6.       
  7.         if ( acc.BillingCountry != null )   
  8.             setBillCountries.add( acc.BillingCountry );  
  9.       
  10.     }  
  11.       
  12.     if ( setBillCountries.size() > 0 ) {  
  13.       
  14.         Map < String, String > mapTopicNameId = new Map < String, String >();  
  15.           
  16.         for ( Topic objTopic : [ SELECT Id, Name FROM Topic WHERE Name IN: setBillCountries ] )  
  17.             mapTopicNameId.put( objTopic.Name, objTopic.Id );  
  18.   
  19.         for( Account acc : trigger.new ) {  
  20.           
  21.             if ( acc.BillingCountry != null && mapTopicNameId.containsKey( acc.BillingCountry ) )  {  
  22.                         
  23.                 ConnectAPI.Topic objTopic = ConnectAPI.Topics.assignTopic( null, String.valueOf( acc.Id ), mapTopicNameId.get( acc.BillingCountry ) );  
  24.                   
  25.             }  
  26.               
  27.         }  
  28.       
  29.     }  
  30.   
  31. }  

Note: 
Each assignTopic() counts against DML limit. 
Use assignTopicByName() to avoid SOQL and use Topic Name instead of Id.

Delegated Approver in Salesforce

Delegated Approver is an alternate approver.

This user receives the same approval requests as you do.

Delegated approvers can't reassign approval requests. But, they can approve or reject approval requests.

Having the "Record Editability" setting set to "Administrator OR Current Approver" does not apply to the delegated approver.

https://success.salesforce.com/ideaview?id=08730000000BrJYAA0

October 1, 2019

How to decoratively prevent two Opportunities being created on a single Account on the same day in Salesforce?

1. Create a custom field on the Account.


2. Create a Workflow Rule on the Opportunity Object.


3. Create a Field Update on Opportunity Object.


4. Create a Validation Rule on the Opportunity Object.


Output:


How to monitor Salesforce Platform Events daily or 24-hour or hourly period usage?

Execute the below code and download the log.

  1. for ( OrgLimit o : OrgLimits.getAll() ) {  
  2.       
  3.     system.debug( o.getName() + ' - ' + o.getValue() + ' - ' + o.getLimit() );  
  4.       

Check DailyStandardVolumePlatformEvents


Check HourlyPublishedStandardVolumePlatformEvents


Check MonthlyPlatformEvents


Use the below link to subscribe using Workbench.

https://www.infallibletechie.com/2019/09/how-to-subscribe-to-salesforce-platform.html