Unique username with own prefix
Hello,
I'm looking for a way to generate unique usernames with my own prefix
instead of the component.classname, which GetUniqueUserName is using.
Is there a way to use my own counter and check if the username generated
that way is unique or to let RB-routines use my own prefix?
Kind regards,
Mark
I'm looking for a way to generate unique usernames with my own prefix
instead of the component.classname, which GetUniqueUserName is using.
Is there a way to use my own counter and check if the username generated
that way is unique or to let RB-routines use my own prefix?
Kind regards,
Mark
This discussion has been closed.
Comments
There is no automatic way to do this. You could use the
OnComponentCreate event of the designer to assign your own name/username
which fires after the original is set.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
but I would still need a way to generate such an unique username and / or to
check if the one I've generated is unique or if I need to increase the
counter or something like that.
I need to replace some DBMemos with some DBRichTexts. There can be different
amounts of them in the templates and there also can be some DBRichTexts,
which have the desired username prefix already, so that I would need to
start with different counters theoretically.
Looks as if I will have to go through all the components in a loop and
check, if one of them already has a username, I generated for the new
component.
Correct. As I mentioned before, there is no automatic way to do this.
ReportBuilder gives you a way to change the username, the rest must be
done manually. Something similar to the GetUniqueUserName routine perhaps.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
apparently it's not even necessary to generate an unique username. Once I
assign the same username to another component (second in my case), it
automatically gets a "1" added to the username I've assigned.