Forum Replies Created

Page 45 of 53
  • Hi

    Below are some points to remember:

    Each savepoint you set counts against the Governor limit for DML statements.
    If you insert the ID on an SObject after setting the savepoint, the ID will not be cleared after a rollback.
    Static variables are not reverted during a rollback. If you run the trigger again, the static variables will retain the values from the previous run.
    THanks

  • Parul

    Member
    September 14, 2018 at 4:51 am in reply to: Is it possible to create trigger on views in Salesforce?

    I think you can perform actions according to you on before and after events or task but you can not create trigger on views in Salesforce.

    Thanks

  • Parul

    Member
    September 14, 2018 at 4:48 am in reply to: Can a Salesforce trigger call a batch class in Salesforce?

    Yes, you can call the batch class using trigger but there must be a governor limit. And you need to ensure it does not cross the governor limit.

     

    Thanks

  • Parul

    Member
    September 14, 2018 at 4:46 am in reply to: What is the return type of Trigger.Old and Trigger.OldMap in Salesforce?

    Trigger.oldMap & Trigger.New are returning the same information on after update trigger

     

    Trigger.old: Returns a list of the old versions of the sObject records.
    Note that this sObject list is only available in the update and delete triggers.

     Trigger.oldMap: A map of IDs to the old versions of the sObject records.

    Note that this map is only available in the update and delete triggers.
    suppose you have a custom object Custom_obj__c

    Example:
    Trigger.old means it is a List<Custom_obj__c>
    and

    Example:
    Trigger.oldMap means it is a map<Id, Custom_obj__c>

     

    THanks

  • Parul

    Member
    September 14, 2018 at 4:42 am in reply to: When to use before vs after Triggers in Salesforce?

    Hi,

    Triggers can run BEFORE the action is taken or AFTER the action is taken.

    BEFORE triggers are usually used when validation needs to take place before accepting the change. They run before any change is made to the database.

    Example: Let’s say you run a database for a bank. You have a table accounts and a table transactions. If a user makes a withdrawal from his account, you would want to make sure that the user has enough credits in his account for his withdrawal. The BEFORE trigger will allow to do that and prevent the row from being inserted in transactions if the balance in accounts is not enough.

    AFTER triggers are usually used when information needs to be updated in a separate table due to a change. They run after changes have been made to the database (not necessarily committed).

    Example: After a successful transaction, you would want balance to be updated in the accounts table. An AFTER trigger will allow you to do exactly that.

     

    Thanks.

  • Hi,

    If you are using with List then you will Before.trigger to check duplicate then trigger insert data after check.

     

     

    Thanks

  • Parul

    Member
    September 14, 2018 at 4:36 am in reply to: Can we use Workflow Rules with Time Triggers in Salesforce?

    Yes you can use trigger will execute on specified time-based-workflow.

     

    Thanks

  • Outbound messaging uses the notifications() call to send SOAP messages over HTTP(S) to a designated endpoint when triggered by a workflow rule.

     

    After you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. The message contains the fields specified when you created the outbound message. Once the endpoint URL receives the message, it can take the information from the message and process it. To do that, you need to examine the outbound messaging WSDL.

     

    Thanks

  • Parul

    Member
    September 14, 2018 at 4:29 am in reply to: Does trigger.oldmap change during recursion in Salesforce?

    Hi

    Trigger.old contains a version of the objects before the specific update that fired the trigger. However, there is an exception. When a record is updated and subsequently triggers a workflow rule field update, Trigger.old in the last update trigger won’t contain the version of the object immediately prior to the workflow update, but the object before the initial update was made. For example, suppose an existing record has a number field with an initial value of 1. A user updates this field to 10, and a workflow rule field update fires and increments it to 11. In the update trigger that fires after the workflow field update, the field value of the object obtained from Trigger.old is the original value of 1, rather than 10, as would typically be the case.
    Based on that, I think Trigger.old will maintain the original value even throughout multiple loops through the order of execution due to recursion

  • Parul

    Member
    September 14, 2018 at 4:28 am in reply to: Can we use SOSL statements in Salesforce triggers?

    Yes you can use SOSL in which trigger in which the data resides.

    Retrieve data for a specific term that you know exists within a field. SOQL can searches are faster and can return more relevant results.
    It finds the search text efficiently from multiple objects whether they are related to each other or not.
    Retrieve data that’s in Chinese, Japanese, Korean, or Thai. Morphological tokenization for CJKT terms helps ensure accurate results.

     

    List<list<SObject>> accountSearchList =newList<List<SObject>>();
    accountSearchList=[FIND {Joe Smith}IN Name Fields RETURNING
    lead (name, phone Where createddate = THIS_FISCAL_QUARTERLIMIT 20) ];
    list<lead > accs;
    accs=(list<lead>)result[0];
    system.debug(accs);
    Example of SOSL

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 8:07 pm in reply to: This error has sowing when i am try to convert lead into opportinuty

    Hi,

    I think it is a mandatory field, so you need to fill that field after that the lead into an opportunity.

    Thanks

  • Hi

    Salesforce provides workbooks for in .pdf and .html format. You should start with Force.com apex workbook, VF workbook and so on.

    After completing the workbook you should start practice all concepts by practical implementation from Salesforce Trailhead place to learn Salesforce for beginner and Experienced.

    Thanks

  • Parul

    Member
    September 13, 2018 at 7:42 pm in reply to: Canvas App in Salesforce

    Hi

    Canvas enables you to expose your canvas apps in the Salesforce app. The Salesforce app is Salesforce on the go. This enterprise-class mobile app gives you real-time access to the same information that you see in the office, but it’s organized for getting work done when you’re away from your desk. Just like in the full Salesforce site, users can access publisher and Chatter feed items, including Canvas apps.

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 7:36 pm in reply to: What is single sign-on(SSO) in Salesforce?

    Hi

    Single Sign-On is a single credential to access multiple applications. It is a session service plus an authentication service which gives user to use single login credentials(example – username and password) to enter multiple web  applications. There are two terms that are mostly used in SSO first is Identity Provider and second Service Provider.

    Thanks

     

  • Parul

    Member
    September 13, 2018 at 7:25 pm in reply to: What is the difference between pageblocktable and datatable in VF pages?

    Hi

    apex:pageBlockTable

    1) uses salesforce styling
    2) No need to specify the headers
    3) mandatory attribute "value".

    apex:dataTable

    1) Need to specify the headers
    2) we can specify custom style classes.
    3) No mandatory attribute "value" unlike in pageblockTable

     

    Thanks

  • Hi

    Insert Operation:

    • 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.insery 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.

    Example: If we are inserting 10 records in an object, Where 5 records are correct and remaining 5 records are incorrect.

    In DML statement (Insert) all the 10 records will be failed, because if one record is incorrect or error means all other remaining records will not be inserted. It will throw error.
    In Database.insert 5 records will be inserted, remaining 5 records will be failed.(i.e. Partial DML Operation).

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 6:22 pm in reply to: use lightning component as Tab like custom object

    Hi,

    <aura:component implements="force:appHostable"> this is the interface need to implement so that you can use lightning component as Tab like custom object and VF page

    There are three steps to add Lightning components to a Visualforce page.

    Add the <apex:includeLightning /> component to your Visualforce page.
    Reference a Lightning app that declares your component dependencies with $Lightning.use().
    Write a function that creates the component on the visualforce page with $Lightning.createComponent().

     

    Thanks.

  • Parul

    Member
    September 13, 2018 at 6:12 pm in reply to: display related records in Object view

    Hi Anjali,

    You can use following tag to display related records in object view

    <apex:repeat var="exam" value="{!relatedTo.Account__r}">

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 5:36 pm in reply to: What are the differences between 15 and 18 digit record IDs?

    Hi,

    15 digit case-sensitive version

    15 digit ID is what will be received from within the user interface

    18 digit case-insensitive and best used for manipulating data outside Salesforce

    18 digit id is referenced through in the API and other 3rd party tools.

     

    Thanks

  • Hi,

    Export All : contain all the record (record exist + recycle bin record)
    Export : Record which exist live in the object

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 5:03 pm in reply to: What are the static resources in Salesforce?

    Hi,

    Static resources allow you to upload content that you can reference in a Visualforce page, the user interface in a Visualforce base can display dynamic content the value of which keeps changing based on user responses. But there are times when we need some content which should not change with the change in values of other components in the page. For example, an image file may be required to remain constant. Such content which cannot be changed in a page is known as a static resource.

    Following are a few static resources in Salesforce −

    Images
    Javascript Files
    Flash files
    CSS files

    Thanks

  • Parul

    Member
    September 13, 2018 at 4:59 pm in reply to: Accessing Visualforce Components values into a Javascript

    JavaScript provides the framework for communicating between other JavaScript objects, HTML elements, and the Visualforce controller.

    JavaScript code can be written in a Visualforce page and can be included in a Visualforce page by using a static resource. This is the best method to use to include a JavaScript library in a Visualforce page. We can use the <apex:includeScript>component to include a JavaScript library from static resources.

    For example:

    <apex:includeScript value="{!$Resource.MyJSFile}"/>

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 4:54 pm in reply to: What is Accordion in Salesforce lightning component?

    Hi,

    Lightning:accordion always has one section open. Each section can hold one or more Lightning components.

    <lightning:accordionSection name="{!con.name}" label="{!con.Name}">
    <aura:set attribute="body">
    <p>Street : {!con.MailingStreet}</p>
    <p>City : {!con.MailingCity}</p>
    <p>State : {!con.MailingState}</p>
    <p>Postcode : {!con.MailingPostalcode}</p>
    <p>Country : {!con.MailingCountry}</p>
    <p>Email : {!con.Email}</p>
    <p>Phone : {!con.Phone}</p>
    </aura:set>
    </lightning:accordionSection>

     

    Thanks

  • Parul

    Member
    September 13, 2018 at 4:04 pm in reply to: When do you use a before vs. after trigger?

    Hi,

    Triggers can run BEFORE the action is taken or AFTER the action is taken.

    BEFORE triggers are usually used when validation needs to take place before accepting the change. They run before any change is made to the database.

    Example: Let's say you run a database for a bank. You have a table accounts and a table transactions. If a user makes a withdrawal from his account, you would want to make sure that the user has enough credits in his account for his withdrawal. The BEFORE trigger will allow to do that and prevent the row from being inserted in transactions if the balance in accounts is not enough.

    AFTER triggers are usually used when information needs to be updated in a separate table due to a change. They run after changes have been made to the database (not necessarily committed).

    Example: After a successful transaction, you would want balance to be updated in the accounts table. An AFTER trigger will allow you to do exactly that.

     

    Thanks.

  • Parul

    Member
    September 13, 2018 at 3:57 pm in reply to: Give an example of a standard object that’s also junction object.

    Hi Avnish,

    Because opportunity product (Opportunity LineItem) is a junction object between opportunity and pricebookentry.

    For further knowledge read this :-

    Opportunity:
    Opportunity object stores data of potential sales and pending sales.
    One opportunity can only have one pricebook.
    One opportunity can contain one or many line items.

    Product:
    Product object is a catalogue of items or services for sales.
    A product may contain one or more different sets of prices (PriceBookEntry).

    OpportunityLineItem:
    List of products that link with opportunity containing data on types of products and respective prices.
    One opportunity line item can only be linked to one opportunity.
    One opportunity line item can only be linked to one price book entry.

    PricebookEntry:
    PricebookEntry object is a product entry in a pricebook.
    This object allows products to be linked to standard price book or custom price book.
    One price book entry is linked to only one product.
    One price book entry can only appear in one pricebook.
    One price book entry can be used in multiple line items. This also further creates flexibility for users to set their own prices.

     

    Hope this will help you.!

     

    Thanks

Page 45 of 53