Menu

Calculated Field in Custom Module

2020-05-17
2020-05-18
  • Jason Ulloa

    Jason Ulloa - 2020-05-17

    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

     
  • Molkobain

    Molkobain - 2020-05-18

    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.

    • 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

     

Log in to post a comment.

MongoDB Logo MongoDB