ahlan hamad

Setup guide · Finance & Operations payroll journals · Coming soon

Set up Dynamics 365 Finance & Operations payroll journals: step by step

This guide is for three people working together: your Microsoft 365 admin, who registers the app; your Finance & Operations admin, who sets up the journal name and the user who connects; and the person who runs payroll in AhlanHamad, who connects it and maps the accounts with your accountant. Follow it in order. Every AhlanHamad label below is the one you will see on screen.

Updated 14 October 2026

1. Before you start

Coming soon. Creating payroll journals in Finance & Operations is switched off. You can do the Microsoft side (sections 2 and 3) and connect now: the connection signs in and reads your main accounts. Until we switch journals on for your company, the Field Mapping tab says “Posting payroll journals to Dynamics 365 Finance & Operations isn't switched on for your workspace yet.”

CheckWhat you need
Where it standsBuilt against Microsoft's Finance & Operations OData documentation, and tested only against a simulated Finance & Operations. It hasn't run in a real Finance & Operations environment yet, so start in a sandbox (test) environment and check your first journals closely.
Finance & OperationsDynamics 365 Finance (the finance and operations apps) in the cloud, opened at an address such as https://contoso.operations.dynamics.com. This is not Dynamics 365 Business Central, which has its own page and its own guide.
You post the journalsAhlanHamad creates each payroll journal unposted: Microsoft documents no way for an integration to post a general journal. Someone in your finance team reviews and posts it in Finance & Operations; until then it is not in your ledger.
Currency and decimalsJournals are created in the legal entity's accounting currency. For KWD, BHD or OMR, amounts are sent with three decimals; that hasn't been checked on a real environment yet, so check that the currency rounds to 0.001 there and compare the totals of your first journal.
Microsoft adminsSomeone who can register apps in the Microsoft Entra admin center and an admin who can grant consent (for example a Global Administrator). A Finance & Operations admin who can set up a journal name and assign security roles.
The person who signs inA Finance & Operations user whose security roles can create general journals and read main accounts, ledgers and journal names in the legal entity payroll goes to (section 3). AhlanHamad works with this person's access.
In AhlanHamadA company admin who can manage settings (to connect and save the mapping), and the person who finalizes and pays payroll. Your accountant should help with the mapping.

Only totals are sent to Dynamics 365 Finance & Operations: one line per main account, never a line per employee. Names, IDs and individual salaries stay in AhlanHamad.

2. In Microsoft Entra: register your app

Finance & Operations accepts calls from your own app registered in Microsoft Entra ID, with a person signing in (authorization code) (Microsoft Learn: service endpoints and authentication). Sign in to the Microsoft Entra admin center.

  1. Go to Entra ID → App registrations → New registration. Name: for example AhlanHamad payroll. Supported account types: Single tenant only (your own organisation). Click Register (Microsoft Learn: register an application).
  2. On the app's Overview, copy the Application (client) ID and the Directory (tenant) ID (find your tenant ID).
  3. Add the redirect URI: Manage → Authentication → Add Redirect URI → Web, enter https://ahlanhamad.com/auth/dynamics-365/callback exactly as written (https, no slash at the end) and click Configure (Microsoft Learn: add a redirect URI). Older screens show this as Add a platform → Web. AhlanHamad shows the same address on the Connection tab, with a Copy button.
  4. Certificates & secrets → Client secrets → New client secret: add a description, pick an expiry (at most 24 months) and click Add. Copy the Value straight away: Microsoft never shows it again (Microsoft Learn: add credentials). Note the expiry date: when it passes, journals are held until you reconnect with a new secret.
  5. API permissions → Add a permission → APIs my organization uses and search for the full name Microsoft Dynamics ERP (Microsoft notes it can look unavailable if you search for less). Choose Delegated permissions and tick Access Dynamics AX data and Access Dynamics AX online as organization users. Microsoft's own minimum also lists Access Dynamics AX Custom Service; AhlanHamad doesn't use custom services, so it isn't needed for this connection. Click Add permissions.
  6. Click Grant admin consent for <your organisation> and confirm. The Status must show Granted (Microsoft Learn: grant admin consent).

3. In Finance & Operations: the user who connects, and a journal name

