LoginSignup
2
2

Salesforce ISVTE plugin を活用して AppExchangeアプリケーション開発を強化する方法

Posted at

奥が深いAppExchangeアプリケーション開発

Salesforceプラットフォームでの、AppExchangeアプリケーション開発。柔軟なカスタマイズができ、様々なビジネスニーズに対応したアプリケーションを開発できる豊富な実現手段が揃っています。

同じアプリケーション機能であっても、すべてプラットフォームの標準機能で作ることもあれば、もしかしたら一部をローコード・プロコードで作る場合もあるかもしれません。ほとんどを慣れたプロコードで作りたいというニーズもあるでしょう。また、年3回のアップデートでは、日々寄せられるご要望をもとに膨大な機能がリリースされています。

このようなSalesforceプラットフォームでAppExchangeアプリケーションを開発する際、よく耳にするのが、

  • 新機能を見逃してしまっていないか
  • Salesforceのベストプラクティスでなにか適用できるものはないか
  • パフォーマンスを向上させるために実はもっと良い手段があるのではないか

これらのお悩みに対し、実はあるツールを活用することで、機械的にセルフチェックすることができるようになります。

Salesforce ISVTE Plugin

その名を"Salesforce ISVTE Plugin"といいます。なぜツールなのにプラグイン?と思われるかもしれないですが、本ツールはSalesforce CLIのプラグインとして公開されています。Salesforce DXでの開発にて、必要に応じてプラグインをインストールすると利用できる、無償のオープンソースツールです。

インストールしてしまえば、あとは手元のメタデータに対しSalesforce CLIコマンドを実行すれば自動的にスキャンが行われ、数秒で分析結果を確認できます。

使い方

前提:Salesforce CLIのインストールが必要です

プラグインのインストール

プラグインをインストールします。本プラグインは未署名のため、y を入力し進めます。

$ sfdx plugins:install isvte-sfdx-plugin

スキャンの準備

スキャンしたいSFDXプロジェクトに移動します。

$ cd my-sfdx-project

例) my-sfdx-projectという名称のSFDXプロジェクト

ファイルフォーマットからメタデータフォーマットに変換します。

$ sfdx force:source:convert -r ./ -d .tmp

例) メタデータフォーマットファイルを.tmpディレクトリに格納

スキャンの実行① - 分析レポート

スキャンを実行します。

$ sfdx isvte:mdscan -d .tmp

分析レポートが表示されます。 (一部抜粋)

=== Inventory of Package:

 Metadata Type                         Count 
 ───────────────────────────────────── ───── 
 Permission Sets                       1     
 Tabs                                  4     
 Flows                                 1     
   Screen Flows                        1     
   Flow Templates                      0     
 Apex Classes                          4     
   With Future Methods                 0     
   With Aura Enabled Methods           1     
   Total Apex Characters               11633 
 Apex Triggers                         3     
   Async Triggers                      0     
   Total Apex Characters               5804  
...

=== Best Practices and Feature Recommendations:

Visit the ISV Technical Success Center:
For more resources to help build a successful app, visit the ISV Technical Success Center on the Partner Community
URL:http://p.force.com/TECenter
...

=== Quality Rules:

Custom Objects should have a description:
It is a best practice that Custom Objects have a description.
Components: BusinessTripType__c, CommuteType__c, Commute__c
...

=== Partner Alerts:

Stay on Top of Alerts:
Sign up here to be notified of all Partner Alerts
URL:https://sfdc.co/ISVTEAlertsAll
...

=== Installation Warnings

Package cannot be installed in Essentials due to:
  Record Types 
...

Please provide feedback on this tool: https://bit.ly/TEPluginFeedback
=== Inventory of Package: メタデータ一覧

アプリケーションに含まれるメタデータ別の使用数がリスト表示されます。開発途中のもの or 間違えて作成してしまったメタデータが意図せず混ざってしまっていないか、一目でチェックできます。

=== Best Practices and Feature Recommendations: ベストプラクティスや機能の推奨

プラットフォーム機能はベストプラクティス・考慮事項を抑えておくことが重要です。本ツールでは、スキャン対象のアプリケーションに含まれベストプラクティスが存在するものは、各ベストプラクティスの説明と関連記事へのリンクが提供されます。例えば、Batch Apexを使用していることを検出した場合、堅牢なBatch Apexデザインパターンに関する記事が表示されます。

また、ISV特化の重要な技術情報の提案も表示されます。例えば、あるISVアプリでFlowを使っている場合、ISV向けに特別に設計されたプラットフォーム機能であるFlowテンプレートを活用することで、お客様にとってより使いやすいアプリへと、製品強化につながるかもしれません。

