I've been working on getting updates from a custom object to generate a chatter post that has a reference to the custom object on a case. I have been able to get what I want in classic experience as I was able to open up another tab on the browser to the custom object but in lightning the same thing happens while I just want the tab to be opened inside the lightning window / same browser tab.
I have been the following anonymous apex to test creating these on cases:
All of the links I created from the anonymous apex create a new browser tab. I was wondering how I would get the same functionality as the button I have highlighted in the picture where clicking on it would open another tab inside the lightning window instead of another tab on the browser.
I have tried using mypost.richtext = true; but that disables the ability to use HTML markup, is there a way to put an anchor tag while setting this to true? That be great to be able to get the tab icon like the case icon I have highlighted too!
Thanks in advance.