Forum Stats

  • 3,873,270 Users
  • 2,266,529 Discussions
  • 7,911,490 Comments

Discussions

How can I have the live value (AVG) while filling a a interactive form?

Jesun Ahmad Ushno
Jesun Ahmad Ushno Member Posts: 7 Green Ribbon

Greetings Everyone, Hope you all are doing great. I'm Jesun Ahmad Ushno. Recently I'm working with APEX. So, While Creating the Form, I'm facing a challenge. So I'm seeking for answers from Seniors & Experts.

I'll be providing a picture and explaining my demands so that might help you get to understand.

So, Here I want to get an automated AVG value on "AVG. REVENUE PER UNIT".

So, it will be like whenever I put a value on the "NO OF UNIT" field and "AMOUNT" field then the given value will do computing operations from where it will show the AVG value of them in "AVG. REVENUE PER UNIT" form.

Thanks In Advance.

Answers

  • Hamza Al-abbasi
    Hamza Al-abbasi Member Posts: 776 Bronze Crown

    Hello Jesun Ahmad Ushno,

    • Create a DA when changing "NO OF UNIT" and "AMOUNT".
    • Add action Set Value.
    • Set Type: JavaScript Expression
    • In JavaScript Expression write your computation e.g. :
    parseFloat($v("PX_NO_OF_UNIT")) * parseFloat($v("PX_AMOUNT"))
    
    • Affected Elements :
    • Selection Type: Item(s)
    • Item(s): PX_AVG_REVENUE_PER_UNIT
    Jesun Ahmad Ushno
  • Jesun Ahmad Ushno
    Jesun Ahmad Ushno Member Posts: 7 Green Ribbon

    @ Hamza Al-abbasi Greetings, Hope you are doing great.

    Could you please explain to me the solution you have given earlier,

    I'm having difficulties applying the solution. Do I have to create "DA" on both "P3_NO_OF_UNIT" and "P3_AMMOUNT" and then give Java Script Expression?

    and what should be in "P3_AVG_REV_PER_UNIT" ?

    Cloud you please describe me the process please?


  • Hamza Al-abbasi
    Hamza Al-abbasi Member Posts: 776 Bronze Crown

    Do I have to create "DA" on both "P3_NO_OF_UNIT" and "P3_AMMOUNT"

    Yes.

    and then give Java Script Expression?

    Add action in Set Value in Change DA.

    and what should be in "P3_AVG_REV_PER_UNIT" ?

    This item will hold the result.

    Jesun Ahmad Ushno