0

I got requirement to recalculate B2B Webstore index programatically.

Found documentation here: https://developer.salesforce.com/docs/atlas.en-us.232.0.apexref.meta/apexref/apex_ConnectAPI_CommerceSearchSettings_static_methods.htm#apex_ConnectAPI_CommerceSearchSettings_postCommerceSearchIndex_2

But when trying to save class (API 52.0) :

public with sharing class B2B_SearchRecalculation { public static void recalculate() { ConnectApi.CommerceSearchIndex xyz = ConnectApi.CommerceSearchSettings.postCommerceSearchIndex('XYZ'); } }

I am getting an error:

B2B_SearchRecalculation.cls Method does not exist or incorrect signature: void postCommerceSearchIndex(String) from the type ConnectApi.CommerceSearchSettings (5:80)

Please support.

1 Answers1

0
public with sharing class B2B_SearchRecalculation {
  public static void recalculate()
  {
    ConnectApi.CommerceSearchIndex xyz =
    ConnectApi.CommerceSearchSettings.createCommerceSearchIndex('webstoreid');
  }
}
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 10 '21 at 00:13