Thursday, May 27, 2021

Useful system application events for lightning developement

Below is list of application events which is very useful and can be used frequently in lightning development.

Note: These events are supported in Lightning Experience, the Salesforce mobile app, and Aura-based Experience Builder sites.


  • force:closeQuickAction

To close a quick action panel, you can use force:closeQuickAction event
var navEvent = $A.get("e.force:closeQuickAction");
if(navEvent){
navEvent.fire();
}

  • force:navigateToList
This event helps you to navigate to list view based on ListviewId specified.

var navEvent = $A.get("e.force:navigateToList");
if(navEvent){
navEvent.setParams({
"listViewId": listviews.Id,
"listViewName": null,
"scope": "Account"
});
navEvent.fire();
}
                               
How to get list view id using SOQL
SELECT Id FROM ListView WHERE SobjectType = 'Account' and Name='All Accounts' Limit 1

  • force:navigateToURL
This event helps you to navigate to URL specified in parameter.

var navEvent= $A.get("e.force:navigateToURL");
if(navEvent){
navEvent.setParams({
      "url": "/001/"
    });
navEvent.fire();
}

  • force:refreshView
To refresh or reload standard or custom component, use this event. This event ideally reload data without page refresh.

var navEvent= $A.get("e.force:refreshView");
if(navEvent){
navEvent.fire();
}

Note: This event impact performance and should be avoided. Also avoid repeated firing of this event from same component

  • force:showToast
This event can be used to display message below the header at the top of a view. You can specify the message and type (warning, success, info, other) and based on that color of message panel will changes. Default is other which shows panel similar to info.

showToastMessage:function(title,msg,duration,key,type,mode){
var toastEvent = $A.get("e.force:showToast");
if(toastEvent){
toastEvent.setParams({
"title": title,
"message": msg,
"duration":duration,
"type": type,
"mode": mode
});
toastEvent.fire();
}
}

Default value for mode is "dismissible" which display close icon. In duration you can specify the time in millisecond. Toast will remain in screen for this duration.


  • force:force:navigateToSObject
This event help you to navigate to record details page based on recordId specified:

var navEvent= $A.get("e.force:navigateToSObject");
if(navEvent){
navEvent.setParams({
"recordId": "003B0000000ybYX"
});
navEvent.fire();
}


Hope this help!!

11 comments:

  1. Do you need Finance? Are you looking for Finance? Are you looking for finance to enlarge your business? We help individuals and companies to obtain finance for business expanding and to setup a new business ranging any amount. Get finance at affordable interest rate of 3%, Do you need this finance for business and to clear your bills? Then send us an email now for more information contact us now via (financialserviceoffer876@gmail.com) whats-App +918929509036 Dr James Eric Finance Pvt Ltd Thanks

    ReplyDelete
  2. Does your firm, company or industry need financial assistance?
    Do you need finance to start your business?
    Do you need personal loan?
    Loan for your home improvements
    Mortgage loan
    Debt consolidation loan
    Commercial loan
    Education loan
    Car loan
    Loan for assets.
    Contact us today with for your loan request:financialserviceoffer876@gmail.com
    Mobile phone number:+918929509036

    ReplyDelete
  3. I am so delighted I found your weblog, I really found you by accident,
    while I was researching on Bing for something else, Regardless I am here now and would just like to say thank you for a fantastic post and a all round entertaining blog (I also love the theme/design), HOW TO GET A FAKE DRIVERS LICENSE THAT WORKS FROM THE DMV I don't have time to go through it all at the minute but I have bookmarked it and also added your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the excellent job.

    ReplyDelete
  4. IPTV requires broadband Internet connectivity because of the high bandwidth demands of digital video. In theory, connecting to this broadband net would certainly permit IPTV customers added control over their tv programs and also the capability to tailor-make it to their individual choices visit here.

    ReplyDelete
  5. Do you need Finance?
    Are you looking for Finance?
    Are you looking for a money to enlarge your business?
    We help individuals and companies to obtain loan for business
    expanding and to setup a new business ranging any amount. Get a loan at affordable interest rate of 3%, Do you need this cash/loan for business and to clear your bills? Then send us an email now for more information contact us now via Email:financialserviceoffer876@gmail.com whats-App +918929509036

    ReplyDelete
  6. Are you interested in any kinds of hacking services?
    Feel free to contact TECHNECHHACKS.

    For years now we’ve helped so many organizations and companies in hacking services.
    TECHNECHHACKS is a team of certified hackers that has their own specialties and they are five star rated hackers.

    We give out jobs to hackers (gurus only) to those willing to work, with or without a degree, to speed up the availability of time given to jobs!!

    Thus an online binary decoding exam will be set for those who needs employment under the teams establishment.


    we deal with the total functioning of sites like,


    • SOCIAL MEDIA (Facebook, Twitter, Instagram, Snapchat, google hangout etc.)

    • SCHOOL GRADES

    • IOS/OS

    • CREDIT SCORES

    • BANK ACCOUNTS

    • SPOUSES PHONE

    Our special agents are five star rated agents that specializes in the following, and will specially be assigned to you for a special job well DONE.

    • WESTERN UNION TRANSFER

    • CREDIT CARDS INSTALLATION

    • MONEY FLIPPING

    • CRIMINAL RECORDS

    • BTC RECOVERY

    • BTC MINING

    • BTC INVESTMENT

    Thus bewere of scammers because most persons are been scammed and they ended up getting all solutions to their cyber bullies and attacks by US.

    I am Jason williams one of the leading hack agent.

    PURPOSE IS TO GET YOUR JOBS DONE AT EXACTLY NEEDED TIME REQUESTED!!!



    And our WORK SUCCESS IS 100%!!!



    We’re always available for you when you need help.

    Contact or write us on:

    Technechhacks@gmail.com

    SIGNED....!

    Jason. W

    TECHNECHHACKS
    2021©️All Right Reserved

    ReplyDelete
  7. HOW I GO MY DESIRED XMAS LOAN AMOUNT $520,000.00 FROM A RELIABLE AND TRUSTED LOAN COMPANY LAST WEEK. Email for immediate response: drbenjaminfinance@gmail.com

    Hello everyone, Am here to testify of how i got my loan from BENJAMIN LOAN FINANCE(drbenjaminfinance@gmail.com) I don't know if you are in need of an urgent loan to pay bills, start business or build a house, they offer all kinds of loan. So feel free to contact Dr.Benjamin Scarlet Owen he holds all of the information about how to obtain money quickly and painlessly via Email: drbenjaminfinance@gmail.com

    and consider all your financial problems tackled and solved. Share this to help a soul right now, Thanks


    ReplyDelete