最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

D365分公司更改颜色 / D365 Color Change by Company

网络文摘 William 211浏览 0评论
This is for D365 F&O or whatever MS is calling it this year. It's a pretty traditional request to set the background color of D365 depending on what company (ie legal entity) the user is in.  In D365, the "theme" is a good way to do that.  Normally the theme is set by user in the Settings, User options.  The theme controls the color of the top bar (image below) as well as the color of the accent color throughout D365.
In order to set the users's theme a) when they log on initially and b) whenever they change companies, you need to subscribe to the Info onPostStartup delegate. To do this, create a new class (naming doesn't matter) and include the code below (just change XYZ to your company).  This is a simplified example, showing the minimum to make this work.  You may not want to hard-code company codes.  And, in case it's not clear, this kind of code would make the theme selection by user, in Settings, User options completely ineffective.  Have fun!     [SubscribesTo(classStr(Info), delegateStr(Info, onPostStartup))]     public static void Info_onPostStartup(str startUpCommand)     {         if (curExt() == 'XYZ')         {             appl.setTheme(SysUserInfoTheme::Theme1);         }         else         {             //all others             appl.setTheme(SysUserInfoTheme::Theme3);         }     }
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址