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.