shariq
IndividualForum Replies Created
-
shariq
MemberSeptember 19, 2018 at 7:57 AM in reply to: How to get all the fields of Sobject using Dynamic Salesforce Apex?Hi,
You can use the methods of schema class. Below is a snippet of code that you can use :
Map<String, Schema.SObjectType> m = Schema.getGlobalDescribe() ;
Schema.SObjectType s = m.get('API_Name_Of_SObject') ;
Schema.DescribeSObjectResult r = s.getDescribe() ;
Map<String,Schema.SObjectField> fields = r.fields.getMap();
Thanks
-
shariq
MemberSeptember 19, 2018 at 7:47 AM in reply to: Other than SOQL and SOSL, what Is the way to get custom settings in Salesforce?Hi,
Other than SOQL or SOSL, Custom settings have their own set of methods to access the record.
For example:
If there is custom setting of name ISO_Country, SO_Country__c code = ISO_Country__c.getInstance(‘INDIA’);
//To return a map of data sets defined for the custom object (all records in the custom object), //you would use: Map<String,ISO_Country__c> mapCodes = ISO_Country__c.getAll();
// display the ISO code for India
System.debug(‘ISO Code: ‘+mapCodes.get(‘INDIA’).ISO_Code__c);
//Alternatively you can return the map as a list:
List<String> listCodes = ISO_Country__c.getAll().values();
Thanks
-
shariq
MemberSeptember 19, 2018 at 7:43 AM in reply to: How to round the Double to two decimal places In Salesforce Apex?Hi,
Use the below snippet of code :
Decimal d = 100/3;
Double ans = d.setScale(2);
Thanks
-
shariq
MemberSeptember 19, 2018 at 7:40 AM in reply to: What is the difference between Count() And Count(fieldname) In Salesforce SOQL?Hi,
COUNT() :
COUNT() must be the only element in the SELECT list.
You can use COUNT() with a LIMIT clause.
You can’t use COUNT() with an ORDER BY clause. Use COUNT(fieldName) instead.
You can’t use COUNT() with a GROUP BY clause for API version 19.0 and later. Use COUNT(fieldName) instead.
Thanks
-
Hi,
It is used to set the context to current page, normally used for testing the visual force controller.
Thanks
-
shariq
MemberSeptember 19, 2018 at 7:36 AM in reply to: What Are Limitations Of Salesforce Reports?Hi,
Support for trend analysis in Salesforce is fairly limited.
User Interface of Salesforce reports and dashboards is fixed. Salesforce does not support pixel perfect report.
Salesforce reports do not support importing data from other sources When displaying objects and their children, Salesforce does not support reporting on objects that do not have any children.
If an object has two different related lists, then Salesforce reporting does not support displaying both these related lists together.
Thanks
-
shariq
MemberSeptember 19, 2018 at 2:11 AM in reply to: Which parsing method is better - Deserialisation or JSON Parser? And Why?Hi,
I would Use JSON Deserialization.
jsonStr = '{//some JSON data}'
JSONParser parser = JSON.createParser(jsonStr);
String text = '';
while (parser.nextToken() != null) {
if(parser.getCurrentToken() == JSONToken.START_OBJECT){
parser.nextToken();
text = parser.getText() + ', ' + text;
}
//System.debug(parser.getText() + parser.nextToken() + ' - ' + parser.getText());
if (parser.getCurrentToken() == JSONToken.START_ARRAY) {
//parser.nextToken();
text = parser.getText() + ', ' + text;
}
}Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 2:08 AM in reply to: What are the limitations of Lightning Experience in Salesforce?Hi,
Limitations With Standard Components
While the core Lightning Out functionality is stable and complete, there are a few interactions with other Salesforce features that we’re still working on.Chief among these is the standard components built into the Lightning Component framework. Many standard components don’t behave correctly when used in a stand-alone context, such as Lightning Out, and Lightning Components for Visualforce, which is based on Lightning Out. This is because the components implicitly depend on resources available in the one.app container.
Avoid this issue with your own components by making all of their dependencies explicit. Use ltng:require to reference all required JavaScript and CSS resources that aren’t embedded in the component itself.
If you’re using standard components in your apps, they might not be fully styled, or behave as documented, when they’re used in Lightning Out or Lightning Components for Visualforce.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 2:05 AM in reply to: In which situation we should avoid using Future method in Salesforce?Hi,
Future Apex. - Future Apex is used to run processes in a separate thread, at a later time when system resources become available. Note: Technically, you use the @future annotation to identify methods that run asynchronously.
A future method runs in the background, asynchronously. You can call a future method for executing long-running operations, such as callouts to external Web services or any operation you’d like to run in its own thread, on its own time. You can also make use of future methods to isolate DML operations on different sObject types to prevent the mixed DML error. Each future method is queued and executes when system resources become available. That way, the execution of your code doesn’t have to wait for the completion of a long-running operation. A benefit of using future methods is that some governor limits are higher, such as SOQL query limits and heap size limits.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 2:03 AM in reply to: How to Set Up Governor Limit Email Warnings in Salesforce?Hi,
Set Up Governor Limit Email Warnings
- Log in to Salesforce as an administrator user.
- From Setup, enter Users in the Quick Find box, then select Users.
- Click Edit next to the name of the user to receive the email notifications.
- Select the Send Apex Warning Emails option.
- Click Save.
Hope this helps.
-
Hi,
Limits Methods
The following are methods for Limits. All methods are static.- getAggregateQueries()
Returns the number of aggregate queries that have been processed with any SOQL query statement. - getLimitAggregateQueries()
Returns the total number of aggregate queries that can be processed with SOQL query statements. - getAsyncCalls()
Reserved for future use. - getLimitAsyncCalls()
Reserved for future use. - getCallouts()
Returns the number of Web service statements that have been processed. - getChildRelationshipsDescribes()
Deprecated. Returns the number of child relationship objects that have been returned. - getLimitCallouts()
Returns the total number of Web service statements that can be processed. - getCpuTime()
Returns the CPU time (in milliseconds) accumulated on the Salesforce servers in the current transaction. - getLimitCpuTime()
Returns the time limit (in milliseconds) of CPU usage in the current transaction. - getDMLRows()
Returns the number of records that have been processed with any statement that counts against DML limits, such as DML statements, the Database.emptyRecycleBin method, and other methods. - getLimitDMLRows()
Returns the total number of records that can be processed with any statement that counts against DML limits, such as DML statements, the database.EmptyRecycleBin method, and other methods. - getDMLStatements()
Returns the number of DML statements (such as insert, update or the database.EmptyRecycleBin method) that have been called. - getLimitDMLStatements()
Returns the total number of DML statements or the database.EmptyRecycleBin methods that can be called. - getEmailInvocations()
Returns the number of email invocations (such as sendEmail) that have been called. - getLimitEmailInvocations()
Returns the total number of email invocation (such as sendEmail) that can be called. - getFindSimilarCalls()
Deprecated. Returns the same value as getSoslQueries. The number of findSimilar methods is no longer a separate limit, but is tracked as the number of SOSL queries issued. - getLimitFindSimilarCalls()
Deprecated. Returns the same value as getLimitSoslQueries. The number of findSimilar methods is no longer a separate limit, but is tracked as the number of SOSL queries issued. - getFutureCalls()
Returns the number of methods with the future annotation that have been executed (not necessarily completed). - getLimitFutureCalls()
Returns the total number of methods with the future annotation that can be executed (not necessarily completed). - getHeapSize()
Returns the approximate amount of memory (in bytes) that has been used for the heap. - getLimitHeapSize()
Returns the total amount of memory (in bytes) that can be used for the heap. - getMobilePushApexCalls()
Returns the number of Apex calls that have been used by mobile push notifications during the current metering interval. - getLimitMobilePushApexCalls()
Returns the total number of Apex calls that are allowed per transaction for mobile push notifications. - getQueries()
Returns the number of SOQL queries that have been issued. - getLimitQueries()
Returns the total number of SOQL queries that can be issued. - getQueryLocatorRows()
Returns the number of records that have been returned by the Database.getQueryLocator method. - getLimitQueryLocatorRows()
Returns the total number of records that can be returned by the Database.getQueryLocator method. - getQueryRows()
Returns the number of records that have been returned by issuing SOQL queries. - getLimitQueryRows()
Returns the total number of records that can be returned by issuing SOQL queries. - getQueueableJobs()
Returns the number of queueable jobs that have been added to the queue per transaction. A queueable job corresponds to a class that implements the Queueable interface. - getLimitQueueableJobs()
Returns the maximum number of queueable jobs that can be added to the queue per transaction. A queueable job corresponds to a class that implements the Queueable interface. - getRunAs()
Deprecated. Returns the same value as getDMLStatements. - getLimitRunAs()
Deprecated. Returns the same value as getLimitDMLStatements. - getSavepointRollbacks()
Deprecated. Returns the same value as getDMLStatements. - getLimitSavepointRollbacks()
Deprecated. Returns the same value as getLimitDMLStatements. - getSavepoints()
Deprecated. Returns the same value as getDMLStatements. - getLimitSavepoints()
Deprecated. Returns the same value as getLimitDMLStatements. - getSoslQueries()
Returns the number of SOSL queries that have been issued. - getLimitSoslQueries()
Returns the total number of SOSL queries that can be issued.
Hope this helps.
- getAggregateQueries()
-
shariq
MemberSeptember 19, 2018 at 1:58 AM in reply to: What are cloud pages in marketing cloud in Salesforce?Hi,
CloudPages in an application from the Salesforce Marketing Cloud that makes managing content for web and apps easy. Create facebook tabs, landing pages hosted by the Marketing Cloud or directed towards your private domain, microsites, and MobilePush pages – wherever your audience may be
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:58 AM in reply to: What are hard bounce and soft bounce in email bounce management in Salesforce?Hi,
A soft bounce message may be deliverable at another time or may be forwarded manually by the network administrator in charge of redirecting mail on the recipient's domain. A Hard Bounce is an email that permanently bounced back to the sender because the address is invalid.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:57 AM in reply to: Why should we use Salesforce Marketing Cloud when we can send emails using workflow and process builder?Hi,
There are limitation in workflow, process builder and apex which is less in marketing cloud.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:54 AM in reply to: What are the advantages of using Automation studio in Salesforce Marketing Cloud?Hi,
Automation studio has a fixed path, and new people can not join until the path is complete, so if you wanted to send a 3 email series over 5 days, new people could not join until after the 5 day series is complete. I currently use Automation Studio to import new data and add it to a data extention and finish it off with a Fire event so it will send the data to a Journey Builder event, that way I can add new people to the Journey daily. Journey Builder is extremely limited in its reporting however.
Hope this helps.
-
This reply was modified 7 years, 6 months ago by
shariq.
-
This reply was modified 7 years, 6 months ago by
-
shariq
MemberSeptember 19, 2018 at 1:50 AM in reply to: What is the use of setcallback() method in lightning components in Salesforce?Hi,
Basically, the setCallback() function sets a function to run after the action finishes. You might be wondering why we can't just call getReturnValue() on the action right after enqueuing it and why the setCallback() function is even necessary.
setCallback() has a third parameter that registers the action state that will invoke the callback. If you don't specify the third argument for setCallback() , it defaults to registering the SUCCESS and ERROR states. To set a callback for another state, such as ABORTED , you can call setCallback() multiple times with the action state set explicitly in the third argument. For example:
action.setCallback(this, function(response) { ...}, "ABORTED");
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:48 AM in reply to: How to perform soap callout in Salesforce using https?Hi,
Use WSDL2Apex to Generate Apex Code
In addition to REST callouts, Apex can also make callouts to SOAP web services using XML. Working with SOAP can be a painful (but necessary) experience. Fortunately, we have tools to make the process easier.
WSDL2Apex automatically generates Apex classes from a WSDL document. You download the web service’s WSDL file, and then you upload the WSDL and WSDL2Apex generates the Apex classes for you. The Apex classes construct the SOAP XML, transmit the data, and parse the response XML into Apex objects. Instead of developing the logic to construct and parse the XML of the web service messages, let the Apex classes generated by WSDL2Apex internally handle all that overhead. If you are familiar with WSDL2Java or with importing a WSDL as a Web Reference in .NET, this functionality is similar to WSDL2ApexGenerate an Apex Class from the WSDL
- From Setup, enter Apex Classes in the Quick Find box, then click Apex Classes.
- Click Generate from WSDL.
- Click Choose File and select the downloaded calculator.xml file.
- Click Parse WSDL. The application generates a default class name for each namespace in the WSDL document and reports any errors.For this example, use the default class name. However, in real life it is highly recommended that you change the default names to make them easier to work with and make your code more intuitive.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:44 AM in reply to: What is source code versioning in Salesforce?Hi,
environments. The repository, such as Git or Apache Subversion (SVN), helps integrate the changes that were implemented by concurrent development and separates the different versions of an application.
The source control repository contains a copy of your entire organization’s metadata as exposed by Metadata API. Team members can add their customizations, such as custom objects, fields, and reports, and Apex or Visualforce code to the source control repository. These changes are then merged with changes that were made by other team members or developers on other teams. A source control system ensures a quality development process and has many other benefits, including the ability to deploy only a specific version of customizations, and maintaining a separate branch for each project without overwriting customization done as part of other projects.
In the source control system that you use, such as Git, you can create a repository with multiple branches. Each branch contains a set of changes that are developed by a separate team. For example, one team of developers might be working on a feature that’s going live in February. Another team might be working on a feature that’s going live in March. These teams need separate Developer organizations and integration test sandboxes. In addition, because patch releases contain bug fixes and therefore different customization metadata and Apex code than new features, use a separate branch for a patch release.
You can use the Ant Migration Tool to retrieve a copy of your organization’s metadata to commit to source control. Conversely, the Ant Migration Tool can be used to deploy metadata that’s saved in source control to an organization.
Hope this helps. -
Hi,
Adding more -
Note - To create, refresh, activate, and delete sandbox user should have “Modify All Data” permission.
We can create sandbox only from Production.sandbox option available under DataManagement in Production.The number of sandbox's we can create depends on the license which we have.There are 3 types of Sandbox we can create.
1.Developer.
2.Configuration only.(Developer Pro Sandbox)
3.Full sandbox.(which is exact copy of Production including data).Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:40 AM in reply to: How to authorize a deployment connection in an Salesforce?Hi,
- Log into the organization that'll receive inbound change sets.
- From Setup, enter Deployment in the Quick Find box, then select Deployment Settings.
- Click Edit next to the organization from which you want to receive outbound change sets.
- Select Allow Inbound Changes and click Save.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:40 AM in reply to: What is Business Unit Management in Salesforce marketing cloud?Hi,
Adding More -
Business can are particularly useful seperating your SFMC org either by Geography or Business Lines. In addition , marketing cloud does not come with a test environment and to "kind of " recreate this, you need an extra business unit.
Pros:
You can determine which business units each your users have permission to seperate business units in the "Admin" section, which work well for your use case.
You can seperate customer data between different business units, which sometimes is a regulatory requirement.
You can control user accessCons
With the exception of shared contents and data extensions, manually copying shared process between business units is not an easier task. You would have to either do this manually (which can be tedious) or via the API (not beginner level stuff - great people have failed)
When you have to work with Salesforce.com, you would have to enable Multi-org within your instance, which breaks profile personalization. Then you are at the mercy of the 15 mins polling time.Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:37 AM in reply to: What are the limitations of the data import wizard in Salesforce?Hi,
Is designed for less-technical users and smaller, simple imports of up to 50,000 records.
Can only import data of : Account , Contact ,Leads , Solution, and Custom Object.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:32 AM in reply to: What are the advantages of using CLI in Salesforce?Hi,
For automated batch operations such as nightly scheduled loads and extractions, we run Data Loader from the command line.
Data Loader interactively to import and export data, you can run it from the command line.
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:24 AM in reply to: How to pass parameters by reference and by value in Salesforce Apex?Hi,
In Apex, all primitive data type arguments, such as Integer or String, are passed into methods by value. This means that any changes to the arguments exist only within the scope of the method. When the method returns, the changes to the arguments are lost.
Non-primitive data type arguments, such as sObjects, are also passed into methods by value. This means that when the method returns, the passed-in argument still references the same object as before the method call, and can’t be changed to point to another object. However, the values of the object’s fields can be changed in the method.
“Pass by reference” means when a method is called, that actual variable is passed to the method
Hope this helps.
-
shariq
MemberSeptember 19, 2018 at 1:22 AM in reply to: How to include static resource in lightning component in Salesforce?Hi,
To use static resources in Lightning Application in salesforce, implement the application as follows:
<aura:application>
<link href=’/resource/bootstrap/’ rel=”stylesheet”/>
<div class=”navbar navbar-default navbar-static-top” role=”navigation”>
<div class=”container”>
<div class=”navbar-header”>
Lightning Contacts
</div>
</div>
</div><div class=”container”>
<div class=”row”>
<div class=”col-sm-12″>
Contact list goes here
</div>
</div>
</div></aura:application>
Hope this helps.