Thanks

I have struggled in vain I think...

I need it for Ax3.0 SP5 but it seems there is no runas command in Ax3.0 (it
says 'this function has not been declared' when I try to use it and I cannot
find it in the system developer documentation)

Can anyone confirm this is the case or provide any other command that might
work?

Thanks
James


-----Original Message-----
From: Axapta-Knowledge-Village@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Sumit Loya
Sent: 14 June 2007 02:06
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: Re: [Axapta-Knowledge-Village] Record Level Security

Hi James,

For runas i have this sample code

runas(outboundProcessingQueue.SubmittingUserId,
                        classnum(AifOutboundProcessingService),
                        staticmethodstr(AifOutboundProcessingService,
processAsUser),
                        [outboundProcessingQueue],
outboundProcessingQueue.Company);

This code has been taken from class "AifOutboundProcessingService" method
run. Hope this is useful try using this code for your purpose. Meanwhile
even i will try using it and see how it works.

One more for that SysSecurityFormSetup try changing the code like this and
see it will bypass the security setup for salesTable form here is the change
you can do

In the loadSecurity method of SysSecurityFormSetup change the if condition
in the following way

*Orignal if condition*

if (_formRun)

*Modified if condition*

if (_formRun && _formRun.name() != formstr(SalesTable))

Hope these may be useful
Regards,
Sumit

On 6/14/07, James Flavell <[EMAIL PROTECTED]> wrote:
>
>   Hi Sumit,
>
> I tried to use the SysSetupFormRun class but I am not that technical and
> so
> do not know how to get the table object in scope so I can do
> salestable.recordlevelsecurity(false) ...I don't know even if this is
> possible
>
> I tried within SysSetupFormRun to use this.args() but I really I am
> guessing
> how to work it back to know the form and then also to get the table. Even
> then I am not sure it is going to work.
>
> One more idea I have is to try using the RunAs command (i.e. switch to
> another user in order to open the form...this user would have different
> RLS
> setup). Can anyone give me an example of how to call up the salestable or
> any form using the RunAs command (I get the feeling RunAs is supposed to
> be
> just for running chunks of code so I don't know if it will work with
> trying
> to open a form but I am desperate at the moment so willing to try
> anything...)
>
> Thanks for all the help
> James
>
> -----Original Message-----
> From:
Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40yahoogro
ups.com>
>
[mailto:Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40
yahoogroups.com>]
> On Behalf Of Sumit Loya
> Sent: 13 June 2007 09:24
> To:
Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40yahoogro
ups.com>
> Subject: Re: [Axapta-Knowledge-Village] Record Level Security
>
> Hi James,
>
> I found out one more interesting thing :). When a form is opened it will
> call the method init of class SysSetupFormRun. This method init then
> internally calls SysSecurityFormSetup::loadSecurity(this);
>
> That is loadSecurity method of SysSecurityFormSetup class. Try changing
> code
> there. Check if the formRun is for salesTable and bypass the RLS setup or
> something. You can investigate more on this.
>
> Do let me know the developments.
>
> Regards,
> Sumit
>
> On 6/13/07, James Flavell <[EMAIL PROTECTED] <djf%40columbusindo.com>>
> wrote:
> >
> > Thanks
> >
> > I try this yesterday but it wont work as the init is after the kernel
> has
> > already applied the RLS from what my test show...
> >
> > I am about to try out RunAs command on a form...no idea if it will work
> >
> > I know there was a company in AX 2.5 who made a module Record Level
> > Permissions which I am sure was pretty much what I need. I know MS
> > basically bought up the module and turned it into RLS but does anyone
> have
> > any samples or ideas where I might be able to see how they did this RLP
> as
> > I
> > am running out of ideas...?
> >
> > Thanks
> > James
> >
> > -----Original Message-----
> > From:
>
Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40yahoogro
ups.com>
> <Axapta-Knowledge-Village%40yahoogro
> ups.com>
> >
>
[mailto:Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40
yahoogroups.com>
> <Axapta-Knowledge-Village%40
> yahoogroups.com>]
> > On Behalf Of Sumit Loya
> > Sent: 13 June 2007 00:31
> > To:
>
Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40yahoogro
ups.com>
> <Axapta-Knowledge-Village%40yahoogro
> ups.com>
> > Subject: Re: [Axapta-Knowledge-Village] Record Level Security
> >
> > Hi James,
> >
> > You can try out the following piece of code
> >
> > SalesTable.recordLevelSecurity(false);
> >
> > I hope this is what you were looking for. Try writing this code in form
> > init
> > or some place like that.
> >
> > Regards,
> > Sumit
> >
> > On 6/12/07, James Flavell <[EMAIL PROTECTED]
<djf%40columbusindo.com><djf%40columbusindo.com>>
> > wrote:
> > >
> > > Hi everyone I have a rather urgent query.
> > >
> > > Is there anyway I can turn off the record level security for a single
> > > form?
> > >
> > > My problem is the user is only able to edit certain sales orders but
> > they
> > > should be able to see all sales orders (to know the current status and
> > > plan
> > > accordingly)
> > >
> > > So I was thinking I could just make a copy of the sales order form
> just
> > > for
> > > viewing and in the code turn off record level security so it would
> show
> > > all
> > > records. The normal sales order screen could then have record level
> > > security and allow for editing.
> > >
> > > Is this possible? It thought I remember someone post how to turn off
> > > security but I am not sure if it was permissions or record level
> > > security..
> > >
> > > Thanks a million
> > >
> > > James
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> >
> > [Non-text portions of this message have been removed]
> >
> > Sharing the knowledge on Axapta.
> > Visit www.frappr.com/axapta for axapta friends.
> >
> > Come and choose your preferred name for Microsoft Dynamics AX on the
> > Axapta
> > Knowledge Village, Visit www.axapta-knowledge-village.tk
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
> Sharing the knowledge on Axapta.
> Visit www.frappr.com/axapta for axapta friends.
>
> Come and choose your preferred name for Microsoft Dynamics AX on the
> Axapta
> Knowledge Village, Visit www.axapta-knowledge-village.tk
>
> Yahoo! Groups Links
>
>  
>


[Non-text portions of this message have been removed]



Sharing the knowledge on Axapta.
Visit www.frappr.com/axapta for axapta friends.

Come and choose your preferred name for Microsoft Dynamics AX on the Axapta
Knowledge Village, Visit www.axapta-knowledge-village.tk

 
Yahoo! Groups Links




Reply via email to