Forum Replies Created

Page 36 of 57
  • shariq

    Member
    September 18, 2018 at 1:25 AM in reply to: Why we can't use DML before trigger in Salesforce?

    Hi,

    We can use DML in before trigger but for different sobject, it depends upon your logic, if performed on same sobject then it will cause problem of recursion.

    Hope it helps.

  • shariq

    Member
    September 18, 2018 at 1:21 AM in reply to: What are Enterprise and Partner WSDL in Salesforce?

    Hi,

    Enterprise WSDL

    Strongly typed, the object and its attributes are fixed.

    Contains the metadata about all standard and custom fields and objects.

    Can only be used against your Salesforce instance.

     

     

    Partner WSDL

    Is loosely typed, the object and its attributes can be variable.

    Does not contain metadata about objects and fields. Takes an array of key-value pairs.

    Can be used against many Salesforce.com organizations.

    Hope it helps.

  • shariq

    Member
    September 18, 2018 at 1:20 AM in reply to: In Salesforce, what is Quick Fix in development mode?

    Hi,

    Although you can view and edit Visualforce page definitions on the Visualforce Pages page in Setup, enabling Visualforce development mode is the best way to build Visualforce pages. Development mode provides you with:

    • A special development footer on every Visualforce page that includes the page’s view state, any associated controller, a link to the component reference documentation, and a page markup editor that offers highlighting, find-replace functionality, and auto-suggest for component tag and attribute names.
    • The ability to define new Visualforce pages just by entering a unique URL.
    • Error messages that include more detailed stack traces than what standard users receive.

    To enable Visualforce development mode:

    • From your personal settings, enter Advanced User Details in the Quick Find box, then select Advanced User Details. No results? Enter Personal Information in the Quick Find box, then select Personal Information.
    • Click Edit.
    • Select the Development Mode checkbox.
    • Optionally, select the Show View State in Development Mode checkbox to enable the View State tab on the development footer. This tab is useful for monitoring the performance of your Visualforce pages.
    • Click Save.

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 1:16 AM in reply to: What are the limitations of Time-dependent workflow in Salesforce?

    Hi,

    Limitations of the workflow - 
    The workflow feature is only available in Enterprise, Unlimited, Performance, and Developer editions. For the Professional Edition, you can enable this feature after paying an extra amount. As Salesforce is based on a multitenant architecture, it imposes a few limitations on the workflow:

    • For each workflow rule, you can have the following:

    10 time triggers
    40 immediate actions
    40 time-dependent actions per time trigger

    • For both immediate and time-dependent actions in one workflow rule,
    there can be no more than:

    10 email alerts
    10 tasks
    10 field updates
    10 outbound messages

    • The workflow time trigger per hour limit for different editions are as follows:
    Professional Edition: 250
    Enterprise Edition: 500
    Developer Edition: 50
    Unlimited and Professional Edition: 1,000

    • The workflow e-mail limit per day is as follows:

    1,000 per Salesforce standard license
    200,000 per organization

    Note: Once an organization's daily e-mail limit of 200,000 exceeds, Salesforce will send a warning e-mail to the default workflow user and discard all the e-mails. Salesforce does not try to resend them later.

    Hope this helps.

  • Hi,

    Adding more to the above answer -

    User Package License - This object is available in API version 31.0 and later.

    package license Id - The 18-character Globally Unique ID (GUID) that identifies the package license.

    assigning Id - The User ID of the user licensed to use this package

    Hope it helps.

  • shariq

    Member
    September 18, 2018 at 1:09 AM in reply to: What is API Versioning in Salesforce?

    Hi,

    Adding some more points -

    A key principle to understand is that whilst SFDC may release version 28 of the API, the deployment logic associated with version 27 is still available for use as long as you force the API to use version 27. In Eclipse, using the Force.com IDE the version of the API being used is specified in the ./src/package.xml file. Open it in a text editor scroll to the bottom and you will find a line similar to:

    <Version>28.0</Version>

    It important to note that your version of Eclipse may not be able to deploy Meta Data files with an API version which is higher than the one supported by your Force.com IDE plug-in. So if you are using Eclipse with Force.com IDE version 27, you may not be able to deploy Meta Data files with API version 28. The latest version info on the Force.com IDE and how to upgrade can be found here.
    This concept may lead to utter confusion and numerous errors if the teams are not consistent with which API version they are using.

    Let’s look at an example:

    •   Mary is an Apex developer. She’s been using Eclipse for about 6 months and the Force.com IDE API version she is using in Eclipse (package.xml) is version 27.
    • Bob joins the team – installs Eclipse, installs the force.com IDE and refreshes his environment from a recently released SFDC org which is running Summer 2013. His package.xml file will therefore contain API version 28.
    • Mary and Bob are working on the same project and share the same Git Repo. Mary is working on an Apex Trigger: Account_Update whilst Bob is working on a trigger Contact_Update

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:35 AM in reply to: What is YAML file in Salesforce?

    Hi,

    I found this online. tell me if I am wrong -

    YAML stands for "YAML Ain't Markup Language" and it is used extensively in Grav for its configuration files, blueprints, and also in page settings. YAML is to configuration what markdown is to markup. It's basically a human-readable structured data format.

    Thanks.

  • shariq

    Member
    September 18, 2018 at 12:33 AM in reply to: What is the difference between system event and custom event in Salesforce?

    Hi,

    To Add more -

    System Events. The framework fires several system events during its lifecycle. You can handle these events in your Lightning apps or components, and within theSalesforce mobile app.

    Event-driven programming is a programming paradigm that allows developers to write functions to respond to fired events. The framework waits for events to be generated from user interactions such as button clicks and mouse overs, or by non-interactive actions such as loading completions or component renderings. When an event is fired the function(s) that have been declared to handle it are called by the framework.

    Hope this helps.

  • Hi,

    Apex Controllers is at server side and java script controller is at client side.

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:27 AM in reply to: What is aura definition bundle in Salesforce Lightning?

    Hi,

    An AuraDefinitionBundle component is a collection of component definition files, each representing a different resource such as markup code, event documentations, applications and interfaces. Lightning bundles must be under a top-level folder that's named aura.

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:26 AM in reply to: What is the use of force:hasRecordId interface in Salesforce?

    Hi,

    Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned the ID of the current record. The current record ID is useful if the component is used on a Lightning record page, as an object-specific custom action or action override in Lightning Experience or the Salesforce app, and so on. This interface has no effect except when used within Lightning Experience, the Salesforce mobile app, and template-based communities.

    This interface is a marker interface. A marker interface is a signal to the component’s container to add the interface’s behavior to the component. You don’t need to implement any specific methods or attributes in your component, you simply add the interface name to the component’s implements attribute

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:24 AM in reply to: What is Lightning Data Services in Salesforce?

    Hi,

    Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code. Lightning Data Service handles sharing rules and field-level security for you. In addition to not needing Apex, Lightning Data Service improves performance and user interface consistency.
    At the simplest level, you can think of Lightning Data Service as the Lightning Components version of the Visualforce standard controller. While this statement is an over-simplification, it serves to illustrate a point. Whenever possible, use Lightning Data Service to read and modify Salesforce data in your components.

    Data access with Lightning Data Service is simpler than the equivalent using a server-side Apex controller. Read-only access can be entirely declarative in your component’s markup. For code that modifies data, your component’s JavaScript controller is roughly the same amount of code, and you eliminate the Apex entirely. All your data access code is consolidated into your component, which significantly reduces complexity.

    Lightning Data Service provides other benefits aside from the code. It’s built on highly efficient local storage that’s shared across all components that use it. Records loaded in Lightning Data Service are cached and shared across components. Components accessing the same record see significant performance improvements, because a record is loaded only once, no matter how many components are using it. Shared records also improve user interface consistency. When one component updates a record, the other components using it are notified, and in most cases, refresh automatically.
    Loading a Record
    Loading a record is the simplest operation in Lightning Data Service. You can accomplish it entirely in markup.
    Saving a Record
    To save a record using Lightning Data Service, call saveRecord on the force:recordData component, and pass in a callback function to be invoked after the save operation completes.
    Creating a Record
    To create a record using Lightning Data Service, declare force:recordData without assigning a recordId. Next, load a record template by calling the getNewRecord function on force:recordData. Finally, apply values to the new record, and save the record by calling the saveRecord function on force:recordData.
    Deleting a Record
    To delete a record using Lightning Data Service, call deleteRecord on the force:recordData component, and pass in a callback function to be invoked after the delete operation completes.
    Record Changes
    To perform tasks beyond rerendering the record when the record changes, handle the recordUpdated event. You can handle record loaded, updated, and deleted changes, applying different actions to each change type.
    Errors
    To act when an error occurs, handle the recordUpdated event and handle the case where the changeType is “ERROR”.
    Considerations
    Lightning Data Service is powerful and simple to use. However, it’s not a complete replacement for writing your own data access code. Here are some considerations to keep in mind when using it.
    Lightning Data Service Example
    Here’s a longer, more detailed example of using Lightning Data Service to create a Quick Contact action panel.
    SaveRecordResult
    Represents the result of a Lightning Data Service operation that makes a persistent change to record data.

    Hope this helps!

  • shariq

    Member
    September 18, 2018 at 12:23 AM in reply to: Explain Opportunity Line Item and Code Line Item in Salesforce?

    Hi,

    Opportunity is kind of a pending deal which has an associated $ value with it. It represents that if the Opportunity can be closed successfully, then it will generate the $ amount of revenue for your company.

    OpportunityLineItem are the Products which are associated to an Opportunity.

    A company can have a number of products which it sells. All these products are generalized as Products. However, when a Product, or a number of Products are attached to an Opportunity, then they are called "OpportunityLineItem" records.

     

    The $ value attached to an Opportunity comes from the Products associated with that particular opportunity as each Product (or OpportunityLineItem) has a $ value associated to it.

    Opportunity : Use the Opportunity object to manage information about a sale or pending deal. Its like new or existing proposal that can turn into business.

    Line item : is every line that tells which products are involved in that opportunity

     

     

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:19 AM in reply to: Which operations can we perform on Dataloader in Salesforce?

    Hi,

    • Insert, Update, or Delete Data Using Data Loader 
    • Perform Mass Updates 
    • Perform Mass Deletes 
    • Uploading Attachments 
    • Upload Content with the Data Loader
    • Reviewing Data Loader Output Files
    • Data Import Limits 
    • View the Data Loader Log File 

    Hope this helps.

  • Hi,

    To add into above

    Example - 

    <aura:component implements="force:appHostable,lightning:actionOverride,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">
    <aura:iteration items="1,2,3" var="iterate">
    <lightning:recordEditForm aura:id="editForm" objectApiName="Account">
    <lightning:inputField fieldName="Name"/>
    </lightning:recordEditForm>
    </aura:iteration>
    <lightning:button aura:id="submit" onclick="{!c.handleSubmit}" label="Save" class="slds-m-top_medium" />

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:13 AM in reply to: Can Anyone Explain Post Install and Uninstall Script in Salesforce?

    Hi,

    Post Install 

    Example -

    global class PostInstallClass implements InstallHandler {
    global void onInstall(InstallContext context) {
    if(context.previousVersion() == null) {
    Account a = new Account(name='Newco');
    insert(a);

    Survey__c obj = new Survey__c(name='Client Satisfaction Survey');
    insert obj;

    User u = [Select Id, Email from User where Id =:context.installerID()];   
    String toAddress= u.Email;
    String[] toAddresses = new String[]{toAddress};
    Messaging.SingleEmailMessage mail =
    new Messaging.SingleEmailMessage();
    mail.setToAddresses(toAddresses);
    mail.setReplyTo('support@package.dev');
    mail.setSenderDisplayName('My Package Support');
    mail.setSubject('Package install successful');
    mail.setPlainTextBody('Thanks for installing the package.');
    Messaging.sendEmail(new Messaging.Email[] { mail });
    }
    else
    if(context.previousVersion().compareTo(new Version(1,0)) == 0) {
    Survey__c obj = new Survey__c(name='Upgrading from Version 1.0');
    insert(obj);
    }
    if(context.isUpgrade()) {
    Survey__c obj = new Survey__c(name='Sample Survey during Upgrade');
    insert obj;
    }
    if(context.isPush()) {
    Survey__c obj = new Survey__c(name='Sample Survey during Push');
    insert obj;
    }
    }
    }

    Post Uninstall 

    Example how to test uninstall script-

    @isTest
    static void testUninstallScript() {
    Id UninstallerId = UserInfo.getUserId();
    List<FeedItem> feedPostsBefore =
    [SELECT Id FROM FeedItem WHERE parentId=:UninstallerId AND CreatedDate=TODAY];
    Test.testUninstall(new UninstallClass());
    List<FeedItem> feedPostsAfter =
    [SELECT Id FROM FeedItem WHERE parentId=:UninstallerId AND CreatedDate=TODAY];
    System.assertEquals(feedPostsBefore.size() + 1, feedPostsAfter.size(),
    'Post to uninstaller failed.');
    }

     

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:08 AM in reply to: What is field tracking in Salesforce?

    Hi,

    To add more -

    You can track the field history of custom objects and the following standard objects.

    Accounts
    Articles
    Assets
    Campaigns
    Cases
    Contacts
    Contracts
    Contract line items
    Entitlements
    Leads
    Opportunities
    Orders
    Order Products
    Products
    Service Contracts
    Solutions
    Modifying any of these fields adds an entry to the History related list. All entries include the date, time, nature of the change, and who made the change. Not all field types are available for historical trend reporting. Certain changes, such as case escalations, are always tracked.

     

    Hope this helps.

  • shariq

    Member
    September 18, 2018 at 12:06 AM in reply to: Lightning in salesforce

    Hi,

    I think you need not write aura enabled on constructor because as the app loads, constructor will run. correct me if I am wrong.

    Hope this helps.

  • Hi,

    You can save the custom messages in custom setting or label and use this on page by making it getter setter or through globally($label).

    Hope this helps.

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

    CornTrigger is an object in salesforce which contains schedule information for a scheduled job .Basically it hold the CronExpression,NextFireTime,LastFireTime,StartTime ,End Time ,status etc .

    getTriggerID method returns the ID of the CronTrigger object associated with this scheduled job

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:57 PM in reply to: How are Salesforce records queued for Indexing?

    Hi,

    The platform builds a standard database index on this index table. The index table places upper limits on the number of records that an indexed search can effectively return.

    By default, the index tables do not include records that are null (records with empty values). You can work with Salesforce Customer Support to create custom indexes that include null rows. Even if you already have custom indexes on your custom fields, you must explicitly enable and rebuild them to get the empty-value rows indexed.

    The platform automatically maintains indexes on the following fields for most objects.
    RecordTypeId.
    Division.
    CreatedDate.
    Systemmodstamp (LastModifiedDate)
    Email (for contacts and leads)
    Foreign key relationships (lookups and master-detail)
    The unique Salesforce record ID, which is the primary key for each object.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:55 PM in reply to: How can we hard delete a record using a Apex class/by code in salesforce?

    Hi,

    Hard delete is done by using DataBase.emptyRecycleBin method in the Batch class. Create a sample Batch class as mentioned below and use DataBase.emptyRecycleBin method in the Batch class.

    global class BatchDeletion implements Database.Batchable<sObject>, Schedulable 

    global BatchDeletion()
    {
    //constuctor 
    }

    global Database.QueryLocator start(Database.BatchableContext bc)
    {
    //query to return all expired Case Share records 
    return Database.getQueryLocator([Select id from Account where Name=’Test Account12′]);
    }

    global void execute(SchedulableContext sc) 

    //execute the batch
    BatchDeletion deleteCS = new BatchDeletion();
    ID batchprocessid = Database.executeBatch(deleteCS);
    }

    global void execute(Database.BatchableContext BC, list<sObject> scope)

    System.debug(‘## deleting ‘+scope.size()+’ case share recs’);

    //delete list of expired Case Share records
    delete scope; 
    Database.emptyRecycleBin(scope); 
    }

    global void finish(Database.BatchableContext BC) 

    //no post processing
    /* System.debug(‘## Batch Job Finished ##’);
    UpdateAccountFields m = new UpdateAccountFields ();
    String sch = ’20 30 8 10 2 ?’;
    system.schedule(‘Merge Job’, sch, m);*/

    }
    }

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:54 PM in reply to: How can we hard delete a record using a Salesforce Apex class by code?

    Hi,

    We can hard delete record or list of records using emptyRecycleBin() function in apex. Pass the record or record list to emptyRecycleBin() to delete it from Recycle Bin.
    Contact con = new Contact(Id = ’09k110000O5abc’);
    Database.emptyRecycleBin(con);

    Note: The DML operation datatbase.emptyRecycleBin() is limited to 200 items.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:52 PM in reply to: What are the Salesforce annotations? List all of them.

    Hi,

    An Apex annotation modifies the way that a method or class is used, similar to annotations in Java. Annotations are defined with an initial @ symbol, followed by the appropriate keyword.
    To add an annotation to a method, specify it immediately before the method or class definition.

    Apex supports the following annotations.

    @AuraEnabled
    @Deprecated
    @Future
    @InvocableMethod
    @InvocableVariable
    @IsTest
    @ReadOnly
    @RemoteAction
    @TestSetup
    @TestVisible

    Apex REST annotations:

    @RestResource(urlMapping=’/yourUrl’)
    @HttpDelete
    @HttpGet
    @HttpPatch
    @HttpPost
    @HttpPut

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:52 PM in reply to: What are different Salesforce annotations?

    Hi,

    The main use of annotation is to instruct the compiler that the class is to be used as the specific class as defined by the annotation. Annotations are defined with an initial @ symbol, followed by the appropriate keyword.

    Apex supports the following annotations.
    @AuraEnabled
    @Deprecated
    @Future
    @InvocableMethod
    @InvocableVariable
    @IsTest
    @ReadOnly
    @RemoteAction
    @SuppressWarnings
    @TestSetup
    @TestVisible

    Apex REST annotations:
    @RestResource(urlMapping=’/yourUrl’)
    @HttpDelete
    @HttpGet
    @HttpPatch
    @HttpPost
    @HttpPut

    Hope this helps.

Page 36 of 57