=== Quality Rules: アプリケーション全体での品質向上

顧客組織にインストールされてからの使いやすさ・保守性を向上するために、コードやメタデータ内での改善点を確認できます。具体的には、カスタムオブジェクト、カスタムフィールドの説明欄を空欄のままにしてしまっている。APIバージョンを更新していない。などです。これら潜在的な箇所を特定することで、アプリケーションの可用性・保守性を向上させるためのアクションにつなげることができます。

=== Partner Alerts: パートナーアラートのチェック

Salesforce Platformに関するアプリケーション変更が必要になる可能性のあるものは、パートナーアラートとして公開されます。本ツールはパートナーアラートとメタデータを照らし合わし、関連する内容のみが表示されます。

=== Installation Warnings: 互換性に関するワーニング

アプリケーション構成によっては、インストール先Salesforce組織のエディションの違いにより、インストールできない場合が発生します。例えば、レコードタイプやカスタムプロファイルを使用している場合、Essentials Edition組織にインストールできないことをご存知でしょうか。Essentials、Group、Professional Editionにおいてのインストールできない理由について詳細が表示されます。

スキャンの実行② - テクノロジー採用スコアの計算

スキャンを実行します。

$ sfdx isvte:mdscan -d .tmp -t

スコアレポートが表示されます。(一部抜粋)

User Experience (20 Points)

 1. Lightning Web Components: Does your application metadata contain Lightning web components? (10 Points) 
   Found 
	Find more information about how to leverage the power of LWC and for best practices, see this webinar.
	URL:https://partners.salesforce.com/0693A000007Kd7oQAC


 2. Lightning Flow: Does your application metadata contain Lightning Flows? (10 Points) 
   Found 
	Flows are a powerful tool to enable forms based workflows and process automation to your users. See this webinar for more information.
	URL:https://partners.salesforce.com/0693A000007S2Dq


Analytics & Einstein (7 Points)

 1. Reports and Dashboards: Does your application metadata contain custom reports or dashboards? (7 Points) 
   Found 

 2. TableauCRM: Does your application metadata contain custom analytics implemented using Tableau CRM (formerly Einstein Analytics)? (10 Points) 
   Not Found 
	Start here to learn how to use TableauCRM in your application
	URL:https://sfdc.co/ISVTETCMGetStarted

 3. Einstein Predictions: Does your application metadata contain predictions using Einstein Prediction Builder or Einstein Discovery? (9 Points) 
   Not Found 
	Start here to learn how to use Einstein Prediction Builder and Einstein Discovery in your application
	URL:https://sfdc.co/ISVTEPredictionBuilder

 4. Next Best Action: Does your application metadata contain Next Best Actions to surface recommendations to end users? (7 Points) 
   Not Found 
	Start here to learn how to use Einstein Next Best Actions in your application
	URL:https://sfdc.co/ISVTENBA


Data Storage & Processing (14 Points)

 1. Experience Cloud: Does your application metadata contain Lightning Web Components which are rendered on Experience Cloud? (7 Points) 
   Not Found 
	Start here to learn more about how to use Experience Cloud in your applicatin
	URL:https://trailhead.salesforce.com/en/content/learn/trails/communities

 2. Apex: Does your application metadata contain Apex? (7 Points) 
   Found 

 3. Custom Objects: Does your application metadata contain Custom Objects? (7 Points) 
   Found 

 4. Platform Cache: Does your application metadata contain the free Platform Cache for ISVs? (9 Points) 
   Not Found 
	As part of the partner program and, with the Spring ’21 release, ISVs can now include that 3MB of platform cache into their managed packages. Check out this blog to see how the free cache provisioning works and what you need to do to take advantage of it.
	URL:http://bit.ly/ISVTEPlatformCache
 ...

スキャン対象のメタデータに対し、いくつかテクノロジー採用調査(AppExchangeパートナープログラムの一環)観点でスコアリングされ、ジャンルごとに集計されたスコアを確認できます。スコアがつかなかった = 未使用テクノロジーについては、URLリンク付きのものであれば、すぐにどのようなテクノロジーなのか?詳細を確認することも可能です。

おわりに

ご覧の通り、このツールを活用することで、非常に多くのインサイトが浮き彫りになります。公式ドキュメントでは、特定のユースケースについての詳細を確認できるのと、さらには独自ニーズに合わせたプラグインの拡張方法についても記載がございます。試しにスキャンしてみたり、ルールを変更してみたりと、色々試してみてください。

2
2
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
2
2