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.

@AuraEnabled(cacheable=true)

Last updated at Posted at 2022-06-21

エラーメッセージ:LWC LimitException: Too many DML statements: 1
number of DML statements:1 out of 0 ******* close to limit.

正常:number of DML statements:1 out of 150.

■実行時のパフォーマンスを改善するには、@AuraEnabled(cacheable=true) を設定してクライアントにメソッドの結果をキャッシュします。cacheable=true を設定するには、メソッドがデータの取得のみを行う必要があります。メソッドでデータを変更することはできません。

Link:
https://developer.salesforce.com/docs/atlas.ja-jp.234.0.lightning.meta/lightning/controllers_server_apex_auraenabled_annotation.htm

■LWCで呼び出すApexメソッドを作成します。
@Wireサービスで使用するApexには下記が必要です。

static
publicまたはglobal
@AuraEnabled(cacheable=true)

Link:https://qiita.com/TaaaZyyy/items/51908546c423661ff033

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?