Pages

Thursday, October 28, 2010

Parsing a custom parameter from a user control to a data set used on another user control

The scenario is that one user control redirects to a page with another user control, and you need to pass a custom parameter for consumption by the dataset of the user control you redirect to.

See the following Word document for at proposed solution:

Using X++ to figure out which user the AOS runs under

This code will give you the AOS accounts domain and username:

public static void main(Args args)
{
    InteropPermission   permission;
    str                 userName;
    str                 userDomain;
    ;
    permission = new InteropPermission(InteropKind::ClrInterop);
    permission.assert();
    userDomain  = System.Environment::get_UserDomainName();
    userName    = System.Environment::get_UserName();
    info(strFmt(@"%1\%2", userDomain, userName));
}

The code must be executed from the server tier.