Forum Replies Created

Page 39 of 57
  • shariq

    Member
    September 17, 2018 at 6:33 PM in reply to: Difference between Dev-401 & Developer-1 Certification.

    Hi,

    To add more -

    Developer 401 is succeeded by App Builder. Developer 501 is succeeded by two exams namely Platform Developer 1 and Platform Developer 2.

    If you hold Developer 401, you can take a transition exam and get the App Builder certification.

    If you hold Developer 501, you can take transition exams of Platform Developer 1 and 2.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 6:31 PM in reply to: Can we include one lightning component to another ?

    Hi,

    Yes you can - 

    Hope this helps

  • shariq

    Member
    September 17, 2018 at 6:28 PM in reply to: Cloud Flow Designer

    Hi,

    The Cloud Flow Designer is a tool that allows you to implement business requirements by constructing Flows (without any code); this is a way to collect, update, edit, and create data in Salesforce. The Cloud Flow Designer user interface has different functional parts.

    Hope this helps.

  • Hi,

    To add more -

    Best Practice - 

    If using AssertEquals, the expected result should be the first argument, the actual result should be the second argument. If you don’t pay attention, this can cause debugging problems later along the lines

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 5:48 PM in reply to: What is the use of System.assertEquals() in Salesforce?

    Hi,

    System.AssertEquals and System.AssertNotEquals both accepts three parameters; the first two (mandatory) are the variables that will be tested for in/equality and the third (optional) is the message to display if the assert results in false.

    example -

    static testMethod void runNegativeTestCases(){
    User u3 = [select id from User where alias='tuser'];
    System.RunAs(u3)
    {
    System.debug('Inserting a record with 501 miles... (negative test case)');

    Mileage__c testMiles3 = new Mileage__c( Miles__c = 501, Date__c = System.today() );
    try{

    insert testMiles3;

    }catch (DmlException e){

    //Assert Error Message

    System.assert( e.getMessage().contains('Insert failed. First exception on ' +'row 0; first error:FIELD_CUSTOM_VALIDATION_EXCEPTION,'+'Mileage request exceeds daily limit(500): [Miles__c]'),e.getMessage() );

    //Assert field

    System.assertEquals(Mileage__c.Miles__c, e.getDmlFields(0)[0]);

    //Assert Status Code

    System.assertEquals('FIELD_CUSTOM_VALIDATION_EXCEPTION' , e.getDmlStatusCode(0) );

    } //catch

    } //RunAs(u3)

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 5:48 PM in reply to: What are some use cases for using the Schema class in Salesforce?

    Hi,

    Here is the code which gives best use case of schema for getting fields -

    public Void GetAllField()
    {
    String query ='';
    String SobjectApiName = 'Account';
    Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
    Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap();

    String strFields = '';

    for(String fieldName : fieldMap.keyset() )
    {
    if(strFields == null || strFields == '')
    {
    strFields = fieldName;
    }else{
    strFields = strFields + ' , ' + fieldName;
    }
    }

    query = 'select ' + strFields + ' from ' + SobjectApiName + ' Limit 10 ';

    List <Account> accList = Database.query(query);

    }

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 1:09 PM in reply to: What are different chart types available for Dashboards?

    Hi,

    Here is the different chart types available for Dashboards:
    You can show data in reports and dashboards in the form of bars, columns, lines, shapes, or other elements. Which is right depends on what the data is about and what you want to show with it.

    Bar Charts
    A bar chart shows values as horizontal lengths, so this format can be good for comparing distance or time. Use a bar chart when you have a summary report with a single grouping, or you only want to display one grouping.
    Column Charts
    A column chart is very much like a bar chart, but it can be a better format for showing relative counts of things, such as leads or dollars. Use a column chart when you have a summary report with a single grouping, or you only want to display one grouping.
    Line Charts
    Line charts are good for showing changes in the value of an item over a series of points in time, such as week to week or quarter to quarter. Use a line chart when you have one important grouping representing an ordered set of data and one value to show.
    Pie Charts
    Use a pie chart when you have multiple groupings and want to show the proportion of a single value for each grouping against the total.
    Donut Charts
    Use a donut chart when you have multiple groupings and want to show not only the proportion of a single value for each grouping against the total, but also the total amount itself.
    Funnel Charts
    Use a funnel chart when you have multiple groupings in an ordered set and want to show the proportions among them.
    Scatter Charts
    Use scatter charts to show meaningful information using one or two groups of report data plus summaries.

    Hope this helps you.

  • shariq

    Member
    September 17, 2018 at 12:19 PM in reply to: how we can edit the description of account through Salesforce Apex code?

    Hi Parul,RadhaKrish

    I have executed your code and it didn't work out for me. You are using account id but you didn't specify the source of these account id's and Also,you didn't specify anything about description in your apex code and you haven't perform any DML operations as well. Below snippet of code worked for me :

    list<account> accountList = new list<account>();
    accountList = [select id,Description from Account Limit 100];
    if(accountList.size() > 0){
    for(Account acc :accountList){

    acc.Description = 'Test';
    }

    update accountList;
    }

    Hope this helps!

    • This reply was modified 7 years, 6 months ago by  shariq.
  • shariq

    Member
    September 17, 2018 at 11:41 AM in reply to: Why future method is void and static in Salesforce?

    Hi,

    The reason why future methods are static and having a void return type is :
    Void return type is to ensure that you synchronous code doesn't wait for a value that will be return by the future method. Also, you are not sure when will the future method execute.
    Future method by definition is static so that variables with this method is associated to the class and not the instance and you can access them without instantiating the class.

    Hope this helps!

  • Hi,

    There can be any number of lightning component in a lightning app.

    An app is a special top-level component whose markup is in a .app resource.
    The markup looks similar to HTML and can contain components as well as a set of supported HTML tags. The .appresource is a standalone entry point for the app and enables you to define the overall application layout, style sheets, and global JavaScript includes. It starts with the top-level <aura:application> tag, which contains optional system attributes. These system attributes tell the framework how to configure the app.

    System Attribute
    Type
    Description
    access
    String
    Indicates whether the app can be extended by another app outside of a namespace. Possible values are public (default), and global.
    controller
    String
    The server-side controller class for the app. The format is namespace.myController.
    description
    String
    A brief description of the app.
    extends
    Component
    The app to be extended, if applicable. For example, extends="namespace:yourApp".
    extensible
    Boolean
    Indicates whether the app is extensible by another app. Defaults to false.
    implements
    String
    A comma-separated list of interfaces that the app implements.
    template
    Component
    The name of the template used to bootstrap the loading of the framework and the app. The default value is aura:template. You can customize the template by creating your own component that extends the default template. For example:<aura:component extends="aura:template" ... >
    tokens
    String
    A comma-separated list of tokens bundles for the application. For example, tokens="ns:myAppTokens". Tokens make it easy to ensure that your design is consistent, and even easier to update it as your design evolves. Define the token values once and reuse them throughout your application.
    useAppcache
    Boolean
    Deprecated. Browser vendors have deprecated AppCache, so we followed their lead. Remove the useAppcache attribute in the <aura:application> tag of your standalone apps (.app resources) to avoid cross-browser support issues due to deprecation by browser vendors.If you don’t currently set useAppcache in an <aura:application> tag, you don’t have to do anything because the default value of useAppcache is false.
    aura:application also includes a body attribute defined in a <aura:attribute> tag. Attributes usually control the output or behavior of a component, but not the configuration information in system attributes.

    Attribute
    Type
    Description
    body
    Component[]
    The body of the app. In markup, this is everything in the body of the tag.

  • shariq

    Member
    September 17, 2018 at 11:15 AM in reply to: Where we use application custom event in Salesforce?

    Hi,

    Event :

    An event can be something the browser does, or something a user does.

    Lightning framework uses event driven programming. Handlers are written for interface events and they handles the events as they fire. In Lightning framework events are triggered from client side JavaScript controller actions. The attributes in an event could be set before the event gets trigerred and read only when the event is handled.

    In Lightning framework events are declared by the aura:event tag in a .evt resource. Events can be of two types :

    Component Events:

    A component event can be triggered from an instance of a component and can be handled by the component that triggered it or by any other component in the hierarchy that recieve the event.
    Application Events:

    An application event is fired by an instance of a component and all the components that provide handler for the event are notified.
    Steps to communicate between two lightning components using events:
    Create an event.
    Create two lightning component : Child component and parent component.
    Register the event in child component and fired the event in child component JavaScript controller action.
    Handle the event in parent component.

    Hope this helps!

  • Hi,

    Actually I am assigning a group of two users to the Owner of the Task. Could you please provide more detail what you want.

    Thanks for your reply.

  • shariq

    Member
    September 17, 2018 at 11:00 AM in reply to: is Undelete Operation is count as DML

    Hi,

    Below are the Apex DML Statements supported by salesforce  :

    1. Insert Statement
    2.  Update Statement
    3. Upsert Statement
    4. Delete Statement
    5. Undelete Statement
    6. Merge Statement

    Undelete Statement
    The undelete DML operation restores one or more existing sObject records, such as individual accounts or contacts, from your organization’s Recycle Bin. undelete is analogous to the UNDELETE statement in SQL.

    Hope this helps!

  • shariq

    Member
    September 17, 2018 at 10:56 AM in reply to: How to delete custom object programmatically?

    Hi,

    Use the CRUD-based metadata calls to create, update, or delete setup and configuration components for your organization or application. These configuration components include custom objects, custom fields, and other configuration metadata. The metadata calls mimic the behavior in the Salesforce user interface for creating, updating, or deleting components. Whatever rules apply there also apply to these calls.

    Metadata calls are different from the core, synchronous API calls in the following ways:Metadata API calls are available in a separate WSDL. To download the WSDL, log into Salesforce, from Setup, enter APIin the Quick Find box, then select API and click the Download Metadata WSDL link.
    After logging in, you must send Metadata API calls to the Metadata API endpoint, which has a different URL than the SOAP API. Retrieve the metadataServerUrl from the LoginResult returned by your SOAP API login() call. For more information about the SOAP API, see the SOAP API Developer Guide.
    Metadata calls are either synchronous or asynchronous. CRUD calls are synchronous in API version 30.0 and later, and similar to the API core calls the results are returned in a single call. In earlier API versions, create, update, and delete are only asynchronous, which means that the results are not immediately returned in one call.
    There are synchronous metadata calls that map to the corresponding core SOAP API synchronous calls.createMetadata() maps to the create() SOAP API call.
    updateMetadata() maps to the update() SOAP API call.
    deleteMetadata() maps to the delete() SOAP API call.

    Hope this helps!

  • Hi,

    From what I Understand from your requirement, you need to assign task to a group of fixed two users on created/updated case( picklist values).

    Try this -

    trigger CaseTaskAssign on Case (after insert, after update) {
    List<Group> grpToAssign = [SELECT Id FROM Group where Name = 'Test_Pg' LIMIT 1];
    List<Task> listTask = new List<Task>();
    for(Case newCase : Trigger.new){
    if(newCase.Reason__c == 'Test_Reason' && newCase.Secondary_reason__c == 'Test_Secondary_Reason'){
    Task task = new Task();
    task.OwnerId = grpToAssign.get(0).Id;
    task.Subject='Donni';//Dummy
    task.Status='Not Started';//Testing value
    task.Priority='Normal';//Testing value
    }
    }
    if(listTask.size() > 0){
    insert listTask;
    }
    }

     

    Hope this helps.

  • shariq

    Member
    September 16, 2018 at 10:08 PM in reply to: What is the difference between sharing rules and permission sets?

    Hi,

    Permission sets add the same kind of permissions as profiles give - access to apps, objects, fields, system functions etc - but the only settings that control access to other people's records are OWDs, roles and sharing rules. 

    Hope this helps.

  • shariq

    Member
    September 16, 2018 at 10:06 PM in reply to: Why we need currency data type in Salesforce?

    Hi,

    Currency field type allows user to enter INR or any other country currency values in the record whereas Number data type allows users to enter numbers.

    Hope this helps.

  • Hi,

    Currency Data Type – Allows users to enter a dollar or other currency amount and automatically formats the field as a currency amount. This can be useful if you export data to Excel or another spreadsheet.

    Number Data Type – Allows users to enter any number. Leading zeros are removed.

    Hope this helps.

  • shariq

    Member
    September 16, 2018 at 10:05 PM in reply to: What is S controls in salesforce?

    Hi,

    Scontrols: S-controls have been superseded by Visualforce pages. After March 2010 organizations that have never created s-controls, as well as new organizations, won’t be allowed to create them. Existing s-controls will remain unaffected, and can still be edited. We recommend that you move your s-controls to Visualforce. We continue to support the Scontrol object.

    Visualforce: Visualforce is the new force.com technology that lets you create custom user interfaces for your Force.com applications. With Visualforce, you can reuse many of the components found in existing Salesforce interfaces or create your own. Moreover, the interfaces can also tap into custom business logic. The technique is powerful, easily customized, separates business logic from user interface design, and in most cases eliminates the need for S-Controls. The custom pages can either complement and extend existing pages on Salesforce, or have their own unique look and feel.

    Hope this helps.

  • shariq

    Member
    September 16, 2018 at 10:04 PM in reply to: What is the difference between S-Controls and Visualforce?

    Hi,

    S-controls provide a flexible, open means of extending the Salesforce user interface, including the ability to create and display your own custom data forms.

    But, Visualforce pages supersede s-controls. Organizations that haven’t previously used s-controls can’t create them. Existing s-controls are unaffected, and can still be edited.

    Hope this helps.

  • shariq

    Member
    September 16, 2018 at 10:02 PM in reply to: Can you explain the use of custom settings in Salesforce?

    Hi,

    To add more to the above answer -

    Use and example of Custom Settings
    Hard-coding and good code are a match made in hell. RecordTypeIds are most vulnerable to this abuse, and we’re are all familiar with the frustration of finding that code that worked in environment A, suddenly stops working when it is promoted to say test. Why? Because possibly RecordTypeIds are different across the two environments.Why hard-code when you can use Custom Setting.

    Custom Settings are a SOQL inexpensive way of storing your configurable parameters in the safe confines of the Salesforce database, with all the conveniences of a custom object – create / edit via point and click – standard salesforce.

    Hope this helps.

  • shariq

    Member
    September 16, 2018 at 9:57 PM in reply to: When should Apex be used over Workflow rules or Process Builder?

    Hi,

    You can achieve everything  done by workflow and process builder with apex.

    Advantages of Apex -

    Apex

    Finally, there’s always Apex to help you achieve “everything else” — whatever business requirements you have that can’t be accomplished through declarative configuration. If you have access to a developer, with Apex the sky is the limit. With Apex you could do the following:

    – Delete records
    – Update unrelated records
    – Share records with more complex criteria than Sharing Rules permits
    – Add/remove users in Chatter Groups and Public Groups
    – Create email templates that pulls info from multiple records and Objects (combined with Visualforce)
    – And more

    Apex is powerful tool, but do your best to minimize its use. Don’t be afraid to employ it, but makes sure you think it through thoroughly to determine if there is a way you can accomplish what you need declaratively. Using Apex means that you’ll need to write test coverage and the more Apex you have, the longer it will take deployments from Sandboxes because the changes need to be validated against all of the code.

    By knowing the tools available, what they can do (and their limitations), and when is best to use each, you’re in a position to give your users the best experience possible while also creating an environment for your organization to have the best data possible.

    Hope it helps.

    • This reply was modified 7 years, 6 months ago by  shariq.
  • Hi,

    It will return the matched records but will not show field which is hidden through Field level security.

    To add more -

    If a field is invisible to a user and validation rule says that the record cannot be saved without entering value for that field, then that particular user would never be able to save a record for that object.

    Hope it helps.

  • shariq

    Member
    September 16, 2018 at 9:45 PM in reply to: When “Hard Delete” button will be enabled in apex data loader?

    Hi,

    You need to go into Settings and enable Use Bulk API. It should then appear as an option.

    Hope it helps.

  • shariq

    Member
    September 16, 2018 at 9:43 PM in reply to: How can we extract all the sobject data in excel from Salesforce?

    Hi,

    There is a button in data loader called - 'Export All' -

    Export All :  It is used to export the Salesforce Data(including recycle bin's data) into your local system.

    Hope it helps.

Page 39 of 57