The person who signs in

  1. Choose who will sign in at Microsoft when you connect. AhlanHamad keeps that person's sign-in and creates every journal with their access in Finance & Operations, so they must be a Finance & Operations user (with the same Microsoft work account).
  2. Give them security roles that can create general journals and their lines, and read main accounts, ledgers and journal names, with access to the legal entity payroll goes to. AhlanHamad's Connection tab gives the Accountant role as an example; your partner may prefer a narrower role.
  3. If that person leaves, is disabled or loses the role, the journals are held until someone reconnects. A user kept for this purpose is easier to look after than a person's own account.

A journal name for payroll

  1. In the legal entity payroll goes to, open the Journal names page and click New. In the standard menus it is under General ledger → Journal setup; the screen may be named differently in your version (Microsoft Learn: journal names).
  2. Name: for example PAYROLL. Description: AhlanHamad payroll. Journal type: Daily: AhlanHamad lists only journal names of type Daily.
  3. New voucher: One voucher only or In connection with balance, so each payroll journal is one voucher. Pick your usual Voucher series.
  4. Keep this journal name for AhlanHamad, so payroll journals are easy to find. If it has a workflow approval, payroll journals go through it before they can be posted, like any other journal.

AhlanHamad signs in as a person, so Microsoft's step of adding the app on the Microsoft Entra applications page (System administration → Setup), which links an app to a user for calls made with no one signed in (Microsoft Learn), shouldn't be needed. We haven't been able to confirm this on a real environment: if Finance & Operations refuses the connection, add the app there with the person above as its user, and tell us.

Finally, note your environment URL: the address you open Finance & Operations at, for example https://contoso.operations.dynamics.com, with nothing after the host name. Start with a sandbox environment's address.

4. In AhlanHamad: connect Finance & Operations

  1. Go to Integrations and open Microsoft Dynamics 365. The page is called Microsoft Dynamics 365 F&O. Stay on the Connection tab; the card is called Dynamics 365 Connection.
  2. Check that the address under Redirect URI to register on your app is the one you added in section 2.
  3. Azure AD Tenant ID: the Directory (tenant) ID from section 2. Client ID and Client Secret: your app's values from section 2. D365 Environment URL: the address from section 3, starting with https://.
  4. Click Connect to Dynamics 365. AhlanHamad encrypts and stores the secret on the server, then takes you to Microsoft.
  5. Sign in at Microsoft as the person from section 3. Consent was granted for your organisation in section 2, so Microsoft shouldn't ask for it again.
  6. You come back to a page that says Connected to Microsoft Dynamics 365, then to the page, where the card shows Connected to Microsoft Dynamics 365 F&O with the D365 Environment and the Azure AD Tenant ID.

While it is connected, the card offers only Disconnect Dynamics 365. If you connect again later, the card says “Your app credentials are saved. Click Connect to sign in with them — no need to enter them again.” To use a new secret, click Replace credentials and enter both values. Connecting to a different tenant or environment forgets the saved legal entity, journal name and mapping.

Already sending payroll to another accounting system? If another one is connected and receiving payroll, AhlanHamad asks first: “Connect a second accounting system?” If you connect Dynamics 365 Finance & Operations too, every payroll run is posted to both and your payroll costs are booked twice. If you are moving to Dynamics 365 Finance & Operations, click Cancel, disconnect the other system first, then connect Dynamics 365 Finance & Operations.

5. Pick the legal entity and journal name, and map your accounts

  1. Open the Field Mapping tab. The card is called Post payroll journals to Dynamics 365 Finance & Operations, and it says: “Journals are created unposted in Finance & Operations: Microsoft offers no documented way for an integration to post a general journal, so review and post each one in Finance & Operations (General ledger › Journal entries › General journals). A journal still unposted there is not yet in your ledger.”
  2. Click Load my accounts. If the connection reaches more than one legal entity, Choose the company asks which one payroll journals go to; each is listed by its name and ID, for example Contoso (USMF).
  3. Journal name: under Choose a journal, pick the journal name from section 3. Until one is chosen the card says “Posting is on hold until a journal is chosen.”
  4. Map each Ahlan Hamad account to a Dynamics 365 Finance & Operations account (table below). Some are pre-selected and marked Suggested when the match is clear; check every one with your accountant.
  5. Click Save mapping. Until every required account is mapped the card says “Runs that use an unmapped account are held until it is mapped.”
  6. If you pay any payroll in a currency other than the legal entity's accounting currency, decide on Post runs in other currencies (section 6).

