Deepak
IndividualForum Replies Created
-
Deepak
MemberDecember 3, 2019 at 12:03 pm in reply to: How to display dynamic sosl query results on 3 objects values in single pageblocktable in Salesforce VF page ?You have to create a wrapper class in which you have to include those three objects and iterate the wrapper class in data table.
-
Deepak
MemberDecember 3, 2019 at 11:59 am in reply to: How to Write a Apex trigger on Event to autopopulate Title of Contacts in Salesforce?Custom button for creating Event can pass url query parameters and prepopulate field values.
Something like this works for Task:
/00T/e?
followup=1&
retURL=%2F{!Contact.Id}&
who_id={!Contact.Id}&
what_id={!Account.Id}&
tsk5=LVM&tsk6=Left+a+voicemail+for+{!Contact.Name}
&tsk5_fu=FU+VM+w+{!Contact.Name}+fr+{!Account.Name}&
tsk4_fu={!TODAY()+2}&
00NG0000008GDEN=Phones&
00NG0000008GDEN_fu=Phones+FU&
save=xand will replicate standard `Log A Call` button functionality to be under click of custom button `LVM`
-
Deepak
MemberDecember 3, 2019 at 11:57 am in reply to: How to export and import files related to Task object in Salesforce?Step 1) Prepare your import file
Create your CSV import file and include the columns listed below, then relate your activities to your existing Salesforce records:
WHOID (Name) - The record ID of the associated Contact or Lead.
WHATID (Related To) - The record ID of the associated Account, Opportunity, Contract, etc. Objects that allow you to track Activities can be set as the WhatID.
OWNERID (Assigned To) - The record ID of the user that owns this Task or Event.
Status - Only include this column when inserting Tasks. Set value to "Completed" for the record to appear under "Activity History."
StartDateTime and EndDateTime - Only include these columns when inserting Events. Events with a Start and End date/time in the past are automatically placed into the "Activity History."
Important: These fields require specific formatting as outlined in our Date and Date/Time value format documentation. Also, review the special considerations for each field in our Event Object Documentation.
Subject (and optionally Description)
For a full list of available fields, see our SOAP API Developer Guide Event Object documentation and Task Object documentation .For all of the previous relationships you must use the unique record Id to make a successful association. Because a lookup relationship is being created, simply inputting the record name will not work. You can get the Ids of the associated records by running and then exporting a report that included the Record Id column.
Step 2) Insert the records using the Data Loader
1. Log in to the Data Loader.
2. Select Insert.
3. Select Tasks or Events accordingly.
4. Locate the CSV file created on step of this process.
5. Click Create or Edit a map and map the Salesforce fields to the columns in your file.
6. Click Next.
7. Click Finish. -
Deepak
MemberDecember 3, 2019 at 11:52 am in reply to: How to implement Dynamic binding using the Salesforce lightning component?Welcome back All, here we will learn about the dynamic field of Lightning Component. As Most of you must be aware of that In Lightning, Component Dynamic component is not available. Recently I was working on one of my projects and implemented the Dynamic binding using the lightning component so I am going to share how I implemented the same so that it may help others.
As we all know that we can use the Dynamic Binding in the VisualForce page but in Lightning Component it is not Possible.
In this example, We will show the list of Objects in a picklist and when user will select any object it will dynamically show the TOP 15 records in a table.
Output
Step1 – Create Apex Class
DynamicBindingDemoController.class
[gist]bbdffd3849af765ecacab071e3edfb36[/gist]https://gist.github.com/amitastreait/bbdffd3849af765ecacab071e3edfb36.js
Step2 – Create the Lightning Component
DynamicBindingDemo.cmp
[gist]42e2f6b27c270e0ccd65d3f653f45683[/gist]See the comments into the component.
Step3: – Click on Controller from the right and paste the below code for Controller Javascript
DynamicBindingDemoController.js
[codesyntax lang=”javascript” container=”div” doclinks=”1″]({
doInit : function(component, event, helper) {
helper.onInit(component, event, helper);
},
doHandleChange : function(component, event, helper) {
helper.onHandleChange(component, event, helper);
},
})
[/codesyntax]Step4: – Click on Helper from the right and paste the below code for Helper Javascript
DynamicBindingDemoHelper.js
[gist]4ea5725d25651d4642ff91a67dda107a[/gist]See the comments.
Step5: – Create Lightning Application
DynamicBindingDemoApplication.app[codesyntax lang=”xml” container=”div” doclinks=”1″]
<aura:application access="Global" extends="force:slds" >
<c:DynamicBindingDemo />
</aura:application> -
Deepak
MemberDecember 3, 2019 at 10:27 am in reply to: How to create a report to compare current year sales vs. previous year sales in salesforce?Here's how to create a Custom Summary Formula to return period-over-period data comparisons within a report.
Example: Period-Over-Period Reports
Year-over-Year (YoY) - Track the progression of an individual's sales in 2018 compared to 2017 without needing to create any custom fields.
Quarter-over-Quarter (QoQ) - Track the progression of an individual's sales Q1 Last Year vs Q1 Today without needing to create any custom fields.
Resolution
These instructions use the Opportunities Object, but the principles apply to all Salesforce reporting.1. From 'Reports,' click New Report
2. Select the 'Opportunities' report type, then click Create.
3. Set the report as Matrix Format.
4. Drag Opportunity Owner as the primary 'Row Summary'
5. Drag the Close Date field into the 'Column Summary' | Hover over field Grouping | Click 'v' | select Group By | Group By Fiscal Year.
6. Once you have these, create a Custom Summary Formula field to calculate the value:1. Click Add Formula.
2. Enter a Column Name | select 'Format' as Percent
3. Ensure formula calculation occurs At a specific row/column grouping level...
4. Enter the following formulas accordingly.Year over Year:
AMOUNT:SUM/PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)
(Note: the same formula will be used for quarter over quarter progressive)Q1 (This Year) over Q1 (Prior Year):
AMOUNT:SUM/PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE,4)
Year on Year Change %:
( AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)) / PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)
Quarter-over-Quarter ( QoQ ) Change %:
( AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)) / PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE,4)7. Click Save As.
8. Enter your desired report name and saving location.
9. Click Save and Run Report.Note: #Error! is returned anytime a formula is dividing by zero. If your formula errors in this way, the denominator in the fraction has returned "0."
-
Deepak
MemberDecember 3, 2019 at 10:21 am in reply to: what are the use cases of system "change" event in Salesforce lightning component?This event is fired when an attribute value changes. Handle this event using the aura:handler tag. A component can have multiple aura:handler tags to detect changes to different attribute values.
<aura:handler name="change" value="{!v.items}" action="{!c.itemsChange}"/>
This example updates an attribute value, which fires the aura:valueChange event.<aura:component>
<aura:attribute name="myBool" type="Boolean" default="true"/><!-- Handle the aura:valueChange event -->
<aura:handler name="change" value="{!v.myBool}" action="{!c.handleValueChange}"/>
<lightning:button label="change value" onclick="{!c.changeValue}"/>
</aura:component>
The client-side controller actions trigger the value change and handle it.({
changeValue : function (component, event, helper) {
component.set("v.myBool", false);
},handleValueChange : function (component, event, helper) {
alert("old value: " + event.getParam("oldValue"));
alert("current value: " + event.getParam("value"));
}
})
The valueChange event gives you access to the previous value (oldValue) and the current value (value) in the handler action. In this example, oldValue returns true and value returns false. -
Deepak
MemberDecember 3, 2019 at 10:20 am in reply to: what are the types of event to use in Salesforce lightning component?Event-driven programming is used in many languages and frameworks, such as JavaScript and Java Swing. The idea is that you write handlers that respond to interface events as they occur.
A component registers that it may fire an event in its markup. Events are fired from JavaScript controller actions that are typically triggered by a user interacting with the user interface.There are two types of events in the framework:
Component events are handled by the component itself or a component that instantiates or contains the component.
Application events are handled by all components that are listening to the event. These events are essentially a traditional publish-subscribe model. -
Deepak
MemberDecember 2, 2019 at 2:16 pm in reply to: when to use .get() in Salesforce lightning component ?Get an Attribute Value
get(String key) and component. set(String key, Object value) retrieves and assigns values associated with the specified key on the component. Keys are passed in as an expression, which represents an attribute value. To retrieve an attribute value of a component reference, use component. -
Deepak
MemberDecember 2, 2019 at 2:15 pm in reply to: When to use .find() in Salesforce lightning component?The find() function has one parameter, which is the local ID of a component within the markup. find() returns different types depending on the result. If the local ID is unique, find() returns the component. If there are multiple components with the same local ID, find() returns an array of the components.
-
1. Accidental or malicious deletion can occur when a user inadvertently or intentionally deletes one or more records. An individual record can easily be deleted by clicking on the delete button located on an object page. Multiple records can be deleted at one time with the mass delete utility
2. Bad code can make incorrect changes to many records. Developers plan and test their code to avoid mistakes but program errors still happen. Not every actual scenario is always covered so code can sometimes have unexpected results. These changes can be very difficult to identify and even harder to fix.
3. Data import gone wrong will have a far-reaching impact. Tools like the data import wizard and data loader allow users to update records in a single operation. Unfortunately an incorrect mapping can yield bad values in a large number of records.
4. SOQL mistake can happen in an instant. The developer console query editor can be used to execute queries and the wrong syntax can create a serious problem. An update query is designed to potentially impact large number of records so a backup should always be run prior to any mass update.
5. Problems with an integration could inadvertently update the wrong records. There are some very powerful integration tools for Salesforce that can update hundreds, thousands or even millions of records through automated processing. Without a current backup, an integration error of this magnitude could be impossible to recover from. -
Deepak
MemberNovember 29, 2019 at 4:07 pm in reply to: How to update chatter comment in custom field of related object in Salesforce?Please go through this link:
https://success.salesforce.com/answers?id=9063A000000ifMxQAI
-
Deepak
MemberNovember 29, 2019 at 4:05 pm in reply to: How to create many new records without DML error in Salesforce?Do not have DML statements or SOQL queries inside of your FOR loop
Try not to use SOQL or DML operations inside a loop
Try to bulkify your code and your helper methods
Can query large data sets
If you are working for 50,000 records, use Batch Apex
Streamline various triggers on the same object
Use Streamlining Queries and collections for loops
In order to avoid hitting Governor Limits, use limits Apex methods -
Deepak
MemberNovember 29, 2019 at 4:03 pm in reply to: How to create Batch Apex Class to Update Monthly Hours Summaries for Last Month in Salesforce?You have to query your record for last month then pass the list to execute method to update where you have written your code for updating the summary.
Please go through this link:
https://developer.salesforce.com/forums/?id=9062I000000IEIhQAO
-
Deepak
MemberNovember 27, 2019 at 4:30 pm in reply to: How to convert a set of records into a list of records in Salesforce?Go through this link:
https://developer.salesforce.com/forums/?id=9060G0000005oYsQAI
-
Deepak
MemberNovember 26, 2019 at 2:11 pm in reply to: What type of relationship should be built for a one-to-one in Salesforce?introducing SOAP API
Salesforce provides programmatic access to your org’s information using simple, powerful, and secure application programming interfaces. To use this document, you should have a basic familiarity with software development, Web services, and the Salesforce user interface.Any functionality described in this guide is available if your organization has the API feature enabled. This feature is enabled by default for Performance, Unlimited, Enterprise, and Developer Editions. Some Professional Edition organizations may also have the API enabled. If you cannot access the features you see in this guide, contact Salesforce.
Salesforce Education Services offers a suite of training courses to enable developers to design, create, integrate, and extend applications built on the Lightning platform. Be sure to visit http://www.salesforce.com/training to learn more.
When to Use the SOAP API
The Salesforce prebuilt applications provide powerful CRM functionality. In addition, Salesforce provides the ability to customize the prebuilt applications to fit your organization. However, your organization may have complex business processes that are unsupported by the existing functionality. In this case, Lightning Platform provides various ways for advanced administrators and developers to build custom functionality. These include the SOAP API, Apex, and Visualforce.SOAP API
Use SOAP API to create, retrieve, update or delete records, such as accounts, leads, and custom objects. With more than 20 different calls, SOAP API also allows you to maintain passwords, perform searches, and much more. Use SOAP API in any language that supports Web services.
REST API
REST API provides a powerful, convenient, and simple REST-based web services interface for interacting with Salesforce. Its advantages include ease of integration and development, and it’s an excellent choice of technology for use with mobile applications and web projects. For certain projects, you may want to use REST API with other Salesforce REST APIs. To build UI for creating, reading, updating, and deleting records, including building UI for list views, actions, and dependent picklists, use User Interface API. To build UI for Chatter, communities, or recommendations, use Chatter REST API. If you have many records to process, consider using Bulk API, which is based on REST principles and optimized for large sets of data.
Bulk API
Bulk API is based on REST principles and is optimized for loading or deleting large sets of data. You can use it to query, queryAll, insert, update, upsert, or delete many records asynchronously by submitting batches. Salesforce processes batches in the background.SOAP API, in contrast, is optimized for real-time client applications that update a few records at a time. You can use SOAP API for processing many records, but when the data sets contain hundreds of thousands of records, SOAP API is less practical. Bulk API is designed to make it simple to process data from a few thousand to millions of records.
Metadata API
Use Metadata API to retrieve, deploy, create, update, or delete customizations for your org. The most common use is to migrate changes from a sandbox or testing org to your production environment. Metadata API is intended for managing customizations and for building tools that can manage the metadata model, not the data itself.The easiest way to access the functionality in Metadata API is to use the Salesforce Extensions for Visual Studio Code or the Ant Migration Tool. Both tools are built on top of Metadata API and use the standard tools to simplify working with Metadata API.
The Salesforce Extensions for Visual Studio Code includes tools for developing on the Salesforce platform in the lightweight, extensible VS Code editor. These tools provide features for working with development orgs (scratch orgs, sandboxes, and DE orgs), Apex, Aura components, and Visualforce.
The Ant Migration Tool is ideal if you use a script or the command line for moving metadata between a local directory and a Salesforce org.
Apex
Use Apex if you want to:Create Web services.
Create email services.
Perform complex validation over multiple objects.
Create complex business processes that are not supported by workflow.
Create custom transactional logic (logic that occurs over the entire transaction, not just with a single record or object).
Attach custom logic to another operation, such as saving a record, so that it occurs whenever the operation is executed, regardless of whether it originates in the user interface, a Visualforce page, or from SOAP API.
For more information, see the Apex Developer Guide.
Visualforce
Visualforce consists of a tag-based markup language that gives developers a more powerful way of building applications and customizing the Salesforce user interface. With Visualforce you can:Build wizards and other multistep processes.
Create your own custom flow control through an application.
Define navigation patterns and data-specific rules for optimal, efficient application interaction.
For more information, see the Visualforce Developer's Guide.
Customize, Integrate, and Extend Your Salesforce Solutions
The Lightning platform allows you to customize, integrate, and extend your Salesforce organization using the language and platform of your choice:Customize Salesforce with custom fields, links, objects, page layouts, buttons, record types, s-controls, and tabs to meet specific business requirements.
Integrate Salesforce with your organization’s ERP and finance systems, deliver real-time sales and support information to company portals, and populate critical business systems with customer information.
Extend Salesforce in presentation, business logic, and data services with new functionality that reflects the business requirements of your organization.
For more information about Lightning Platform solutions, developer resources, and community resources, go to Salesforce Developers.
Supported Salesforce Editions
To use SOAP API, your organization must use Enterprise Edition, Performance Edition, Unlimited Edition, or Developer Edition. If you are an existing Salesforce customer and want to upgrade to Enterprise, Unlimited, or Performance Edition, contact your account representative.To develop Web service client applications, it is strongly recommended that you use Developer Sandbox, which is an exact replica of your Salesforce deployment, including all customization and data. For more information, see http://www.salesforce.com/products/sandbox.jsp.
Developer Edition provides access to all of the features available with Enterprise Edition. Developer Edition is constrained only by the number of users and the amount of storage space. Developer Edition provides a development context that allows you to build and test your solutions without affecting your organization’s live data. Developer Edition accounts are available for free at https://developer.salesforce.com/page/Getting_Started.
Standards Compliance
SOAP API is implemented to comply with the following specifications:Standard Name
Website
Simple Object Access Protocol (SOAP) 1.1Web Service Description Language (WSDL) 1.1
http://www.w3.org/TR/2001/NOTE-wsdl-20010315
WS-I Basic Profile 1.1
http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html
Development Platforms
SOAP API works with current SOAP development environments, including, but not limited to, Visual Studio .NET 2005. In this document, we provide examples in Java and C# (.NET). The Java examples are based on WSC 20.0 (WSC) and JDK 6 (Java Platform Standard Edition Development Kit 6). Additional versions of WSC are available at https://github.com/forcedotcom/wsc and http://mvnrepository.com/artifact/com.force.api/force-wsc. To see a complete list of compatible development platforms and more sample code, go to developer.salesforce.com.Development platforms vary in their SOAP implementations. Implementation differences in certain development platforms might prevent access to some or all of the features in the API. If you are using Visual Studio for .NET development, we recommend that you use Visual Studio 2003 or higher.
SOAP API Support Policy
Salesforce recommends that your new client applications use the most recent version of the Lightning Platform WSDL file to fully exploit the benefits of richer features and greater efficiency. You can navigate to the most recent WSDL for your organization from Setup by entering API in the Quick Find box, then selecting API. When a new version is released, use the following steps in Quick Start to update your WSDL:Regenerate the WSDL file (see Step 2: Generate or Obtain the Web Service WSDL)
Import it into your environment (see Step 3: Import the WSDL File Into Your Development Platform)
Backward Compatibility
Salesforce strives to make backward compatibility easy when using the Lightning platform.Each new Salesforce release consists of two components:
A new release of platform software that resides on Salesforce systems
A new version of SOAP API
For example, the Winter ’07 release included SOAP API version 9.0 and the Summer ’07 release included SOAP API version 10.0.We maintain support for each SOAP API version across releases of the platform software. SOAP API is backward compatible in that an application created to work with a given SOAP API version will continue to work with that same SOAP API version in future platform software releases.
Salesforce does not guarantee that an application written against one SOAP API version will work with future SOAP API versions: Changes in method signatures and data representations are often required as we continue to enhance SOAP API. However, we strive to keep SOAP API consistent from version to version with minimal if any changes required to port applications to newer SOAP API versions.
For example, an application written using SOAP API version 9.0 which shipped with the Winter ’07 release will continue to work with SOAP API version 9.0 on the Summer ’07 release and on future releases beyond that. However, that same application may not work with SOAP API version 10 without modifications to the application.
SOAP API End-of-Life
Salesforce is committed to supporting each SOAP API version for a minimum of three years from the date of first release. In order to improve the quality and performance of SOAP API, versions that are more than three years old may cease to be supported.When a SOAP API version is scheduled to be unsupported, an advance end-of-life notice will be given at least one year before support for SOAP API version is ended. Salesforce will directly notify customers using SOAP API versions scheduled for end of life.
Choosing a WSDL
There are two Lightning Platform Web services for which you can obtain WSDL files for API access:Lightning Platform Enterprise WSDL—This API is for most enterprise users who are developing client applications for their organization. The enterprise WSDL file is a strongly typed representation of your organization’s data. It provides information about your schema, data types, and fields to your development environment, allowing for a tighter integration between it and the Lightning Platform Web service. This WSDL changes if custom fields or custom objects are added to, renamed, or removed from, your organization’s Salesforce configuration. If you are downloading an enterprise WSDL and you have managed packages installed in your organization, you need to take an extra step to select the version of each installed package to include in the generated WSDL.Note the following when generating the enterprise WSDL:If new custom fields or objects are added to, renamed, or removed from your organization’s information, you need to regenerate the WSDL file in order to access them.
The generated WSDL contains the objects and fields in your organization, including those available in the selected versions of each installed package. If a field or object is added in a later package version, you must generate the enterprise WSDL with that package version to work with the object or field in your API integration.
Lightning Platform Partner WSDL—This API is for Salesforce partners who are developing client applications for multiple organizations. As a loosely-typed representation of the Salesforce object model, the partner WSDL can be used to access data within any organization.
Related Resources
The Salesforce developer website provides a full suite of developer toolkits, sample code, sample SOAP messages, community-based support, and other resources to help you with your development projects. Be sure to visit https://developer.salesforce.com/page/Getting_Started for more information, or visit https://developer.salesforce.com/signup to sign up for a free Developer Editi -
Deepak
MemberNovember 26, 2019 at 2:10 pm in reply to: How is access granted through the Role Hierarchy in salesforce?Sharing Settings in the Quick Find box, then select Sharing Settings. Next, click Edit in the Organization Wide Defaults section. Deselect Grant Access Using Hierarchies if you want to prevent users from gaining automatic access to data owned by or shared with their subordinates in the hierarchies. Setting the organization-wide sharing defaults for each object, you can specify whether users have access to the data owned by or shared with their subordinates in the hierarchy. For example, the role hierarchy automatically grants record access to users above the record owner in the hierarchy.
-
Deepak
MemberNovember 25, 2019 at 2:39 pm in reply to: Can we change the length of 'Opportunity Name' field in salesforce ?Please go through this link:
https://success.salesforce.com/answers?id=9063A000000ZnrSQAS
-
Deepak
MemberNovember 25, 2019 at 2:38 pm in reply to: What is the reason of Error 'A workflow or approval field update caused an error' when saving a record in Salesforce?This error can occur if there is a workflow or approval process that does a field update and that update violates any field data type constraints.
Example:
Let us say we have a text field with length as 5 and the workflow field update tries to update with a value greater than 5, then you will get this error.
The resolution would be to make sure that update done by the workflow or approval process doesn't violate any field data type constraints. In the example above, the workflow field update should be modified to update with a value lower or equal to 5 characters.
Increase the length of the "Field to Update" field to accept the new value.
-
Deepak
MemberNovember 23, 2019 at 5:13 pm in reply to: How to validate package from VS code in Salesforce?Please go through this link:
-
Deepak
MemberNovember 22, 2019 at 1:20 pm in reply to: What is the difference between Document and ContentDocument in salesforce?Entities of type Document are the same as what show up in the UI under the Document tab. ContentDocument consists of entities in your content workspaces. They don't intersect.
-
Deepak
MemberNovember 22, 2019 at 1:19 pm in reply to: What happen on Content Document Link if we upload Salesforce Files from record?Please go through this link:
http://www.shelovestocode.com/2018/10/what-happen-on-content-document-link-if.html
-
Deepak
MemberNovember 20, 2019 at 2:00 pm in reply to: How to use static custom label in Salesforce lightning component?{!$Label.c.labelName}
-
Deepak
MemberNovember 20, 2019 at 1:59 pm in reply to: How to restrict Parent account of a Community user in Salesforce?change the license of the user to customer user.
-
Deepak
MemberNovember 20, 2019 at 1:58 pm in reply to: Is there a way in Apex code to query/access the documents? When an user has uploaded in their Salesforce org?You can query contentdocument for the user to get anything uploaded by him.
-
Deepak
MemberNovember 20, 2019 at 1:56 pm in reply to: What actions can be triggered by mouse-over in Salesforce?Go through this link:
https://developer.salesforce.com/forums/?id=906F0000000AX8iIAG