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 Tom, If I understand it right, you want to be able to set Identity name to different value than "First Name & Last Name"? If you, you can create serverMethod onAfterAdd of the ItemType Alias and then get User item from source_id property and the Identity from related_id property. Then update name property of Identity item based on properties from User item. Something like this:
    Item userItm = this.getPropertyItem("source_id"); Item identItm =this.getPropertyItem("related_id"); Item updateIdnt = this.getInnovator().newItem(identItm.getType(), "merge"); updateIdnt.setID(identItm.getID()); updateIdnt.setProperty("name", userItm.getProperty("{prop1}", "") + " " + userItm.getProperty("{prop2}") + " " + userItm.getProperty("{prop3}")); updateIdnt.apply();
Reply
  • Hello Tom, If I understand it right, you want to be able to set Identity name to different value than "First Name & Last Name"? If you, you can create serverMethod onAfterAdd of the ItemType Alias and then get User item from source_id property and the Identity from related_id property. Then update name property of Identity item based on properties from User item. Something like this:
    Item userItm = this.getPropertyItem("source_id"); Item identItm =this.getPropertyItem("related_id"); Item updateIdnt = this.getInnovator().newItem(identItm.getType(), "merge"); updateIdnt.setID(identItm.getID()); updateIdnt.setProperty("name", userItm.getProperty("{prop1}", "") + " " + userItm.getProperty("{prop2}") + " " + userItm.getProperty("{prop3}")); updateIdnt.apply();
Children
No Data