Which main account for each payroll account

CodeAhlan Hamad accountNeededTypical main account type
5100Salaries — basic, other allowances, overtime & additionsRequiredExpense
5400Housing allowanceRequiredExpense
5500Transport allowanceRequiredExpense
5200Employer social-insurance contributionRequiredExpense
5300End-of-service expenseRequiredExpense
2100Net salaries payableRequiredLiability
2200Social insurance payable (employee + employer)RequiredLiability
2300End-of-service provisionRequiredLiability
1101Bank account salaries are paid fromRequiredAsset (your bank's main account), or a clearing liability (see below)
2700Deductions withheld (loans, penalties, unpaid leave)Only if usedLiability
5810Bank transfer charges on salariesOnly if usedExpense
5310DIFC DEWS employer contributionOnly if usedExpense
2310DIFC DEWS payableOnly if usedLiability
5900Foreign-exchange gain/loss on payroll (only if a run in another currency is paid at a different rate)Only if usedYour exchange gain or loss account

End-of-service is not on the payroll journal. It is its own journal each month (5300 End-of-service expense / 2300 End-of-service provision).

6. What gets created, and when

When this happens in AhlanHamadDynamics 365 Finance & Operations receivesDated
A payroll run is finalized (Finalize)Payroll accrual: salaries and allowances, employer social insurance and the payables they create (debits 5100–5500, credits 2100, 2200 and, if used, 2700)The last day of the payroll month
The run is paid (Mark as Paid, or CEO Sign-off & Pay)Salary payment: debit 2100 Net salaries payable, credit 1101The day the run was signed off and paid
Bank transfer charges are recorded on a paid runBank charges: debit 5810, credit 1101The pay day
A month endsEnd-of-service accrual: debit 5300, credit 2300 — sent automatically on the 1st of the next month. You can also run it by hand for a finished month with Run Monthly Accrual on the Finance page.The last day of that month
A run is deleted, or a posted journal is correctedA reversal: a new journal with the same lines, debit and credit swapped, under its own marker. Finance & Operations has no field linking the two, so its Description names the marker and journal batch number of the journal it reverses. It is created unposted, like every other. A corrected run is then created again as a new journal.The day of the change

Each journal's Description starts with our marker (AH followed by 12 letters and digits) and then AhlanHamad's reference: PAY-KW-2026-10 for the October 2026 Kuwait payroll accrual, PAY-KW-2026-10-PMT for its salary payment, PAY-KW-2026-10-FEES for its bank charges, IND-KW-2026-10 for that month's end-of-service accrual (the country code is the run's own). A reversal's Description says “reverses” and the marker it reverses. The Description holds at most 60 characters, so a long one is cut off at the end.

7. Check and post your first payroll in Finance & Operations

  1. In AhlanHamad, open the payroll run. The Dynamics 365 Finance & Operations journals card lists each journal (Payroll accrual, Salary payment, …). Once a journal is in Finance & Operations its status reads Created — post it in F&O, with Journal and its journal batch number, and the note “Created unposted in Finance & Operations. Open the journal there, review it and post it — until then it is not in your ledger.”
  2. In Finance & Operations, in the legal entity payroll goes to, go to General ledger → Journal entries → General journals and find the journal by that journal batch number; its Description starts with the marker (AH…) (Microsoft Learn: create and validate journals).
  3. Select Lines and check: the date (the last day of the payroll month for the accrual), one line per mapped main account, the currency, and debit and credit totals that match the payroll run in AhlanHamad.
  4. Click Validate, then Post. Only now are the payroll amounts in your ledger.
  5. AhlanHamad doesn't see whether you posted it: the run card keeps saying Created — post it in F&O. Don't delete a journal AhlanHamad created; AhlanHamad doesn't notice and won't create it again. If you did, tell us.

Statuses on the run card: Queued and Sending (on its way), Waiting (another journal must reach Dynamics 365 Finance & Operations first), Retrying (Dynamics 365 Finance & Operations or the network was busy; we try again automatically), Created — post it in F&O (it is in Finance & Operations, unposted, for you to post), On hold (needs you; the reason is shown), Failed (Dynamics 365 Finance & Operations refused it; the reason is shown), Not needed (nothing to send; the reason is shown).

