Forum Discussion

Dharmatej34's avatar
Dharmatej34
Ideator II
8 years ago

Display property value to be different from actual value

Hi, I would like to have a property value displayed differently than the actual value which is on the Item. I could have a field on the form, which can be set on form load, but I want the same behavior on the search grid, relationship grids as well. Thanks.  

5 Replies

  • Hello, Can you explain what you mean by "differently"? Are you trying to do something like this (example):
    You have Part with part number "ASS12345" and revision 1.0 And you want to be able to see "ASS12345 1.0"?
    `
  • I would like to have a method, which would change the value based on some rules, just for displaying it to the user. Thanks in advance.
  • To achieve your functionality you can add server method for "after add" and "after update" events and this method need to update property keyed_name.
  • Hi Zahar, Thanks for the reply. I want the property value to be changed and displayed only on the client side. If I have a "after add" or "after update"  events, these would get triggered, even if I query the item on server side using AML or API, which would change the property value. So I wanted the property value changed only when it gets displayed in the client. Regards, Dharma
  • Dharma, Then you need to change the event to onBeforeGet to do something like this:
    this.setProperty("keyed_name", {new value} ); return this;
    This code will only change the value of keyed_name that returned and not actual value in DB But keep in mind that if you will always need to show the same value, so there is no reason not to save it to the keyed_name property once instead running your logic every time that object is returned from the DB.