You havze to overload the ComputValues of the class and do you calculation. If you look at the standard UserRequest class, you will see that the ComputeValues() method calls a ComputePriority() method to calculate priority from both urgency and impact, which is exactly what you want to do.
Original code can be found in the file : datamodels\2.x\itop-request-mgmt-itil\datamodel.itop-request-mgmt-itil.xml
FIeld C must have a dependancy on both Field A & B in order for it to be updated when they are changed.
Hope this helps,
Guillaume
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I'm new to itop development and i want to know hot to sum or multiply a field inside a custom module
For example
Field A = 2
Field B = 2
Field C = FieldA x FieldB
Field C must be calculated automatically.
Thank you so much
Hello Jason,
You havze to overload the ComputValues of the class and do you calculation. If you look at the standard UserRequest class, you will see that the ComputeValues() method calls a ComputePriority() method to calculate priority from both urgency and impact, which is exactly what you want to do.
Hope this helps,
Guillaume