Wednesday 19 August 2020

Check whether Role is assigned to User or not.


static boolean isUserInRole(Description  _roleName)

    {

        boolean                 res;

        SecurityUserRole        securityUserRole;

        SecurityRole            securityRole;

        ;

        select RecId from securityUserRole

            where  securityUserRole.User    == curUserId()

            join RecId from securityRole

                where  securityRole.RecId == securityUserRole.SecurityRole

                    && (   securityRole.AotName == _roleName

                    )    ;

        if (securityUserRole.RecId)

        {

            res = true;

        }

    

        return res;

    }


====================================================================


   ListEnumerator              userRolesEnumerator;

 userManagement              = new SysUserManagement();

   userRoles                   = userManagement.getRolesForUser(curUserId());

   userRolesEnumerator       = userRoles.getEnumerator();

Global::IsSystemadministrator()

GLobal::FinancialController()

Saturday 1 August 2020

Data Entities Issues

BYOD export failed with the message 'An error occurred in add data flow component for entity store' because of disabled configuration key.
you have the issue search on the lcs project.Tile on the right site you can search for known issues just by copy pasting the error message.you can search for any errors related to FO to see if there is solution

PROBLEM
If an entity field is derived from an extended data type which has disabled configuration key, the configuration key status is not catched during entity refresh and the entity field is marked as enabled. BYOD uses the field because of enabled status but throws the error because the field is really not available.
DESCRIPTION OF CHANGE
The entity refresh process will validate the configuration key status of extended data type recursively in addition to the entity field and data source configuration key.
If any of the data type in entity is not extended with EDT and exported to BYOD the issue rises. I need to change the field data type set to some EDT. Regenerate Staging Table. Delete the entity in  list. Build it . Then Refresh the  entity List using Parameters section. ( If still issue exists try the same by building the model )