Change the identity when adding a user

オフライン
Hi All, We weird dutch people having names with a word between our first name and surname. "Jan de Wolf", "Piet van Rijn", "Karel van der Casteele" See also: www.behindthename.com/.../dutch_names We want to create documents with Aras en sometimes we need to split those names in separate areas, therefore I added a property on the users Itemtype. But when creating a user automatically a identity will be created with the method AddAliasIdentity. This is a Aras core class. I would like to add this property some how to complete the string in the identity. Has any one an idea how I could solve this challenging issue. Best regards, Tom
Parents
  • Happy to hear that my solution helped you. You can simplify you code: Instead (3 lines of code):
    Item userItem = this.newItem("User","get"); userItem.setProperty("id",userId); userItem = userItem.apply();
    You can use (one line of code):
    Item userItem = this.getInnovator().getItemById("User", userId);
    Instead creating if statement (5 lines of code), you can write something like (one line) :
    updateIdnt.setProperty("name", userItem.getProperty("{prop1}", "") + ( (!string.IsNullOrEmpty(userItem.getProperty("{prop2}"))) ? " " + userItem.getProperty("{prop2}") + " " : "")  + userItem.getProperty("{prop3}",""));
    If you prefer to keep the if statement, you need to update it as following:
    if (string.IsNullOrEmpty(userItem.getProperty("{prop2}"))
Reply
  • Happy to hear that my solution helped you. You can simplify you code: Instead (3 lines of code):
    Item userItem = this.newItem("User","get"); userItem.setProperty("id",userId); userItem = userItem.apply();
    You can use (one line of code):
    Item userItem = this.getInnovator().getItemById("User", userId);
    Instead creating if statement (5 lines of code), you can write something like (one line) :
    updateIdnt.setProperty("name", userItem.getProperty("{prop1}", "") + ( (!string.IsNullOrEmpty(userItem.getProperty("{prop2}"))) ? " " + userItem.getProperty("{prop2}") + " " : "")  + userItem.getProperty("{prop3}",""));
    If you prefer to keep the if statement, you need to update it as following:
    if (string.IsNullOrEmpty(userItem.getProperty("{prop2}"))
Children
No Data