MS CRM 4.0 – Check User Role for CRM Grid Actions in ISV Config

יום שני, מאי 23, 2011

Some times you need allow to run or show specific form CRM Grid only for user that has specific security role, you can't call to CRM WS inside . For this purpose you can create new javascript file for example ISVConfig.js, that is stored inside /ISV/Scripts/. After this create new button inside ISV Config XML in GRID section for specific entity,  in this button you need to load javascript file dynamic. <Grid>            <MenuBar>              <Buttons>                <Button Icon="/_imgs/ico_18_debug.gif" JavaScript="                       try                       {                          DoActionWithCheckUserRole();                       }                       catch (e)                       {                          var oScript = document.createElement('script');                          oScript.type = 'text/javascript';                          oScript.src = '/ISV/Scripts/ISVConfig.js';                          document.body.insertBefore(oScript);                          try                          {                             DoActionWithCheckUserRole();                          }                          catch (e)                          {                             setTimeout('DoActionWithCheckUserRole();', 1000);                         ...
אין תגובות