Forum Replies Created

Page 6 of 10
  • Piyush

    Member
    October 3, 2019 at 4:06 am in reply to: System.runAs and runAs

    Hi Naresh,

    System .runAs: It enables us to Changes the current user to the specified user. We use This Method when we need to execute the test as a context of a current user.

    runAs: The runAs method ignores user license limits. You can create new users with runAs even if your organization has no additional user licenses.

  • Hi Matthew,

    Yes, There a way to reference a field from a managed package. you can write a trigger or any Apex code using managed package references.

  • Hi Deepak,

    As per my knowledge, you can compare two numerical values from different record types in a report in salesforce by a formula using if.

    You need to create a separate object that should refer to both the record type.

  • Hi Prachi,

    Yes, You can have a roll-up summary field in case of lookup relationship in Salesforce. You can create rollup summary fields on the master record to summarize the detail records. The relationship field allows users to click on a lookup icon to select a value from a popup list. The master object is the source of the values in the list. Creates a relationship that links this object to another object.

  • Piyush

    Member
    October 1, 2019 at 2:57 am in reply to: what are the use cases of Constructor Overloading ?

    Hi Yogesh,

    It is completely dependent upon your implementation whether or not you want to create more than one constructor in your class but having more than one constructor can ease your life in many instances.

    Here is an example that you use to create multiple Constructor in apex class:-

    public class SampleController {
        private String myInsVar;
        public SampleController() {
            myInsVar = 'Tes';
        }
    
        @AuraEnabled static void lightningControllerM1() {
            // Here, [[code]]czoxODpcIlNhbXBsZUNvbnRyb2xsZXIoKVwiO3tbJiomXX0=[[/code]] is never called
            // We can't access [[code]]czo4OlwibXlJbnNWYXJcIjt7WyYqJl19[[/code]] in static context.
            String myLocalInsVar = 'Tes'; // this is fine.
        }
    
        @AuraEnabled static void anotherLightningControllerM2() {
            myCustomObject q = new MyCustomObject('Tes');
            // myCustomObject() constructor *is* called, because we instantiated it here.
            // We still can't access [[code]]czo4OlwibXlJbnNWYXJcIjt7WyYqJl19[[/code]].
        }
    }

     

  • Hi Laveena,

    You can take help from below link to get picklist values dynamically in lightning component in salesforce:-

    https://www.biswajeetsamal.com/blog/get-picklist-values-dynamically-in-lightning-component/

  • Piyush

    Member
    October 1, 2019 at 2:43 am in reply to: What is the use of onchange attribute in lightning in salesforce?

    Hi Laveena,

    A simple onChange event would call an action present in the apex class which intern provides the output on the visualforce page.

    • This reply was modified 4 years, 11 months ago by  Piyush.
  • Piyush

    Member
    September 30, 2019 at 5:36 am in reply to: What are dynamic dashboards? Can dynamic dashboards be scheduled?

    Hi,

    Dynamic dashboards allow each user to see the data they have access to according to the security settings that are in place. Without read access to a record, that record will not be accounted for in the dashboard. This allows you to control data visibility without having to create separate dashboards.

    For the dynamic dashboard schedule you can take help from this URL.

  • Piyush

    Member
    September 30, 2019 at 5:32 am in reply to: What is a bucket field in reports?

    Hi,

    Bucket field in Salesforce Reports is an incredible powerful functionality used to quickly categorize values for a field in a report without the need to have a custom formula field at the object level. When you create a bucket field in Salesforce, you define multiple categories into groups depending on the record values, this bucket field will not affect other Salesforce reports. Bucket fields in Salesforce are available in Tabular reports, Summary Reports and Matrix reports. Joined Reports does not support Bucket fields.

  • Hi,

    You cannot call another future method from a future method. As per Salesforce documentation,
    You cannot call a method annotated with future from a method that also has the future annotation. Nor can you call a trigger from an annotated method that calls another annotated method.
    If you do not have dependency between f1 & f2, you can call both methods one by one from original class.

  • Hi Prachi,

    No, Synchronous Web service callouts are not supported from scheduled Apex. To be able to make callouts, make an asynchronous callout by placing the callout in a method annotated with @future(callout=true) and call this method from scheduled Apex. However, if your scheduled Apex executes a batch job, callouts are supported from the batch class.

  • Piyush

    Member
    September 27, 2019 at 2:52 am in reply to: How to create a scratch org in salesforce?

    Hi,

    To create a scratch or in salesforce you have to run this command:

    sfdx force:org:create -f project-scratch-def.json

    for more information you can check:-  https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_create.htm

     

  • Piyush

    Member
    September 27, 2019 at 2:48 am in reply to: How can I access a custom label in Salesforce visualforce page?

    Hi Laveena,

    Custom labels are custom text values that can be accessed from Apex classes or Visualforce pages. The values can be translated into any language Salesforce supports. Custom labels enable developers to create multilingual applications by automatically presenting information (for example, help text or error messages) in a user’s native language.
    You can create up to 5,000 custom labels for your organization, and they can be up to 1,000 characters in length.

    To access custom labels:-

    1. Go To Setup
    2. Create Custom Labels.
    3. Click on New Custom Labels.
    4. Enter value for name, value and description.

     

  • Piyush

    Member
    September 27, 2019 at 2:39 am in reply to: When do I deploy my lwc code it's showing error in Salesforce?

    Hi Deepak,

    You can try this :-

    1.  sfdx force:auth:web:login -h      then login to the dev hub
    2. sfdx force:auth:web:login -d -a DevHub
    3. Successfully authorized <your-username> with org id 00B1800870L9r3UCY
    4. sfdx force:org:open -u DevHub

    I hope this will work try this and let me know.

     

  • Hi Deepak,

    Files formats supported include  .docx, .pdf, .ppt, .pptx, .xls, and .xlsx
    All image files are supported including .gif, .jpg, and .png

  • Hi,

    LayoutType attribute to display all the fields defined on the given layout.

    Ex:-

    <lightning:recordForm
            recordId="001XXXXXXXXXXXXXXX"
            objectApiName="Account"
            layoutType="Full"
            mode="view" />
    
     <lightning:recordForm
            recordId="001XXXXXXXXXXXXXXX"
            objectApiName="My_Contact__c"
            layoutType="Compact"
            columns="1"
            mode="readonly" />

     

  • Hi,

    TargetFields is the corresponding attribute to simpleRecord. TargetFields is easier to use compared to targetRecord.

    TargetFields attribute is a simplied view of fields to be referenced where as TargetRecord consists of fields, childRelationships, apiName, id, recordTypeInfo.

    For Ex:- https://trailhead.salesforce.com/en/content/learn/modules/lightning_data_service/lightning_data_service_handle_notifications

  • Piyush

    Member
    September 25, 2019 at 7:24 am in reply to: What is Dev Hub?

    Hi,

    The Developer Hub (Dev Hub) lets you create and manage scratch orgs. The scratch org is a source-driven and disposable deployment of Salesforce code and metadata, made for developers and automation.

  • Piyush

    Member
    September 25, 2019 at 7:22 am in reply to: What is Platform Cache?

    Hi,

    "Platform Cache" is a memory layer that store's Salesforce session and org data for later access. "Platform Cache" is just like a RAM for your app. With Platform Cache, your applications can run faster because they store reusable data in memory.

  • Piyush

    Member
    September 25, 2019 at 5:14 am in reply to: Is it possible to restrict permission for users using permission set?

    Hi,

    As per my knowledge, you will not be able to restrict permission for users using the permission set.  You can restrict permission on profile.

  • Piyush

    Member
    September 25, 2019 at 5:05 am in reply to: What is the use of lightning:messages in salesforce lightning component?

    Hi NIkita,

    The severity attribute indicates a message's severity level and determines the style to use when displaying the message. If the closable attribute is set to true, the message can be dismissed by pressing the × symbol. To apply Lightning Design System styling, we recommend that you use lightning:notificationsLibrary instead of ui:message.

    Ex:-

    <aura:component access="global">
    	<ui:message title="Confirmation" severity="confirm" closable="true">
    			This is a confirmation message.
    	</ui:message>
    	<ui:message title="Information" severity="info" closable="true">
    			This is a message.
    	</ui:message>
    	<ui:message title="Warning" severity="warning" closable="true">
    			This is a warning.
    	</ui:message>
    	<ui:message title="Error" severity="error" closable="true">
    			This is an error message.
    	</ui:message>
    	
    </aura:component>

     

  • Hi Nikita,

    1. lightning:recordForm:- Used to create, edit and update a code without using apex code.
    2. force:recordData:-Used to create, edit, update, and delete a code without using apex code.

    For More you can refer from this URL.

  • Piyush

    Member
    September 24, 2019 at 3:39 am in reply to: How we can use a map in Salesforce Lightning Component?

    Hi,

    You can use a map in Salesforce Lightning Component like this :-

    <aura:component implements="forceCommunity:availableForAllPageTypes" access="global" controller="MyClass">
        <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
        <aura:attribute name="myMap" type="Map" />
    </aura:component>
    ({
       doInit: function(component, event, helper) {      
    
           var action = component.get('c.getMap');
            
            action.setCallback(this,function(result){
                component.set('v.myMap',result.getReturnValue());
            });
            $A.enqueueAction(action);
         }
    })
    public with sharing class MyClass
    {
          public static MAP<String,String> getMap()
          {
              Map<String,String> map = new Map<String,String>();
              map.put('key1','value1');
              map.put('key2','value2');
              return map;
          }
    }

    For more, you can take help from this URL.

  • Hi,

    Both Dependent Lookup Field and Controlling/Dependent picklist Field are same. The only difference is that, That  Controlling field is the 'parent' that controls which values are available in the 'dependent' picklist.

  • Piyush

    Member
    September 24, 2019 at 3:24 am in reply to: What is the difference between 15 digit and 18 digit id in Salesforce?

    Hi Prachi,

    1. 15 digit case-sensitive version
    2. 15 digit ID is what will be received from within the user interface
    3. 18 digit case-insensitive and best used for manipulating data outside Salesforce
    4. 18 digit id is referenced through in the API and other 3rd party tools.
Page 6 of 10