Newbie here. I've spent the whole week slogging through setting up registration in a tenancy app and I'm almost there, but I have one last hurdle that I can't seem to get over that relates to auto-logging the user in after they register. Here's the process I created that runs in one step, but I broke out for explanatory purposes:
(1) Have the user come in at the guest access level and use a non-persisted BO with it's own form/rules to collect registration information. Initialize a URL attribute from domain, username and password.
ENTER NEW Registration USING Main
Registration.URL='localhost:8080/logonOp.aw?domain=Plantain&username='+Registration.Username+'&password='+Registration.Pass
(2) With the information from the registration form, create several BO instances needed for the registration.
CREATE Person WITH Person.Name=Registration.Name,Person.EmailAddress=Registration.Email,Person.LoginName=Registration.Username,Person.Password=Registration.Pass,Person.Architecture='Responsible (Full)',Person.AccessLevel='Admin',Person.AssignedSubscription='Yes'
CREATE Account WITH Account.Name=Registration.OrganizationName,Account.Complexity=Registration.Complexity,Account.MainPhone=Registration.MainPhone,Account.ps_PrimaryContact=Person,Account.NumberOfSubscriptions=5,Account.NumberOfAssignees=1
Person.ob_Account=Account
CREATE Subscription WITH Subscription.NumberOfSubscriptions=5,Subscription.ob_Account=Account,Subscription.Rate=0,Subscription.Renew='Annual',Subscription.TotalCost=0
CREATE Entity WITH Entity.Name=Account.Name,Entity.ob_Account=Account
CREATE Enterprise WITH Enterprise.ob_Account=Account,Enterprise.Name='Default'
CREATE EnterpriseEntity WITH EnterpriseEntity.ob_Enterprise=Enterprise,EnterpriseEntity.ob_Entity=Entity
Person.ps_Entity=Entity
Works as intended.
(3) Login the user with the URL generated in (1).
DISPLAY URL Registration.URL IN CURRENT TAB
This doesn't do anything. I'm still in the guest VP and no error is triggered. Any ideas?
BTW, in order to go in as guest, I can't do it under test. The URL parameter "testingMode=true" doesn't work and takes me straight to production, so I added the process to the admin access level and also test in production.
Also FYI, I learned that adding a non-persisted BO to the SystemUser group is a bad idea. 😃
Cheers,
Jon