Deepak
IndividualForum Replies Created
-
Hi Aditya,
AsyncApexJob – It Represents an individual Apex sharing recalculation job, a batch Apex job, a method with the future annotation, or a job that implements Queueable. BatchApex job represents an asynchronous Apex class using the Batchable interface via implements Database Batchable.
-
Deepak
MemberFebruary 26, 2020 at 5:35 pm in reply to: What is Database.AllowCallouts in Salesforce?Hi Aditya,
Database.AllowCallouts are used to allow Callouts in batch Apex, “Callouts include HTTP requests as well as methods defined with the web service keyword”. To use a callout in batch Apex, specify Database.AllowsCallouts in the class definition. For example:
global class SearchAndReplace implements Database.Batchable<sObject>, Database.AllowsCallouts{
}For further details refer to this link :
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.html -
Hi Shweta,
A callback URL is a URL that is invoked after OAuth authorization for the consumer (connected app). In some contexts, the URL must be a real URL that the client's web browser is redirected to.
-
Deepak
MemberFebruary 25, 2020 at 7:30 am in reply to: What is the use of component.get() method in Salesforce Lightning Components?Hi Aditya,
- It is associated with Component attributes and returns the referenced component attribute value.
- Syntax: component.get(String key);
Lightning Component:
<aura:component > <aura:attribute name="firstName" type="String"/> <aura:attribute name="lastName" type="String"/> <div class="slds-m-around--xx-large"> <div class="container-fluid"> <div class="form-group"> <lightning:input name="fName" aura:id="fName" type="text" required="true" maxlength="50" label="First Name" value="{!v.firstName}" /> </div> <div class="form-group"> <lightning:input name="lName" aura:id="lName" type="text" required="true" maxlength="50" label="Last Name" value="{!v.lastName}" /> </div> <br/> <lightning:button variant="brand" label="Submit" onclick="{!c.handleSubmit}" /> </div> </div> </aura:component>
Lightning JS Controller:
({ handleSubmit : function(component, event, helper) { //Find component and get value using component.find(); var fNameCmp = component.find("fName"); var lNameCmp = component.find("lName"); console.log('First Name : ' + fNameCmp.get("v.value")); console.log('Last Name : ' + lNameCmp.get("v.value")); //Get attribute value using component.get(); var fNameAttValue = component.get("v.firstName"); var lNameAttValue = component.get("v.lastName"); console.log('First Name : ' + fNameAttValue); console.log('First Name : ' + lNameAttValue); } })
-
Deepak
MemberFebruary 25, 2020 at 7:18 am in reply to: How to Perform a callout to send data to an external service in Salesforce ?Hi Kirandeep,
I'am going to perform a callout to send data to an external service in Salesforce by taking an example:
For instance, when you buy the latest Justin Bieber album or comment on your favorite “Cat in a Shark Costume Chases a Duck While Riding a Roomba” video, your browser is making a POST request to submit data.
Let’s see how we send data in Apex.
This example sends a POST request to the web service to add an animal name.The new name is added to the request body as a JSON string.
The request Content-Type header is set to let the service know that the sent data is in JSON format so that it can process the data appropriately.
The service responds by sending a status code and a list of all animals, including the one you added.
If the request was processed successfully, the status code returns 201, because a resource has been created.
The response is sent to the debug log when anything other than 201 is returned.
- Open the Developer Console from the Setup gear ( ).
- In the Developer Console, select Debug | Open Execute Anonymous Window.
- Delete any existing code and insert the following snippet.
- Select Open Log, and then click Execute.
- When the debug log opens, select Debug Only to view the output of the System.debug statement. The last item in the list of animals is "mighty moose".
Http http = new Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals'); request.setMethod('POST'); request.setHeader('Content-Type', 'application/json;charset=UTF-8'); // Set the body as a JSON object request.setBody('{"name":"mighty moose"}'); HttpResponse response = http.send(request); // Parse the JSON response if (response.getStatusCode() != 201) { System.debug('The status code returned was not expected: ' + response.getStatusCode() + ' ' + response.getStatus()); } else { System.debug(response.getBody()); }
Hope it helps.
-
Deepak
MemberFebruary 25, 2020 at 6:45 am in reply to: What is Database.Stateful used for in batch class in Salesforce?Hi Aditya,
You will need Database.Stateful is when the execute method modifies a class variable in such a way that it is to be used across multiple execute methods or in the finish method. The majority of batches you will write will not need Database.Stateful. It's important to know that using Database.Stateful will harm your batch's performance, because the class will be serialized at the end of each execute method to update its internal state. This extra serialization results in longer execution time.
If you're ever not sure if you need it, simply ask yourself two questions:
1 "Does one execute method need data from a previous execute method?"
2 "Does the finish method need data from any previous execute method?"
If the answer to both of these questions is no, then you do not need Database.Stateful.
If the answer is yes, then you may want to use Database.Stateful.
Fact is that there are alternative means to using Database.Stateful, such as storing data in a Custom Setting, which may offer better performance in some cases.
-
Deepak
MemberFebruary 25, 2020 at 6:35 am in reply to: How to Test callouts by using mock callouts ?Hi Kirandeep,
To test your callouts, use mock callouts by either implementing an interface or using static resources.
The static resource contains the response body to return.
While, when using a mock callout, the request isn't sent to the endpoint
-
Deepak
MemberFebruary 24, 2020 at 1:17 pm in reply to: What are the main things need to consider in the “Master-Detail Relationship” in Salesforce?Hi Ratnesh,
Parent child relationship is tightly coupled relationship having some below attributes as follows:
- Parent reference become mandatory for child object.
- Standard objects can't become child of any object.
- Master details support Cascaded delete: if you delete the parent, it can cascade delete the child.
- Sharing rules on child object's determined by parent.
- You can have only 2 master details relationship on an object in Salesforce.
- This reply was modified 4 years, 9 months ago by Deepak.
-
Deepak
MemberFebruary 24, 2020 at 1:13 pm in reply to: What is the business benefit of blockchain in Salesforce?Hi Shweta,
Blockchain enables new ways of sharing data across a network of organizations. It's a type of a database that helps businesses create a new, trusted architecture where they can more reliably and securely share data with different partners and keep track of it. Salesforce is riding the wave of this new technology.
-
Hi Shweta,
Tooling API exposes metadata used in developer tooling that you can access through REST or SOAP. For detailed descriptions of Tooling API objects and the REST resources and SOAP calls that each object supports, see Tooling API Objects. Use Tooling API when you need fine-grained access to an org's metadata.
-
Deepak
MemberFebruary 24, 2020 at 10:19 am in reply to: What is Utility Class in Salesforce and Why it is used?Hi Pooja,
Utility classes are helper classes that consisits of reusable methods. From triggers we can call methods in such public classes. This helps to reduce code with in trigger and make it more structured.
The purpose of a utility class is to serve as a single one-stop-shop for reusable pieces of code. Basically any variable, method, inner class and whatever it might be that is used multiple times across multiple other classes within the project, can reside into a single (or multiple) utility class or classes, which helps writing more elegant and structured code, as well as makes the code easier to maintain.
-
Deepak
MemberFebruary 24, 2020 at 10:09 am in reply to: What is difference insert() and database .insert() in Salesforce?Hi Ratnesh,
In case of DML statement (insert), in bulk operation if error occurs, the execution will stop and Apex code throws an error which can be handled in try catch block.
While in DML database methods (Database.insert) used, then if error occurs the remaining records will be inserted / updated means partial DML operation will be done. -
Deepak
MemberFebruary 21, 2020 at 2:56 pm in reply to: What is the use of remove(key) in map in Salesforce?Hi Pooja,
remove(key) - This method removes the mapping for the specified key from the map, if present, and returns the corresponding value
-
Deepak
MemberFebruary 21, 2020 at 2:54 pm in reply to: What is the use of values() in map in Salesforce?Hi Pooja,
values() - This method returns a list which contains all the values in the map.The values are returned in an arbitrary order.
-
Deepak
MemberFebruary 21, 2020 at 2:52 pm in reply to: What is the use of size() in map in Salesforce?Hi Pooja,
size() Returns the number of key-value pairs in the map.
-
Hi Anjali,
To enable the service console:
1. On the Salesforce Setup page, navigate to Administer > Manage Users > Users.
2. Click the Edit link for the desired user.
3. Select the Service Cloud User checkbox; then click Save.
Note: As an Admin, you must also have this permission.
4. In the Search box, search for Apps and click on the Apps link.
5. Select the Console option and then click Next.
6. Enter the following details:
App Label: The App label. For example, Gainsight Console.
App Name: The App name. For example, Gainsight_Console.
Description: A description of the App description.7. Click Next; select an image for your app using the Insert an Image button.
8. Click Next; add Accounts and Cockpit from Available Items to Selected Items.
Note: By default, Cases is already present.
9. Click Next; and select appropriate options for the items you just selected. If you want an item to appear as a primary tab, select As a primary tab. Otherwise, select As a subtab of.
10. Click Next; select profiles using the checkboxes available under the Visible column to make this console app visible.
11. Click Save. The console app now appears in the drop-down box on the top-right.
-
Hi Anjali,
Salesforce LiveMessage is a mobile messaging solution to provide personalized conversational service to your customers with the use of bots or agents. Salesforce LiveMessage is part of the Salesforce Service Cloud suite which you can include as an add-on on its Lightning Enterprise and Lightning Unlimited Editions.
-
Deepak
MemberFebruary 21, 2020 at 7:05 am in reply to: When we have to choose REST API and when the SOAP API in Salesforce?Hi Pooja,
I'am giving their difference in uses,please choose according to your requirements:
- REST:
REST is not a protocol, it is an architectural style
REST uses URL to expose the web service
REST allows different data formats: XML, JSON, plain text…
REST requires less bandwidth than SOAP
RESTful services inherits security measure from underlying transport layer
RESTful service can use SOAP web services as implementation
REST uses JSON. JSON is easier to parse than XML. Thus, REST uses less memory and CPU
REST is best for social media based Applications2.SOAP:
SOAP is best for Enterprise web applications, banking transactions.
SOAP cannot use RESTful services because SOAP is a protocol.
SOAP uses only XML. XML is harder to parse. SOAP uses more memory and CPU
SOAP is more reliable in terms of security than REST.
SOAP uses its own security measures. SOAP is based on standardized Web service security. Thus, better secured compared to REST.
SOAP requires more bandwidth than REST.
SOAP Allows Only XML format.
SOAP uses WSDL class to expose the web service.
SOAP is a protocol.
-
Deepak
MemberFebruary 20, 2020 at 2:26 pm in reply to: What is the use of <apex:tab> tab in Salesforce?Hi Pooja,
A single tab in an <apex:tabPanel>. The <apex:tab> component must be a child of a <apex:tabPanel>.
This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated <td> tag that wraps the tab's contents.
- This reply was modified 4 years, 9 months ago by Deepak.
-
Deepak
MemberFebruary 20, 2020 at 2:24 pm in reply to: What is syntax of auto-scroller in Lightning Component in Salesforce?Hi Marziya,
This works if you want manual scrolling,I want auto-scrolling on clicking of save button.
-
Deepak
MemberFebruary 20, 2020 at 2:22 pm in reply to: Can a trigger process multiple records at a time in Salesforce?Hi Anjali,
All triggers are bulk triggers by default, and can process multiple records at a time. You should always plan on processing more than one record at a time.
-
Hi Manish,
Salesforce Email Studio is a cloud-based, scalable, and powerful email marketing platform that is a component of the company's popular Marketing Cloud. It is a leading solution that assists companies in making smarter email campaigns by using data from all departments.
-
Deepak
MemberFebruary 20, 2020 at 2:17 pm in reply to: What is Dynamic Content in Salesforce Marketing Cloud?Hi Manish,
Dynamic content is content that displays in a content area according to the rules that you define based on the subscriber's attributes or data extension column values.
-
Deepak
MemberFebruary 20, 2020 at 1:23 pm in reply to: What is the role of Utility Methods in Salesforce ?Hi KIrandeep,
Utility methods perform common, re-used functions which are helpful for accomplishing routine programming tasks. Examples might include methods connecting to databases, performing string manipulations, sorting and searching of collections of data, writing/reading data to/from files etc.
-
Deepak
MemberFebruary 20, 2020 at 6:56 am in reply to: What is the use of userorgroupid in Salesforce?Hi Shubham,
When querying on a Share table, the "UserOrGroupId" returns an internal GroupId for criteria-based sharing rules.
This internal GroupId is used to facilitate the sharing operation and should not be exposed.
This issue only occurs on criteria-based sharing rules and on Implicit Shares.