Custom Text Box in ARAS

Hi, I have a form attached to the Item Type. I added a custom text box name Order_number in Form (Order_number is not added as property in Item Type). I'm trying to get the value user has entered while creating but not able to read the values. Innovator inn = this.getInnovator(); string Order_number = this.getProperty("Order_number"); How can I get the value user has entered On After Add event ?
Parents
  • Hello, Because the order_number is not a property on the Item, editing the text box will not make any changes to the item by default. However, we can utilize the concept of a fake property to achieve the result you're looking for. You can add an onChange field event to the order_number field on your Form that runs code like aras.setItemProperty(parent.item, "order_number", srcElement.value);. One caveat to this approach is that you will only have access to this property from an onBeforeAdd server event. The context item of an onAfterAdd server event is the result of the Item being applied, and properties like this that don't exist on the ItemType will simply be ignored. Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hello, Because the order_number is not a property on the Item, editing the text box will not make any changes to the item by default. However, we can utilize the concept of a fake property to achieve the result you're looking for. You can add an onChange field event to the order_number field on your Form that runs code like aras.setItemProperty(parent.item, "order_number", srcElement.value);. One caveat to this approach is that you will only have access to this property from an onBeforeAdd server event. The context item of an onAfterAdd server event is the result of the Item being applied, and properties like this that don't exist on the ItemType will simply be ignored. Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data