D365 Business Central : Get Client Type in AL

If you want to know, if a user accessing BC from a device, desktop, or API, you can use the Client Type.

Let’s say for an example, you want to limit user modifying from from tablet or phone, you can use CurrentClientType method.

field(12; "Item No."; Code[50])
{
    Caption = 'Item No.';
    DataClassification = CustomerContent;
    trigger OnValidate()
    begin
      if CurrentClientType IN [ClientType::Phone, ClientType::Tablet] then
      Error('Modification is not allowed using phone or table.');
    end;
}

thatnavguy

Experienced NZ-based NAV Developer and Consultant with 15+ years of experience leading multiple IT projects, performing business analyst, developing, implementing, and upgrading Dynamics NAV and Business Central. Passionate to deliver solution that focuses on user-friendly interface while keeping high standard of compliance with the needs.

You may also like...

1 Response

  1. 2 September 2021

    […] Get Client Type in AL […]

Leave a Reply

Your email address will not be published. Required fields are marked *