UpdateLoginWithPromoCode funkiness

Former Member
Former Member $organization

I noticed something odd with UpdateLoginWithPromoCode.  Sometimes you have to run it twice to update a username.  It also allows some uses contrary to the Nov. 2014 documentation.  We're on v12.1.2.  Here's some code to illustrate the weirdness:

static void Main(string[] args)
{
    var client = new TessituraSoapClient("TessituraSoap12");
 
    // Create unique usernames and password
 
    var appended = DateTime.Now.ToString("yyMMddHHmmss");
    var usernameA = "dummyA" + appended;
    var usernameB = "dummyB" + appended;
    var emailAddress = string.Format("dummy{0}@foo.bar", appended);
 
    // Register with username A
 
    var sessionKey = client.GetNewSessionKeyEx(
        sIP: string.Empty,
        iBusinessUnit: 1);
    var registerResult = client.RegisterWithPromoCodeEx(
        sSessionKey: sessionKey,
        sUID: usernameA,
        sPwd: "foobar",
        iLoginType: 1,
        sEmail: emailAddress,
        sFName: "Antwan",
        sLName: "Patton",
        iPromoCode: 0,
        bAlreadyAuthenticated: false);
 
    // Update login, changing username from A to B
 
    var updateResult = client.UpdateLoginWithPromoCode(
        sSessionKey: sessionKey,
        sUID: usernameA,
        sNewUID: usernameB,
        sPwd: string.Empty,
        sNewPwd: string.Empty,
        sEmail: string.Empty,
        sNewEmail: emailAddress,
        iLoginType: 1,
        iPromotionCode: 0);
    Console.WriteLine(updateResult);
 
    // Update login, changing username back from B to A
 
    for (var i = 0; i < 2; i++) // must try twice
    {
        updateResult = client.UpdateLoginWithPromoCode(
            sSessionKey: sessionKey,
            sUID: usernameB,
            sNewUID: usernameA,
            sPwd: string.Empty,
            sNewPwd: string.Empty,
            sEmail: string.Empty,
            sNewEmail: emailAddress,
            iLoginType: 1,
            iPromotionCode: 0);
        Console.WriteLine(updateResult);
    }
    Console.ReadKey();
}

This code unexpectedly outputs the following:

true
false
true

While I would expect it to output:

true
true
false

The second attempt to update the username fails first and must be called identically a second time.

Also, the documentation for this method indicates that parameters sPwd, sNewPwd, and sEmail are required. However, the method succeeds when passing empty values, which is atypical of required parameters. I'm uncertain what the result of passing certain combinations of these parameters would be.