User already exists

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

User already exists

Post by weblike »

Hi,

does anyone know if it could be implemented a function like in gmail for example?
When a new user is added in the form, interactively an alert message appears that the "user already exists".

Image
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: User already exists

Post by BenHayat »

This would require to be able to attach a rule to an attribute, so when attribute is changed, it would trigger the rule where the it can check the uniqueness.

Ability to attach rules to attribute can help in many areas too.
Powerm
Posts: 473
Joined: Mon Feb 01, 2010 9:44 pm
Contact:

Re: User already exists

Post by Powerm »

You can find that rule on the CRM app too, something like :

If Customer IS NEW AND EXISTS Customer WHERE (Customer.EMail=ThisCustomer.Email AND Customer.ID<>ThisCustomer.ID) Then
REPORT ERROR ' USER ALREADY EXISTS :) '
Independent Developer
www.atwing.com
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: User already exists

Post by BenHayat »

Powerm wrote:You can find that rule on the CRM app too, something like :

If Customer IS NEW AND EXISTS Customer WHERE (Customer.EMail=ThisCustomer.Email AND Customer.ID<>ThisCustomer.ID) Then
REPORT ERROR ' USER ALREADY EXISTS :) '
What he is asking is an AJAX validation as soon as he enters the name BEFORE submitting the whole object.
Powerm
Posts: 473
Joined: Mon Feb 01, 2010 9:44 pm
Contact:

Re: User already exists

Post by Powerm »

As far I know you will have to develop a script for that....
Independent Developer
www.atwing.com
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: User already exists

Post by weblike »

BenHayat wrote:
What he is asking is an AJAX validation as soon as he enters the name BEFORE submitting the whole object.
Yes this what I meant.
REPORT ERROR is ok if you want to check the form on the end of editing, but if you have a huge form it's annoying to complete the hole form and in the end you get the message "duplicate record".
Powerm wrote:As far I know you will have to develop a script for that....
Do you mean a plugin, right?
Daes anyone have such a plugin? Could be shared on the community as a paid plugin...
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: User already exists

Post by BenHayat »

weblike wrote:
Do you mean a plugin, right?
Daes anyone have such a plugin? Could be shared on the community as a paid plugin...
No, not a plugin. What he is suggesting is "advance Scripting", which I doubt it would do it, unless you want to change to HTML Input rather than Aware Input.

As I said, this needs to be done inside Aware, where we can attach a rule to an attribute and have that rule execute when the attribute is changed and not the whole object. I had done that in other platform using AJAX, but I wish Aware had this feature.
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: User already exists

Post by weblike »

Thanks guys for sharing your thoughts,

So, this would be a nice feature ....
Support could you consider looking on this, to have what Ben says?

thank you.
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: User already exists

Post by weblike »

Hi,

No need of plugin or advanced script.
Just found a simple way to do this:

1. In BO create an attribute BO.AlreadyExist (Yes/No, calculated, default='No')
2. In BO create this dynamic rule:

If EXISTS SystemUser WHERE (SystemUser.LoginName=ThisBOUser.LoginName AND SystemUser.ID<>ThisBOUser.ID) Then
BOUser.AlreadyExist='Yes'
ELSE
BOUser.AlreadyExist='No'


To make this looking great inside the form, add a HTML cell and use: <<IF BOUser.AlreadyExist='Yes' THEN SHOW 'Message'>>...

This should do the trick. :)
Cheers,
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Powerm
Posts: 473
Joined: Mon Feb 01, 2010 9:44 pm
Contact:

Re: User already exists

Post by Powerm »

But your Rule means they have to save the Form first....
Independent Developer
www.atwing.com
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: User already exists

Post by BenHayat »

weblike wrote:Hi,

No need of plugin or advanced script.
Just found a simple way to do this:

1. In BO create an attribute BO.AlreadyExist (Yes/No, calculated, default='No')
2. In BO create this dynamic rule:

If EXISTS SystemUser WHERE (SystemUser.LoginName=ThisBOUser.LoginName AND SystemUser.ID<>ThisBOUser.ID) Then
BOUser.AlreadyExist='Yes'
ELSE
BOUser.AlreadyExist='No'


To make this looking great inside the form, add a HTML cell and use: <<IF BOUser.AlreadyExist='Yes' THEN SHOW 'Message'>>...

This should do the trick. :)
Cheers,
But that rule doesn't get executed until the Object is submitted, which not what you were asking. hat message in HTML cell only shows when you try to save. Unless I'm missing something.
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: User already exists

Post by weblike »

Hi PowerM,

You are right about the HTML (just tested).. but the rule is executed and the BOUser.AlreadyExist is marked as YES...

The question now is how this is executed dynamically <<IF BOUser.AlreadyExist='Yes' THEN SHOW SECTION_START>> Message<<SECTION_END>> ???????
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Powerm
Posts: 473
Joined: Mon Feb 01, 2010 9:44 pm
Contact:

Re: User already exists

Post by Powerm »

That's the point....I have not seen anyone having implemented that dynamic piece :(
You could build a Wizard like Form , BO saved with they click on the Next button and show a different message if the USerName exists or not...just an idea.
Independent Developer
www.atwing.com
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: User already exists

Post by weblike »

Hi,

For the moment I did it with this workaround:

Inside the form :
1.Insert Separator Row with condition : "Not present when BOUser.AlreadyExist='No' " ...

It's true is not so elegant, but does the concept....It hides/shows the message accordingly.

If could use dynamically "THEN SHOW SECTION_START....SECTION_END"...would be great....
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
hpl123
Posts: 2602
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: User already exists

Post by hpl123 »

George,
Here are some thoughts on a solution that ALMOST works like the Gmail one.

1. Create an attribute called "DuplicateMessage"

2. Create a rule (Initialization rule):

Code: Select all

If UserDup.Username IS DEFINED AND EXISTS UserDup WHERE (UserDup.Username=ThisUserDup.Username) Then
 UserDup.DuplicateMessage='<font style=font-weight:bold;color:red;>Username not available</font>'
ELSE
If UserDup.Username IS DEFINED AND NOT(EXISTS UserDup WHERE (UserDup.Username=ThisUserDup.Username)) Then
 UserDup.DuplicateMessage='<font style=font-weight:bold;color:green;>Username available</font>'
3. On your form, create 2 html cells:
Button cell:

Code: Select all

<button type="button" onclick="AwareApp.recalculateObject2(this)">Username Available?</button>
Message cell:

Code: Select all

<<UserDup.DuplicateMessage>>
This solution enables you to check if a username is available BEFORE saving the form i.e. the user can do it when typing in information on the form. I have attached some screenshots below and I haven´t cleaned up the form or maked it look good. I just wanted to show you the result.
Attachments
av1-vert.jpg
av1-vert.jpg (98.06 KiB) Viewed 15522 times
Henrik (V8 Developer Ed. - Windows)
Post Reply