[External] Request Table 843 "Cash Flow Setup".GetMLCredentials
Platform 14.0.29065.0. runtime 3.0 Get-NavBuildFileVersion returns 14.0.65000.0.
Trying to use this in a forecast handler CU:
CashFlowSetup.GetMLCredentials(ApiUrl, ApiKey, LimitValue, UsingStandardCredentials);
But get the error that it cannot be used for ‘Extension’ development. Below is the procedure definition in the CashFlowSetup table. As you can see its marked internal. Please evaluate this to provide External access.
Another option, if standard credentials are being used, is RetrieveSaaSMLCredentials, which is not decorated with an access attribute, maybe this procedure is intended for External development but currently is not available for External development.
[Internal] PROCEDURE GetMLCredentials(VAR APIURL : Text[250];VAR APIKey : Text[200];VAR LimitValue : Decimal;VAR UsingStandardCredentials : Boolean) : Boolean; VAR ServicePassword : Record 1261; PermissionManager : Codeunit 9002; BEGIN // user-defined credentials IF IsAPIUserDefined THEN BEGIN ServicePassword.GET("Service Pass API Key ID"); APIKey := COPYSTR(ServicePassword.GetPassword,1,200); IF (APIKey = '') OR ("API URL" = '') THEN EXIT(FALSE); APIURL := "API URL"; UsingStandardCredentials := FALSE; EXIT(TRUE); END;
UsingStandardCredentials := TRUE;
// if credentials not user-defined retrieve it from Azure Key Vault
IF PermissionManager.SoftwareAsAService THEN
EXIT(RetrieveSaaSMLCredentials(APIURL,APIKey,LimitValue));
END;
LOCAL PROCEDURE RetrieveSaaSMLCredentials(VAR APIURL: Text[250];VAR APIKey : Text[200];VAR LimitValue : Decimal) : Boolean;
VAR
TimeSeriesManagement : Codeunit 2000;
LimitType : Option;
BEGIN
IF NOT TimeSeriesManagement.GetMLForecastCredentials(APIURL,APIKey,LimitType,LimitValue) THEN
EXIT(FALSE);
APIURL := APIURL + '/execute?api-version=2.0&details=true';
EXIT(TRUE);
END;