8. Troubleshooting

Company admins who can manage settings, and finance managers, also get an in-app notice and an email when Dynamics 365 Finance & Operations journals are held or fail: one per problem, a reminder after three days, and a short note when it clears. No amounts, names or Dynamics 365 Finance & Operations errors are put in the email; open the payroll run to see the reason.

When connecting (Connection tab and the return page)

What you seeWhat to do
Fill in the tenant and environment details above to connect.Fill in Azure AD Tenant ID and D365 Environment URL, then click Connect.
Enter your app's Client ID and Client Secret to connect.Paste both values from your app (section 2), then click Connect.
Enter both the Client ID and the Client Secret to replace the saved credentials.You started replacing the saved credentials: fill in both fields, or click Keep saved credentials.
Environment URL must use https.Enter the environment address starting with https://, for example https://contoso.operations.dynamics.com.
Connecting isn't available yet: this workspace's app address isn't configured. Contact support and we'll set it up.Contact us. Nothing on your side is wrong.
Microsoft shows an error mentioning the redirect URI (for example AADSTS50011)The app's redirect URI doesn't match. Set it to https://ahlanhamad.com/auth/dynamics-365/callback under Authentication → Web (section 2), then connect again.
Couldn't connect Microsoft Dynamics 365 — with “No authorization code was returned. The connection was cancelled or the link is invalid.”You cancelled or declined on Microsoft's screen, or the link was opened twice. Start again from the Connection tab.
You were signed out before the connection finished. Sign in again, then reconnect from the integration settings.Sign in to AhlanHamad, then click Connect again. Use the same browser for the whole flow.
This connection link is invalid, expired or already used. Start the connection again from the integration's settings page.Each connect link works once and for a short time. Click Connect again on the Connection tab.
Token exchange failed: …Microsoft Entra refused to hand over the connection. Usually the Client Secret is wrong or expired, the redirect URI doesn't match exactly, the Microsoft Dynamics ERP permissions or admin consent are missing (section 2), or the environment URL isn't your Finance & Operations address. Read Microsoft's message after ours, fix it, then connect again.
Waiting for Azure AD OAuth to complete...The Microsoft sign-in wasn't finished. Click Connect to Dynamics 365 again.
Dynamics 365 Finance & Operations no longer accepts this connection (refresh …). Reconnect Dynamics 365 Finance & Operations.Microsoft Entra stopped accepting the saved sign-in (see “The connection needs to be renewed” below). Click Connect to Dynamics 365 and sign in again; with a new secret, click Replace credentials first.

When loading your accounts (Field Mapping tab)

What you seeWhat to do
Could not list your Dynamics 365 Finance & Operations companies (…). …Finance & Operations didn't list the legal entities for the person who connected. Check the environment URL and that person's access, then click Load my accounts again. If the number in brackets is 404, tell us: the names of the lists AhlanHamad reads haven't been checked on a real environment yet.
Could not read the Dynamics 365 Finance & Operations company (…). …Read the rest of the message. With “has no ledger for legal entity”, the legal entity has no ledger set up; with 401 or 403 it says “check the environment and reconnect”: check the person's roles in that legal entity, reconnect, then Reload accounts.
Dynamics 365 Finance & Operations did not report the accounting currency of legal entity …. Set it on the Ledger page, then load your accounts again.In Finance & Operations, set the Accounting currency on the Ledger page of that legal entity, then click Reload accounts.
Could not read the Dynamics 365 Finance & Operations journals (…).The person who connected can't read journal names, or (with 404) the journal-names list has a different name in your environment. Check the roles, then Reload accounts; if it stays, tell us.
Your journal name is not in the Journal name listOnly journal names of type Daily in the chosen legal entity are listed. Check its Journal type, then click Reload accounts.

On the payroll run: On hold

A held journal is waiting, not lost. Fix the reason and it goes, either by itself or when you press Retry on the run card.

