static void AXCopyUsergroupRLSBytable(Args _args)
{
SysRecordLevelSecurity SysRecordLevelSecurity,insertRLS;
dialogfield srcdf,destdf;
dialog dialog;
userGroupid src,dest;
;
dialog = new dialog("copying user group's Record Level security ");
srcdf = dialog.addField(typeid(userGroupid),"Source");
destdf = dialog.addField(typeid(userGroupid),"Destination");
if(dialog.run())
{
src = srcdf.value();
dest = destdf.value();
if(src!="" && dest !="")
{
ttsbegin;
info("Copying RLS to destination user group");
select * from SysRecordLevelSecurity
where SysRecordLevelSecurity.groupId == src
&& SysRecordLevelSecurity.tabId == 40017;//PAYFGOSIItemCodeInfo table id
{
insertRLS.data(SysRecordLevelSecurity);
insertRLS.groupId = dest;
insertRLS.insert();
}
ttscommit;
info("User groups RLS has been copied!");
}
}
else
{
info("Canceled by user");
}
}
{
SysRecordLevelSecurity SysRecordLevelSecurity,insertRLS;
dialogfield srcdf,destdf;
dialog dialog;
userGroupid src,dest;
;
dialog = new dialog("copying user group's Record Level security ");
srcdf = dialog.addField(typeid(userGroupid),"Source");
destdf = dialog.addField(typeid(userGroupid),"Destination");
if(dialog.run())
{
src = srcdf.value();
dest = destdf.value();
if(src!="" && dest !="")
{
ttsbegin;
info("Copying RLS to destination user group");
select * from SysRecordLevelSecurity
where SysRecordLevelSecurity.groupId == src
&& SysRecordLevelSecurity.tabId == 40017;//PAYFGOSIItemCodeInfo table id
{
insertRLS.data(SysRecordLevelSecurity);
insertRLS.groupId = dest;
insertRLS.insert();
}
ttscommit;
info("User groups RLS has been copied!");
}
}
else
{
info("Canceled by user");
}
}
This comment has been removed by a blog administrator.
ReplyDelete