0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Salesforce ClassicのカスタムリンクはLightningの実現

Last updated at Posted at 2022-10-30

要件

クラシックSalesforceのサイドバーにカスタムリンクが表示されています。メールテンプレート文面がよく表せられ、メールに張り付けられる。
Lightningの場合、どう実現できますか。

よく使うため、ドキュメントにテキストファイルとして保存されている。カスタムリンクにそのURLをのっています。固定の場合、Lightning環境にリッチテキストで実現できる。

検証

①テスト用のテンプレート文面を用意する
②ドキュメントにアップロード
Lightningにドキュメントタグがないので、クラシックに切替、操作する
 image.png
File名などを参照
image.png

③リッチテキストにHyplinkを編集する

 /servlet/servlet.FileDownload?file=xxx

備考

 上記方法は新しいタブを開けられるが、Popupかつ一般化にするため、LWCがいります。
Html

<a href={url} onclick={handleClick}>Account Home</a>

Js

   handleClick(){
        window.open('/servlet/servlet.FileDownload?file=0155g000000yjsQ','_blank',
        'height=600,location=no,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=1');
    }

結果
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?