ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[External] Request Table 843 "Cash Flow Setup".GetMLCredentials

Open jaadkins81 opened this issue 7 years ago • 0 comments

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;

jaadkins81 avatar Mar 21 '19 20:03 jaadkins81