SignUpURL

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Maghiyose
Posts: 3
Joined: Tue Apr 04, 2017 8:06 am
Location: South Africa
Contact:

SignUpURL

Post by Maghiyose »

Hello, everyone,

Admin if i'm not following the rules please take it down. I'm not sure if my post on the correct category

I don’t usually post, but I’m stuck and could use some guidance. My situation has never been so dire that I really need help.

I’m working on an app that includes a Member object, which has a self-referencing attribute called ReferredBy that links to another Member. Essentially, this setup allows one Member (A) to refer another Member (B).

The challenge I’m facing is creating a guest signup URL that includes the ReferredBy field, so that new members signing up through the link will be assigned their referrer automatically.

Based on the documentation, I know how to create a basic Member object, but I’m uncertain how to structure the URL to include the ReferredBy reference.

Here’s what I have so far:

Code: Select all

http://localhost:8080/AwareIM/logonGuest.aw?domain=CRM&firstCommand=newObject,Member&testingMode=true
hpl123
Posts: 2641
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: SignUpURL

Post by hpl123 »

Here is one way of doing it, use a process using the startProcessWithInit instead:

Code: Select all

http://localhost:8080/AwareIM/logonGuest.aw?domain=CRM&firstCommand=startProcessWithInit,Process,main,BO&Attribute=Value&testingMode=true
NB: I took this from one of my apps and I use it when the user is logged in (I don´t think it makes a difference but might i.e if you are using the new user registration functionality, that isn´t the same thing as using in when logged in). Another thing, you may have to play around a bit with this. The startProcess functions works a bit differently depending on version e.g the separator between attribute and attribute name can be different and possibly also other things.

Here is the function documentation: https://www.awareim.com/dokuwiki/doku.p ... operations
Henrik (V8 Developer Ed. - Windows)
BobK
Posts: 559
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: SignUpURL

Post by BobK »

Henrik, you beat me to it, but here is a little more information

As Henrik mentioned, for your firstCommand, replace newObject with startProcessWithInit.
startProcessWithInit Creates an object with the specified initialization values and start a process that uses the created object as input.

Here is what your new URL might look like:
localhost:8080/AwareIM/logonGuest.aw?domain=CRM&testingMode=true&firstCommand=startProcessWithInit,YOURPROCESS,main,Member&ReferredID=?

Basically, when accessing this URL, the system will Create a Member with the attribute ReferredID populated with the ID of the Member (A) who referred Member (B) and start process 'YOURPROCESS' with the created Member as input.
ReferredID is an attribute I made up to hold the Member.ID of the referring Member. I am assuming the Member.ID of the referring Member will be known when creating the URL.
The process 'YOURPROCESS' would contain the following rules:
FIND Member WHERE Member.ID = ThisMember.ReferredID // find the referring Member record
ThisMember.ReferredBY = ThatMember // put the found Member in the ReferredBy reference field
EDIT ThisMember // allow the new Member to fill out the signup fields

Disclaimer: I have not tested any provided code and do not guarantee their correctness.
Bob
Maghiyose
Posts: 3
Joined: Tue Apr 04, 2017 8:06 am
Location: South Africa
Contact:

Re: SignUpURL

Post by Maghiyose »

@Henrik & Bob

I appreciate your help, guys. I didn't realize you could also initiate the process. I've managed to get it right. Your assistance is greatly appreciated.

It's working now :D
Post Reply