Question Status

Verified
KBanh asked a question on 24 May 2013 8:54 AM

I'm wondering if it's possible for a form to be shown upon login by a user with specific attributes (e.g., role, name pattern, etc)? These users have very narrow responsibilities so we'd like to reduce their need to click through the system when their primary responsibility revolves around a single form. Thanks in advance!!!

Reply
Verified Answer
John Castro responded on 24 May 2013 9:07 AM

Kbanh,

I don't know of any out of the box solution for having a startup form. However, we do have a customization that does this that you could try.

You can create a class to manage what user & forms are started. You can then call this class from

Classes\Info\startupPost().

Place your code in the startupPost() method and it should execute when users login. We have this solution in place for users in a warehouse.

Hope that helps,

-John

Reply
Suggested Answer
Joris de Gruyter responded on 24 May 2013 9:32 AM

Optionally you can change the user's windows shortcut for AX to pass a command line parameter to open a form. I need to double-check what the exact syntax is, unless someone here immediately can tell you.

Reply
KBanh responded on 24 May 2013 10:01 AM

Joris, we're not using the rich client but are instead using a terminal services solution. Any suggestions there? Thanks!

Reply
Suggested Answer
Joris de Gruyter responded on 24 May 2013 10:29 AM

Terminal services still uses the rich client. If you're publishing the app as a remoteapp or through Citrix, it should still be possible to pass command line parameters to the AX rich client.

Reply
KBanh responded on 24 May 2013 11:26 AM

Do you happen to know the command line syntax? Thanks!

Reply
Verified Answer
Joris de Gruyter responded on 24 May 2013 1:40 PM

for example, to open the customer list page, you specify the AOT path to the form:

ax32 "-startupcmd=startupelementaction_\Menu&Items\Display\CustTableListPage"

Reply
KBanh responded on 28 May 2013 2:59 PM

JorisdG, I ran into an access issue using the "-startupcmd". The error said that the user under which I'm running this command did not have sufficient rights for startupelementaction. Any idea what permissions are required to allow this to work? Thanks very much!

Reply
Suggested Answer
Daniel Weichsel responded on 28 May 2013 3:18 PM

The default security only allows users with development access to use this startup command (see Classes\SysStartupCmd\canRun).  A developer could override this method on the SysStartupCommandStartupElementAction class to perform a different security check (perhaps by using the hasMenuItemSecurityAccess global method).

Reply
Suggested Answer
Joris de Gruyter responded on 28 May 2013 3:30 PM

You beat me to it Dan :-)

I'm pretty sure the security of the menu item will be checked anyway, so i think it's pretty safe to override the canrun method.

Reply
KBanh responded on 28 May 2013 3:39 PM

Thanks for the response guys. I'm not sure I will be comfortable with so little time under my belt with AX. Are there other options I have (e.g., privilege(s))? Thanks!

Reply
Joris de Gruyter responded on 28 May 2013 4:06 PM

Unfortunately no, this is tied to the overall developer role. I'm sorry I guess my answer didn't work out :-(

Reply
KBanh responded on 29 May 2013 11:13 AM

Thanks JorisdG! I went into our sandbox environment and modified the canRun code a bit to only run the !isRunningMode() portion of the code but I was still getting the same insufficient access errors. Guess there's deeper security checks, which makes sense. Going to have to find another option.

Reply
Verified Answer
John Castro responded on 24 May 2013 9:07 AM

Kbanh,

I don't know of any out of the box solution for having a startup form. However, we do have a customization that does this that you could try.

You can create a class to manage what user & forms are started. You can then call this class from

Classes\Info\startupPost().

Place your code in the startupPost() method and it should execute when users login. We have this solution in place for users in a warehouse.

Hope that helps,

-John

Reply
Verified Answer
Joris de Gruyter responded on 24 May 2013 1:40 PM

for example, to open the customer list page, you specify the AOT path to the form:

ax32 "-startupcmd=startupelementaction_\Menu&Items\Display\CustTableListPage"

Reply
Suggested Answer
Joris de Gruyter responded on 24 May 2013 9:32 AM

Optionally you can change the user's windows shortcut for AX to pass a command line parameter to open a form. I need to double-check what the exact syntax is, unless someone here immediately can tell you.

Reply
Suggested Answer
Joris de Gruyter responded on 24 May 2013 10:29 AM

Terminal services still uses the rich client. If you're publishing the app as a remoteapp or through Citrix, it should still be possible to pass command line parameters to the AX rich client.

Reply
Suggested Answer
Daniel Weichsel responded on 28 May 2013 3:18 PM

The default security only allows users with development access to use this startup command (see Classes\SysStartupCmd\canRun).  A developer could override this method on the SysStartupCommandStartupElementAction class to perform a different security check (perhaps by using the hasMenuItemSecurityAccess global method).

Reply
Suggested Answer
Joris de Gruyter responded on 28 May 2013 3:30 PM

You beat me to it Dan :-)

I'm pretty sure the security of the menu item will be checked anyway, so i think it's pretty safe to override the canrun method.

Reply