Client wants to use a different role centre / profile (i.e. a heavilly simplified) etc when connecting via phone ( mostly to do approvals ), but have a full profile via the web client. This didnt sound like it would be hard to do... but I am struggling.
Code like the below works on a normal action... but I want it to happen automatically when they open the phone client.
If I subscribe to any of the events in System Initialization or Company triggers - Business Central just "hangs".
I thought perhaps it was a loop - but I dont hit this in the debugger more than once... if I try it in the web, it just gets stuck on "Getting ready".
Appreciate any thoughts or if there is a different / better way ?
local procedure OnCompanyOpenCompleted()
var
ClientTypeManagement: Codeunit "Client Type Management";
ClientType: ClientType;
SessionSettings: SessionSettings;
begin
ClientType := ClientTypeManagement.GetCurrentClientType();
if ClientType = ClientType::Phone then begin
SessionSettings.Init();
if SessionSettings.ProfileId <> 'SALES' then begin
SessionSettings.ProfileId := 'SALES';
SessionSettings.RequestSessionUpdate(false);
end;
end;
end;
0
Answers
Example:
https://businesscentral.dynamics.com/Production/phone?profile=ACCOUNTANT
This link forces BC to open the Phone client (even if running from a desktop browser), and it also starts with the ACCOUNTANT profile.
This way, you could have multiple links to different clients/profiles, and users can add as a link to their home screen, or they can save in notes somewhere.
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com