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.

Apexの備考

Last updated at Posted at 2023-02-16

Apex:
public with sharing class TestCtr{

@AuraEnabled(cacheable=true)
public static List<Opportunity> getOpportunityWithOffSet(Id accId,Integer limitSize,Integer offSet){
    return [select Id,name,StageName,CloseDate,Amount,Account.name
              from Opportunity
             where AccountId =: accId
             Limit :limitSize
            offSet :offSet
              ];//レコードの内容を戻る
    //return database.countQuery(SQL);//レコードの件数を戻る
}

}


備考:
1.@AuraEnabled
  このメソッドをLWC、Auraで使用できます。
参照:https://developer.salesforce.com/docs/atlas.ja-jp.apexcode.meta/apexcode/apex_classes_annotation_AuraEnabled.htm
2.(cacheable=true)
  メソッドの結果をキャシュー、検索条件が変わると、自動反映できます。
3.offset
:https://developer.salesforce.com/docs/atlas.ja-jp.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_offset.htm

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?