PS 2007 - Getting resource information while programming the resource "Creating" event handler RRS feed

  • Question

  • Hi,

    I'm currently writing code for doing some action when a PS resource is being created. I use the "Creating" method from the PS 2007 Event Handler section.
    When a new user is being created (let's say John Smith with windows account A123456), I need to do some tests before giving validation.

    The question is : how can I get the new user's entered windows account (A123456) ?

    I can get his name with property "e.ResourceInformation.Resources[0].RES_NAME"
    (e is the ResourceCreatePreEventArgs parameter)

    But property "e.ResourceInformation.Resources[0].WRES_ACCOUNT" is always empty, although field "user account" was filled in the user creation form... !

    Can anyone help me to get this information ?

    Thanks is advance


    • Edited by batz09 Monday, October 10, 2011 1:44 PM
    Monday, October 10, 2011 1:12 PM

All replies

  • Please, can anyone help on this topic ?

    To be clear, my code is following :


    public class CreatingEventHandler : ResourceEventReceiver
            public override void OnCreating(PSContextInfocontextInfo, esourceCreatePreEventArgs e)

             base.OnCreating(contextInfo, e);

                    //Getting resource information
                    ResourceDataSetcrResDs = e.ResourceInformation;

                    //Getting entred resource name for some additional check
                    stringcrResName = e.ResourceInformation.Resources[0].RES_NAME;
                    //RES_NAME property is fine, I get the resource name that was entered in the resource 
    creation form

                    //Getting entred resource account for some additional check
                    stringcrResAccount = e.ResourceInformation.Resources[0].WRES_ACCOUNT;
                    //but WRES_ACCOUNT property returns always NULL !

    So how can I get the resource windows account information, that was entered in the resource creation form ?

    • Edited by batz09 Tuesday, October 11, 2011 12:35 PM
    Tuesday, October 11, 2011 12:27 PM
  • Does really nobody have any idea ?

    Wednesday, October 12, 2011 12:23 PM
  • Last attempt...
    Wednesday, October 19, 2011 1:06 PM