Custom attribute Of object
Hi . I want to create a custom attribute that depends on other attribute value.
For exapme object Person has attributes
salay
after_tax
if I enter salary 1000 , attribute after_tax should be calculated automaticly
for example 1000*some_tax_coeficient.
Comments
Hi Misha,
You can take help of Macros. Create a macro which runs on Attribute change event, which calculates the after_tax and saves in the attribute.
Thanks,
Amol Patil
Thanks for replay, I hate macros because they slow down modelling process. The macro will be called every time designers change attribute value of all objects. And they are crazy about macro little icon appearing and waiting time (1 sec ) :))))
Maybe there is another solution ?
Hi Misha,
Yes I agree, calling a macro on Attribute change makes the process slow. Then you can do one thing, schedule a report, which does a search operation in database to collect all Person objects and calculates their after_tax value if the pre-existing value is not correct. Schedule this script on hourly basis, the script will run in background at server side to update the values. This might help you.
Thanks,
Amol Patil
Hi Misha,
Re your comment below:
"...The macro will be called every time designers change attribute value of all objects..."
This will not happen when you select the save model event as the trigger, which occurs only once when the model gets saved.
Regards,
Sam
That's much better . but can you tell me how can I schedule a report ?
Thanks for replay , I will try it, it sounds much better :)