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
  • Hello Zahar, Thank you for your suggestion. I wasn't able to get the user information on the id, so I did it the long way and that seems to work. I also needed to extend the method with a if statement so when the {prop2} is empty.
    
    Innovator inn = this.getInnovator();
    
    Item identItm =this.getPropertyItem("related_id");
    string userId = this.getProperty("source_id");
    
    Item userItem = this.newItem("User","get");
    userItem.setProperty("id",userId);
    userItem = userItem.apply();
    
    Item updateIdnt = this.getInnovator().newItem("Identity", "merge");
    updateIdnt.setID(identItm.getID());
    if (userItem.getProperty("{prop2}","") == null) 
    {
        updateIdnt.setProperty("name", userItem.getProperty("{prop1}", "") + " " + userItem.getProperty("{prop3}",""));   
    } else
    {
        updateIdnt.setProperty("name", userItem.getProperty("{prop1}", "") + " " + userItem.getProperty("{prop2}","") + " " + userItem.getProperty("{prop3}",""));
    }
    updateIdnt.apply();
    
    return inn.newResult("");
Reply
  • Hello Zahar, Thank you for your suggestion. I wasn't able to get the user information on the id, so I did it the long way and that seems to work. I also needed to extend the method with a if statement so when the {prop2} is empty.
    
    Innovator inn = this.getInnovator();
    
    Item identItm =this.getPropertyItem("related_id");
    string userId = this.getProperty("source_id");
    
    Item userItem = this.newItem("User","get");
    userItem.setProperty("id",userId);
    userItem = userItem.apply();
    
    Item updateIdnt = this.getInnovator().newItem("Identity", "merge");
    updateIdnt.setID(identItm.getID());
    if (userItem.getProperty("{prop2}","") == null) 
    {
        updateIdnt.setProperty("name", userItem.getProperty("{prop1}", "") + " " + userItem.getProperty("{prop3}",""));   
    } else
    {
        updateIdnt.setProperty("name", userItem.getProperty("{prop1}", "") + " " + userItem.getProperty("{prop2}","") + " " + userItem.getProperty("{prop3}",""));
    }
    updateIdnt.apply();
    
    return inn.newResult("");
Children
No Data