Lightning URL Hack with Record Types!

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • Hey Salesforce Friends! 👋
    🗞️ Sign-up to the Part-Time Salesforce Academy newsletter here: www.adamfoyston.com/newsletter
    Here is the Custom URL used in the demo :)
    /lightning/o/Contact/new?recordTypeId=[Your Record Type ID]&defaultFieldValues=AccountId={!Account.Id}
    LINKS
    Start up you're own Trailhead account: trailhead.salesforce.com/
    FREE Salesforce Developer Org: developer.salesforce.com/signup
    Trailhead Career Paths: trailhead.salesforce.com/care...
    Timecodes
    0:00 - Intro & Overview
    1:44 - Demo to Show it Works!
    2:56 - How to Create Custom Record Type URL Buttons
    8:21 - Learn More/Outro
    If you found this video useful please subscribe for more videos like this every week!
    Also, let me know if you have any questions about Salesforce and/or there are any other videos you'd think would be good to make.
    May the Salesforce be with you! x
    Connect with me on LinkedIn: / adam-foyston-32148954
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 30

  • @mineyours1110
    @mineyours1110 2 ปีที่แล้ว +1

    Thanks a lot Adam- works a treat! Keep the hacks coming!

  • @BurritoWizard
    @BurritoWizard 2 ปีที่แล้ว +1

    You, sir, are MY HERO! Many thanks! So insightful

    • @AdamFoyston
      @AdamFoyston  ปีที่แล้ว

      you're welcome BurritoWizard! hmmmm, I'm hungry now.

  • @Rootkit_69
    @Rootkit_69 2 ปีที่แล้ว +1

    You are the best mentor ever!!! I have learned a lot from you.

    • @AdamFoyston
      @AdamFoyston  2 ปีที่แล้ว

      Thanks for the comments! Very kind. :)

  • @ymerojas
    @ymerojas 2 ปีที่แล้ว +1

    Very informative!

    • @AdamFoyston
      @AdamFoyston  2 ปีที่แล้ว

      Glad it was of help. Cheers :)

  • @Mr14themoney24thesho
    @Mr14themoney24thesho ปีที่แล้ว

    So stinking helpful today.

  • @jennyt5618
    @jennyt5618 2 ปีที่แล้ว +1

    Thank you for this wonderful video! Is it possible to pass in two record ids before the ampersand? In my URL, the first parameter is the contact id. I then want to pass in the correct contact record type id.

    • @AdamFoyston
      @AdamFoyston  ปีที่แล้ว

      Thanks for the question...hmmm not sure to be honest. My gut is telling me no but I could be wrong. YOu posted this 2 months ago so maybe you figured it out? LEt me know. Cheers.

  • @monstamicz
    @monstamicz 2 ปีที่แล้ว +2

    Thanks for the vid man! However, instead of setting the default record type on the button. I want the standard behavior first where there is a screen which asks you which record type you want in the first place. Have you tried this man and how?

    • @AdamFoyston
      @AdamFoyston  ปีที่แล้ว +3

      Thanks for the question.....hmmm, not sure you can do that. Unfortunately, from memory (which isn't great) you can't do that unless from a standard SF button You can try it out by removing the record type part from the URL and ensure there are multiple record types that the user can have and see what happens. My feeling is you can't because the custom URL function isn't getting the field values you're setting in it, within the cache and so if you got to the Record Type selection page, it would lose the info in the URL. Best of luck though! Adam

  • @user-oi2il8jv1u
    @user-oi2il8jv1u 4 หลายเดือนก่อน

    The part of this that I cannot seem to solve is this: Yes the buttons do create the correct record type, but the layout shown does not adhere to the page layout or compact layout assignments made for that record type. Between the 6 different record types we have for my object, there are some 60 fields, that I only want to show 10 or so on the creation window that are specific to each record type. GAHHHH....

  • @ihorilkiv6328
    @ihorilkiv6328 2 ปีที่แล้ว +1

    Thanks

  • @TravelEngineers
    @TravelEngineers 2 ปีที่แล้ว +1

    Hey Adam, Can we use same button for navigating to different record type creation pages based on any custom field value on Account. For example: based on field value on account, it should open service contact record type or sales contact record type. Using If/else may be?

    • @AdamFoyston
      @AdamFoyston  ปีที่แล้ว

      Great question. Unfortunately, no you can't use logic IF statements in the Custom URL. However, you might be able to get there by maybe creating a custom formula field to do the logic for you, with the result being the ID of the record type you want to use. Then the URL can use that formula value? Best of luck

  • @hackersworld4244
    @hackersworld4244 2 ปีที่แล้ว +2

    Hi Adam, This video is also Great Explanation. i have one scenario , need to clone a record in this time we passing some field values to null how can i do this. Please Reply as soon as possible. Thank you
    Scenario: In asset object when we clone a record pass some field values to null use URL Hijacking how can i do this?

    • @AdamFoyston
      @AdamFoyston  2 ปีที่แล้ว +2

      Hi there, so the best way I've found is to create a new button in the object you're looking to clone records from. Then, and I'm assuming you're in Lightning, you set the URL (Hack) to create a new record, but set the fields values for the fields you want to keep using the 'merge' field reference to reference itself......does that make sense? In other words, if I'm in an Opportunity and I click my customer clone button, I can have it create a new record, but copy only the fields across I need such as say, Close Date and Stage. Here is an example URL for a button I created just now that was added to my Opportunity object.
      /lightning/o/Opportunity/new?defaultFieldValues=StageName={!Opportunity.StageName},CloseDate={!Opportunity.CloseDate}
      The newly created record now has only the Stage and the Close Date passed to it. The rest of the fields are blank.
      Hope this helps.

  • @ablecloudadvisors665
    @ablecloudadvisors665 2 ปีที่แล้ว +1

    Can I apply this to an existing record? My scenario: during the approval process my opp Record Type gets updated. If rejected, I need to RE-enter the Approval Process. To do so I need to revert back to the original Opp record type. Your hack appears to work for NEW records. I would use the native "Change Record Type" button, BUT I also want to revert the Stage and another field that must be NULL to re-enter the approval process. Is that possible?

    • @AdamFoyston
      @AdamFoyston  ปีที่แล้ว

      Hi there, great question. To be honest I'm not sure you can looking at the use case and you might have to use a flow to help execute. The reason (from memory - I could be wrong) is that the URL info isn't stored in the cache, so if you are sent to the Record Type selection page, the remaining URL isn't saved, so it's lost. Again, a flow might help here

  • @MuhammadUmair-lt2bh
    @MuhammadUmair-lt2bh ปีที่แล้ว

    Hi Adam. Thank you for this use full informtion related tp custion url button hack.
    I have query about custon url button.
    I have standard related list Service authorizate on Agenda Item custom object. I want to create new record on Service Authorizate related list on agenda item object but on service authorizate have 2 record type service and adjustment. I want to create only services record dircetly but I'm not able.
    I have tried to create custm button but i'm not successfull. Please give me any solution about this query.
    I'm waiting your response.

  • @Vinay-fd9ss
    @Vinay-fd9ss 2 ปีที่แล้ว +1

    Hey Adam, here recordTypeId we are passing ID, here i want to give record Type name, is that possible to give record type name like this (recordTypeId = 'ABCD'). while pushing this sandbox to production RecordTypeId changes. How to pass recordtype name in url ????

    • @AdamFoyston
      @AdamFoyston  2 ปีที่แล้ว

      Hi, great question. You're right that the ID change as you move your dev through the orgs to Production. To my best knowledge there isn't a way of passing the name and having it set that way unfortunately. I think part of the reason for this is uniqueness. there could be a scenario that the record types are named the same, and maybe SF to prevent that only allow ID's? I'm not sure the reason, but unfortunately you need to remember to update the Record Type ID as part of your 'Post-Deployment' steps.

  • @carlossalvadorbaldo6570
    @carlossalvadorbaldo6570 ปีที่แล้ว

    Hi, Adam! Very useful and interesting all these "URL hack" videos 😉
    I have an use case related to this topic: I would like to create a Custom URL Button which EDITS the Status of the current Lead to "Discard". To sum up, a button called "Discard Lead" with which users can change easily the Status of the Lead to that "Discard" status.
    Honestly I've tried a lot of URL combinations but nothing works (probably is not possible this editing action via Custom URL Button).
    *This was my last attempt: lightning/o/Lead/edit?defaultFieldValues=Id={!Lead.Id},Status=Rejected
    Thanks for your support!

  • @Factovines.
    @Factovines. 2 ปีที่แล้ว +1

    🙌Please make video of flows datatable from unofficial sf and explore filter, edit & save in datatble.

    • @AdamFoyston
      @AdamFoyston  2 ปีที่แล้ว +1

      Great suggestion. Do you mean the lightning component to display a table of values?

    • @Factovines.
      @Factovines. 2 ปีที่แล้ว

      @@AdamFoyston yes. 😍 If possible inline edit datatble. I like your videos awesome explanation🙌.