Loading
設定並維護零售執行
目錄
選取篩選

          沒有結果
          沒有結果
          以下是搜尋小祕訣

          檢查關鍵字的拼字。
          使用較常見的搜尋字詞。
          選取較少篩選條件以擴大您的搜尋。

          搜尋所有 Salesforce 說明
          特定商店的建議造訪

          特定商店的建議造訪

          使用 Apex 選取您要 Einstein 提供造訪建議的商店清單。建立 Apex 動作後,使用您策略中的「產生」元素以選取 Apex 動作。

          必要版本

          可用版本:啟用 Consumer Goods Cloud 的 ProfessionalEnterpriseUnlimited 版本。
          備註
          備註 我們建議您使用「產生」元素以載入資料。使用「產生」元素有助於克服由 Salesforce 管理員施加的個別交易限制。
          重要
          重要 若要在策略中使用 Apex 動作,請您的開發人員以 @InvocableMethod 註解適當的方法。

          用於篩選商店的 Apex 類別如下所示:

          global class LoadStores {
              global class RecommendationRequest {
                  @InvocableVariable(label='Store Ids')
                  public String siteIds;
              }
              
              @InvocableMethod(label='Get Stores from Request' description='Gets stores that are chosen in the request')
              public static List<List<Recommendation>> getVisits(List<RecommendationRequest> requests) {
                  List<List<Recommendation>> recos = new List<List<Recommendation>>();
                  for(RecommendationRequest request : requests){
                      List<Recommendation> output = new List<Recommendation>();
                      List<String> siteList = request.siteIds.split(',');
                      List<RetailStore> stores = [SELECT Id, Name FROM RetailStore WHERE Id IN :siteList];
                      for(RetailStore store : stores){
                          Recommendation rec = new Recommendation(
                              Name = store.Name,
                              Description = store.Name,
                              ExternalId = store.Id
                          );
                          output.add(rec);
                      }
                      recos.add(output);
                  }
                  return recos;
              }
          }

          當您在策略中指定 Apex 動作後,請將可叫用變數標籤指定為 Apex 動作的參數。在您策略中的「對應」元素,將參數與您想要造訪建議的商店識別碼對應。商店識別碼必須在逗號分隔清單中以雙引號指定。

           
          正在載入
          Salesforce Help | Article