What you seeWhat to do
Map these accounts first: 5400, 5500.Map the listed account codes on the Field Mapping tab and click Save mapping, then Retry.
Load your accounts and save the mapping on the integration page first.On the Field Mapping tab, click Load my accounts, choose the legal entity and the Journal name, save the mapping, then Retry. This also shows when the connection now reaches a different tenant or environment than the saved setup.
… mapped to an account that can't be used in a journal (Accounts Payable or Receivable, a system or bank account, or an account with no code). Pick another account on the integration page.In Finance & Operations terms: a main account with Do not allow manual entry set, a Total or Reporting account, or a suspended account. Map those codes to an account that takes journal lines, save, then Retry.
This run's currency differs from your books. Allow other-currency posting to send it.Switch on Post runs in other currencies on the Field Mapping tab, then Retry. Or keep that run out of Dynamics 365 Finance & Operations.
The connection needs to be renewed. Reconnect and try again.Microsoft Entra stopped accepting the saved sign-in: usually the client secret expired, the person who connected left or lost access, or consent was removed. On the Connection tab, click Connect to Dynamics 365 and sign in again (with a new secret, click Replace credentials first). Journals held for this reason are sent automatically once you reconnect.
Not connected, or posting is switched off.Connect Dynamics 365 Finance & Operations again on the Connection tab. Held journals are sent automatically once you reconnect. If Dynamics 365 Finance & Operations is connected and you still see this, ask us: posting may have been switched off for your company.

On the payroll run: Failed

These come back from Dynamics 365 Finance & Operations, in English, with Dynamics 365 Finance & Operations's own words added after ours. Fix the cause in Dynamics 365 Finance & Operations or in the mapping, then press Retry. A retry never creates a second journal.

What you seeWhat to do
Dynamics 365 Finance & Operations rejected the journal (400). followed by Dynamics 365 Finance & Operations's own messageRead Finance & Operations' message after ours (it starts with its error code in brackets). Common causes: the date is in a closed or on-hold ledger period, an account has Do not allow manual entry set, or the account structure needs a financial dimension. Fix it, then Retry.
Dynamics 365 Finance & Operations refused access (403). The connection may lack permission to post journals, or the organisation was disconnected — reconnect Dynamics 365 Finance & Operations.AhlanHamad works with the access of the person who connected. Check their security roles can create general journals in that legal entity (section 3), then Retry. If someone else should connect, they reconnect on the Connection tab.
Dynamics 365 Finance & Operations could not find the company or an account this journal points at (404). Check the account mapping belongs to the connected company.A mapped account was deleted or archived in Dynamics 365 Finance & Operations. Click Reload accounts, fix the mapping, save, then Retry.
This run's payroll accrual journal did not reach Dynamics 365 Finance & Operations. Retry the accrual first, then retry this payment, so it clears exactly the salaries payable the accrual booked.Retry the Payroll accrual line first, then the Salary payment line.
No exchange rate from … to … is available.Try again later, or contact us.
… — gave up after 6 attempts.Dynamics 365 Finance & Operations or the network kept failing. Check Dynamics 365 Finance & Operations opens normally, then press Retry.
Dynamics 365 Finance & Operations refused the journal (409).If it goes on “Journal … was started by Ahlan Hamad but posted before it was complete. Check it in Finance & Operations; nothing more is added to it.”, a journal still marked PENDING was posted: check it in General journals and tell us. Otherwise Retry.

On the payroll run: Not needed

What you seeWhat it means
Reversed in Ahlan Hamad before it reached Dynamics 365 Finance & Operations; the pair nets to zero.Nothing to do: the journal and its reversal cancel out, so neither is sent to Dynamics 365 Finance & Operations.
Reverses an entry that never reached Dynamics 365 Finance & Operations, so there is nothing to reverse there.Nothing to do.

Two accounting systems

If the Dynamics 365 Finance & Operations page or the payroll run says “Payroll is being posted to …” with more than one system, every run is booked in each of them. If you keep your books only in Dynamics 365 Finance & Operations, disconnect the others so payroll costs aren't counted twice.

9. Disconnecting

  1. In AhlanHamad, go to Integrations → Microsoft Dynamics 365 → Connection and click Disconnect Dynamics 365. AhlanHamad deletes the stored Client ID, Client Secret and sign-in tokens; to connect again you enter the Client ID and Client Secret again.
  2. AhlanHamad cannot withdraw anything at Microsoft for you: Microsoft Entra offers an app no way to revoke just its own sign-in (Microsoft Learn: refresh tokens). If you won't use the app again, delete its client secret or the app registration in the Microsoft Entra admin center.

Microsoft sources used in this guide

About AhlanHamad × Dynamics 365 Finance & Operations· All integrations