Forum Replies Created

Page 4 of 6
  • Laveena

    Member
    September 3, 2019 at 10:44 am in reply to: What is the difference between __c and __r in salesforce ?

    Hi Nikita,

    __c refers directly to a custom object whereas __r refers to a reference (a relationship) between two objects such as the parent-child object relationship or child-parent object relationship in order to help you 'get' or 'navigate' to the parent from a child or vice versa.

    Thanks

  • Hi Deepak,

    Yes, we can include external JavaScript/CSS libraries in salesforce lightning components.

    Lightning Components framework provides a great way to easily decompose applications into components. But building applications also depend on tons of other OSS libraries like JQuery, Twitter Bootstrap, Moment.js and more to implement various features.

    While loading 3rd party libraries is trivial, loading them into a trusted enterprise environment like Salesforce needs to meet our strict security needs.  They also need to meet various application needs such as loading multiples files in a specific order. So with Spring ‘15 release we created a new component called ltng:require to load libraries while being secure. It has the following features:

    Asynchronously load multiple CSS and/or JS libraries
    Load libraries in any dependency order the app needs
    Let the app know when loading all JS libraries are complete
    Most importantly, load only verifiable libraries (for security purposes)
    Let’s take at the syntax to better understand it:

    1
    <ltng:require
    2
    styles="/resource/path/to/css1[,/resource/path/to/css2]"
    3
    scripts='/resource//path/to/js1.js,[/resource//path/to/js2.js]'
    4
    afterScriptsLoaded="{!c.controllerFunction}"
    5
    />
    styles – Allows us to specify multiple CSS files separated by comma. They will be loaded from left-to-right.
    scripts – Allows us to specify multiple JS files separated by comma. Again they will be loaded from left-to-right
    afterScriptsLoaded – Allows us to provide a JS function to notify when all JS files are loaded.
    Notes:

    Files paths must always start from /resource. i.e they must be a static resource to enforce security.
    CDNs are not allowed at this point because they are outside of Salesforce data centers and can’t be controlled. In the future, we may allow admins to whitelist CDNs for their orgs.
    If you upload a JS or CSS directly into Static resource, then you should reference them by resource name without .css or .js suffix. For example:  /resource/myjsfile or /resource/mycssfile
    If your resource is inside a zip file, then you should use .css or .js suffix. For example: /resource/<resourcename>/path/to/myjsfile.js

  • Hi Chanchal,

    Your own Google Calendar API Credential you need to follow step by step guide explained below:

    Step 1 – Open to Google APIs Console using this link- https://console.developers.google.com/apis

    Step 2 – Login to Google API Console using your Google account

    Step 3 – After login, you are redirected to Google APIs Dashboard. Here you need to enable Google Calendar API. Click on “ENABLE API AND SERVICES” link to enable it. This will redirect you to all Google APIs list page. Here in the search bar, type the “Google Calendar. It will filter or search the result as below screenshot. Click on the first result item which is Google Calendar API.

    Step 4 – After selecting the API result this will show a button to enable it hit that button.

    Step 5 – You need to create a project to use or enable any Google APIs. It will redirect you to project creation page, where you need to create a project. Click on “Create” button.

    Provide a Project Name like – Appointment Scheduler Pro same as below screenshot, you can specify the project name on your own. We are creating this client id and secret key to use for Appointment Scheduler Pro plugin that’s why we named the project with the same name as the plugin.

    Now, after project created successfully, you can enable Google Calendar API.

    Step 6 – Now, we will generate the API credentials. Click on Credentials link or after enabling calendar API you will automatically redirect to the credential page.

    Select  OAuth Client ID for access type

    To get the OAuth Client ID you need to set up a consent screen, this screen will be displayed at the time where you will be authorized to Google Calendar API using Client ID and Client Secret. Click on “Configure Consent Screen” button to setup.

    After setting up consent screen, select the “Web Application” option form the given list of application type. And fill the form as screenshot added below

    a) Type – Web Application

    b) Name – Appointment Scheduler Pro (you can add your application name here for which you generating the API keys)

    c) Redirect URIs – http://localhost/premium/wp-admin/admin.php?page=ap_system (you will find this URL into your application dashboard where you fill client id and secret id)

    Hit the Create button and you will find your Google Calendar client id and client secret in pop up windows.

    Now, you can copy and use these credentials in any application to sync your Google Calendar with the supported application.

    Thanks

     

  • Laveena

    Member
    August 29, 2019 at 6:53 am in reply to: Deleting a class without Salesforce IDE

    Hi Prachi,

    This can be done with the Force.com Migration Tool: http://wiki.developerforce.com/page/Force.com_Migration_Tool

    See the full documentation here: http://wiki.developerforce.com/page/Force.com_Migration_Tool

    The tool can create or delete any meta-data that can be created through the Force.com IDE or Change Sets. It comes with a sample config file that contains example deployments for deploying objects and Apex code and deleting them as well. The documentation has a very detailed step-by-step guide here: http://www.salesforce.com/us/developer/docs/daas/index_Left.htm#StartTopic=Content/forcemigrationtool.htm

    Thanks

  • Hi Prachi,

    It’s not a matter of security. The HTTP protocol defines GET-type requests as being idempotent, while POSTs may have side effects. In plain English, that means that GET is used for viewing something, without changing it, while POST is used for changing something. For example, a search page should use GET, while a form that changes your password should use POST.

    Also, note that PHP confuses the concepts a bit. A POST request gets input from the query string and through the request body. A GET request just gets input from the query string. So a POST request is a superset of a GET request; you can use $_GET in a POST request, and it may even make sense to have parameters with the same name in $_POST and $_GET that mean different things.

    For example, let’s say you have a form for editing an article. The article-id may be in the query string (and, so, available through $_GET[‘id’]), but let’s say that you want to change the article-id. The new id may then be present in the request body ($_POST[‘id’]). OK, perhaps that’s not the best example, but I hope it illustrates the difference between the two.

    Thanks

  • Hi Prachi,

    For Person accounts, custom fields ends with “__pc” and custom relationship ends with “__pr”.

    Thanks

  • Laveena

    Member
    August 28, 2019 at 4:47 am in reply to: Which component in Salesforce ends with “__mdt” and “__s”?

    Hi Prachi,

    Custom metadata types ends with “__mdt” (meta data type), just like custom object or custom fields ends with “__c”and ‘__s’ is used for geolocation services.

    Thanks

  • Hi Prachi,

    List<Contact> lstContact = new List<Contact>();
    Contact con = new Contact (lastName = ‘Zaa’, SQL_Server_Id__c=’3′,firstName=’Jitendra’);
    lstContact.add(con);
    //.. Other Contact records added in List
    Database.UpsertResult[] results = Database.upsert( lstSGAccOppInsert, Contact.SQL_Server_Id__c.getDescribe().getSObjectField() ,false ) ;

    for(Integer i=0;i<results.size();i++){
    if (!results.get(i).isSuccess()){
    Database.Error err = results.get(i).getErrors().get(0);
    System.debug(‘Error – ‘+err.getMessage() + ‘nStatus Code : ‘+err.getStatusCode()+’n Fields : ‘+err.getFields());
    }
    }

    Thanks

  • Laveena

    Member
    August 27, 2019 at 5:35 am in reply to: How to pass values across Salesforce Lightning Applications?

    Hi Yogesh,

    Suppose, There are two components

    <aura:component>
    <aura:attribute a/>
    </aura:component>
    and

    <aura:component>
    <aura:attribute b/>
    </aura:component>
    and you need to pass first component's value a to second's b.

    Then

    <aura:component>
    <aura:attribute a/>

    <c:secondcomp b="{!a}">

    </aura:component>

    Thanks

  • Laveena

    Member
    August 27, 2019 at 5:34 am in reply to: How many fields we can create for a particular Salesforce object ?

    Hi Nikita,

    You can create 100 custom fields per object in Professional edition in salesforce.

    Thanks

  • Laveena

    Member
    August 27, 2019 at 5:31 am in reply to: What is Feed Tracking in Salesforce?

    Hi Nikita,

    Feed tracking tracks changes to objects and fields and posts them as updates in the What I Follow feed. Users who follow a record, see those updates in their view of What I Follow, with one exception. Updates users make themselves aren’t posted to What I Follow. Users can see those updates in their profile feeds.

    Thanks

  • Laveena

    Member
    August 26, 2019 at 11:16 am in reply to: When would you use the Salesforce @future annotation?

    Hi Divya,

    1. When you have to make callout to external web-services after DML operation from trigger because it hold the database connection open for lifetime.
    2. Due to sort of resource some method need to run in their own thread, so that it can use that resources when they are available, there you can use future annotation.
    3. Due to limited user’s access on record sometimes DML operation on certain sObject cannot be mixed with DML operation on another sObjects. At that time we need to change the transaction of both DML operation. Here we can use future method.
    Thanks

  • Laveena

    Member
    August 26, 2019 at 11:14 am in reply to: What is Product SKU field in Salesforce?

    Hi Divya,

    A stock keeping unit (SKU) is an alphanumeric code that identifies a product and helps you track inventory for your retail business. You can create SKU numbers manually or using inventory management or point-of-sale (POS) software. SKU numbers print on your product label along with the product’s universal product code (UPC) and other product information.

    SKUs help you track products in an inventory management system, but that’s not all. SKUs improve the shopping experience by streamlining checkout. They can also help boost profits by eliminating human inventory errors and providing data to make informed merchandise purchases.

    Thanks

  • Laveena

    Member
    August 26, 2019 at 11:11 am in reply to: Why do we use Formula fields in Salesforce?

    Hi Divya,

    Formula Field is a read only field whose value is evaluated from the formula or expression defined by us. We can define formula field on both standard as well as custom objects. Any change in expression or formula will automatically update the value of formula field.

    Thanks

  • Laveena

    Member
    August 23, 2019 at 5:40 am in reply to: How to create Chatter post from Apex in salesforce?

    Hi Prachi,

    The following code may help you:

    //Adding a Text post
    FeedItem post = new FeedItem();
    post.ParentId = oId; //eg. Opportunity id, custom object id..
    post.Body = ‘Enter post text here’;
    insert post;

    //Adding a Link post
    FeedItem post = new FeedItem();
    post.ParentId = oId; // Record Id eg. Opportunity id, custom object id..
    post.Body = ‘Enter post text here’;
    post.LinkUrl = ‘http://www.infallibletechie.com’;
    insert post;

    //Adding a Content post
    FeedItem post = new FeedItem();
    post.ParentId = oId; // Record Id eg. Opportunity id, custom object id..
    post.Body = ‘Enter post text here’;
    post.ContentData = base64EncodedFileData;
    post.ContentFileName = ‘infallible.pdf’;
    insert post;

    Thanks.

  • Hi Hariom,

    Insert:

    • Partial insert is not supported.
    • Roll back is not supported.
    • If we use the DML statement (Insert) in bulk operation, then if error occurs the execution will stop. In that case Apex code throws an error and none of the record will insert to the database.
      Database.Insert:
    • Database methods are static methods available in Database class.
    • Partial insert is supported.
    • Roll back is supported.
    • Includes the optional allorNone parameters that defaults true.
    • If we use DML database methods (Database.Insert) in bulk operation, then if error occurs the remaining records will be inserted/updated means partial DML operation will be done. The only record throwing an error will not be inserted/updated.

    Thanks

  • Laveena

    Member
    August 23, 2019 at 5:22 am in reply to: How we can check API limits in Salesforce?

    Hi Prachi,

    Sample Responses:

    SOAP :

    <soapenv:Header>

    <LimitInfoHeader>

    <limitInfo>

    <current>45</current>

    <limit>5000</limit>

    <type>API REQUESTS</type>

    </limitInfo>

    </LimitInfoHeader>

    </soapenv:Header>
    REST :

    Sforce-Limit-Info: api-usage=45/5000

    Thanks

  • Laveena

    Member
    August 23, 2019 at 5:20 am in reply to: I want to delete a user in Salesforce. Can i do that.?

    Hi Hariom,

    In Salesforce you can not delete a user. Instead, you can deactivate them.
    Deactivate a User-
    From Setup, enter Users in the Quick Find box, then select Users.
    Click Edit next to a user's name.
    Deselect the Active checkbox and then click Save.

    Thanks

    • This reply was modified 5 years, 3 months ago by  Laveena.
  • Laveena

    Member
    August 23, 2019 at 5:17 am in reply to: How to use standard Salesforce REST API from Visualforce page ?

    Hi Prachi,

    $.ajax({

    type: reqType,

    beforeSend: function (xhr)

    {

    xhr.setRequestHeader("Authorization", 'Bearer {!$API.Session_ID}');

    },

    headers : {'Content-Type' : 'application/json; charset=utf-8'},

    url: postUrl,

    data: postData,

    dataType: 'text'

    })

    .done(function( data ) {

    //Code if success

    })

    .fail(function(xhr,textstatus,error){

    //Code if fail

    });

    Thanks

  • Laveena

    Member
    August 22, 2019 at 5:05 am in reply to: How we can  make a VF page available for Salesforce1 ?

    Hi Hariom,

    Add the Page to the Salesforce App Navigation Menu
    From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce Pages.
    Click Edit next to the LatestAccounts Visualforce page in the list.
    Select Available for Lightning Experience, Lightning Communities, and the mobile app.
    Click Save.

    Thanks

  • Laveena

    Member
    August 22, 2019 at 4:48 am in reply to: Pagination in Salesforce: How to implement pagination in vF?
  • Hi Somendra,

    The key difference is master-detail has a direct dependency between the objects:

    You cannot have a detail record without a master.
    The detail record inherits sharing rules from the master.
    You cannot update the relationship to the master in a master-detail relationship.
    The number of master-detail relationships you can use are limited.
    You cannot set profile object permissions for a detail record
    Master-detail relationships are automatically included in report record types
    When you delete the master it will cascade delete all detail records relating to that master. A typical use of a Master-Detail would be the classic Sales Order and Sales Order Items objects.

    Lookups are generally for use where you may or may need to have a relationship between two objects (but not always).
    Lookups are generally used to reference commonly shared data, such as reference data.
    Lookups are used to link two objects together when you don't want the behaviour of the master-detail - particularly around sharing rules, profile permissions and cascade delete.
    Lookups are used when you need to relate multiple 'parents' to the detail record.

    Thanks

  • Laveena

    Member
    August 21, 2019 at 12:52 pm in reply to: What are the three types of bindings used in Visualforce ?

    Hi Hariom,

    Three types of bindings used in Visualforce are:

    Data binding: Data bindings refer to the data set in the controller.
    Action bindings: Action bindings refer to action methods in the controller.
    Component bindings: Component bindings refer to other Visualforce components.

    Thanks

  • Hi Achintya,

    In your test class you are only inserting the record yet your trigger is only setup to capture update events. You will either need to insert the lead then update to execute your trigger or add "on insert" to your trigger so that it runs when a lead is inserted and updated.

    Also, you are using an after event when you should be using a before event trigger for this type of update.

    Thanks

  • Laveena

    Member
    August 21, 2019 at 6:10 am in reply to: What are the different ways of deployment in Salesforce?

    Hi Achintya,

    You can refer this link-

    https://sfdcbeginner.com/salesforce-deployment-methods.html

    Thanks

Page 4 of 6