Introducing G2.ai, the future of software buying.Try now
Product Avatar Image

Microsoft Dynamics 365 Business Central

(888)4.0/5

30.0

Nps Score

Already have Microsoft Dynamics 365 Business Central?

All Microsoft Dynamics 365 Business Central Discussions

# I want to code an authentication interface on Microsoft dynamic center I did all the linking steps between microsoft azure and microsoft dynamic. I found this code, I assumed that this function is the desired function. but when i ran the code it gave me an empty token. I don't know where the fault is! please help me the code: page 50148 "testaccestoken" { PageType = Card; ApplicationArea = All; UsageCategory = Administration; layout { area(Content) { group(GroupName) { field(UserEmail; UserEmail) { ApplicationArea = All; } field(PWD; PWD) { ApplicationArea = All; } field(AccessToken; AccessToken) { ApplicationArea = All; } } } } actions { area(Processing) { action(Token) { ApplicationArea = All; Image = TestFile; trigger OnAction() begin AadTenantId := '******'; Client_Id := '*****'; UserEmail := 'Salma.bouzeida@vaganet.fr'; pwd := '*****'; ResourceURL := 'https://api.businesscentral.dynamics.com/'; // //Environment := authTable.Environment; // OAuth2.GetDefaultRedirectURL(RedirectURL); ClientSecret := '******'; // ** DEFAULT VALUES - redirect and RedirectURL := 'https://businesscentral.dynamics.com/OAuthLanding.htm'; // Client_Id := '*******';// powershell ID default MicrosoftOAuth2Url := 'https://login.microsoftonline.com/ec61defb-c499-4bae-afbe-e96c06b43964/oauth2/v2.0/authorize'; //TOKEN //OAuthAdminConsentUrl := 'https://login.microsoftonline.com/common/adminconsent'; Scopes.Add('api://******/user_impersonation'); OAuth2.AcquireTokensWithUserCredentials(MicrosoftOAuth2Url, Client_Id, Scopes, UserEmail, pwd, AccessToken, idToken); //Oauth2.AcquireTokenWithClientCredentials(Client_Id, ClientSecret, MicrosoftOAuth2Url, RedirectURL, ResourceURL, AccessToken); Message(AccessToken); end; } } } var ClientSecret: Text; RedirectURL: text; MicrosoftOAuth2Url: text; OAuthAdminConsentUrl: text; Scopes: List of [Text]; ResourceURL: Text; Client_Id: text; UserEmail: text; AccessToken: text; idToken: text; AadTenantId: Text; Oauth2: Codeunit OAuth2; OAuth2Authorization: Codeunit "OAuth 2.0 Mgt."; PWD: Text; } ##### Post Metadata
- Posted at: over 3 years ago
- Net upvotes: 1
# I want to code an authentication interface on Microsoft dynamic center I did all the linking steps between microsoft azure and microsoft dynamic. I found this code, I assumed that this function is the desired function. but when i ran the code it gave me an empty token. I don't know where the fault is! please help me ##### Post Metadata
- Posted at: over 3 years ago
- Net upvotes: 1
# How do we make the Reversing feature with Analytical Accounting work? HOw to fix AA balances in Management Reporter? AA has been our main issue. One of them is when we use the Reversing feature in GP. The original entry works with the AA code posting but if you make it a reversing entry, the reversing entry drops the AA code even though it is a requirement. The company that sold us GP can't help much. For Management Reporter, we always have issues with AA balances on our reports most esp with balance sheet accounts. The company that sold us this reporting tool can't seem to help us. ##### Post Metadata
- Posted at: over 4 years ago
- Net upvotes: 1
# How to get it sync with Pardot? Can you please help me on how can I sync a Microsoft Dynamics account with Pardot? ##### Post Metadata
- Posted at: almost 5 years ago
- Net upvotes: 1
# Is there an easy way to get the year end closing to go more smoothly? ##### Post Metadata
- Posted at: about 5 years ago - Author title: Payroll Specialist at Inter Valley Health Plan
- Net upvotes: 1
# what does clearing option do in financial module of GP? ? ##### Post Metadata
- Posted at: over 5 years ago - Author title: Professional poker player/ User software tester
- Net upvotes: 1
# Are there any plans to build out Dynamics to compete with Salesforce? ? ##### Post Metadata
- Posted at: about 6 years ago - Author title: Operations Associate at FourKites, Inc.
- Net upvotes: 1
# Yes it's has easy accesible and lots of accounting features ? ##### Post Metadata
- Posted at: almost 5 years ago - Author title: Accountant at KN gandhi & co

Start a New Software Discussion

Have a software question?

Get answers from real users and experts

Start A Discussion

Product Avatar Image

Have you used Microsoft Dynamics 365 Business Central before?

Answer a few questions to help the Microsoft Dynamics 365 Business Central community

Top Contributors in Microsoft Dynamics 365 Business Central

1
Charles A.
CA

Charles A.

Senior Managing Consultant

2 pts
2
selma b.
SB

selma b.

PFE

2 pts
3
F. Ozgur T.
FT

F. Ozgur T.

Operations and Projects Senior Manager

1 pt
4
Bryan P.
BP

Bryan P.

Operations Associate

1 pt
5
VENKATESAN J.
VJ

VENKATESAN J.

Senior Solutions Architect

1 pt