CA Service Management

  • 1.  How to catch quantity box with javascript?

    Posted Aug 14, 2017 03:22 PM

    Hi! It's me again! This time I'm trying to get the number that the user fills with the quantity of the selected element. I need to get it so I can send it to the SDM ticket. (I'm not using PAM)

     

     

    I only know that it is stored in an event parameter called numeric_1 but I don't know how to call it from my form.

    Does anyone know how to do it?

     

    Best Regards,

    Sebastian



  • 2.  Re: How to catch quantity box with javascript?
    Best Answer

    Broadcom Employee
    Posted Aug 15, 2017 03:54 AM

    Good Morning Sebastian.
     
    You might consider to create a report builder/data object on the 'Numeric_1' column.
    And use that in a "ca_reportQuery" function in the script of the form.
     
    Kind regards, Louis.



  • 3.  Re: How to catch quantity box with javascript?

    Posted Aug 15, 2017 10:03 AM

    Hi Louis, thanks for your answer!

     

    do you know in which table I can get that field?

    I must use it in the "On submit" script?

     

    Regards,

    Sebastian



  • 4.  Re: How to catch quantity box with javascript?

    Posted Aug 15, 2017 01:09 PM

    One option might be to leverage a method like document.getElementsByTagName() similar to my suggestion in this thread. As a quick test I was able to grab the quantity via the following:

     

    document.getElementsByTagName("input")[7].value

     

    Note that the actual element for the quantity field may be different (other than 7) in your environment depending on a few things like if the offering is using one-click submit/shopping cart, multiple service options, etc.



  • 5.  Re: How to catch quantity box with javascript?

    Posted Aug 15, 2017 02:43 PM

    Hi Jason! Do you know if this code will work on differents forms and offerings? Because I think the id will change depending on the form and the offering, am I right?



  • 6.  Re: How to catch quantity box with javascript?

    Posted Aug 15, 2017 03:27 PM

    This will definitely work with different forms/offerings however as mentioned the array element returned by getElementsByTagName will likely be different so you'll need to test/verify for each one.



  • 7.  Re: How to catch quantity box with javascript?

    Broadcom Employee
    Posted Aug 16, 2017 06:58 AM

    Good Afternoon Sebastian.

     

    For the data object query, you can use this one:

    SELECT request_id,text_5,numeric_1,numeric_2
    FROM dbo.usm_subscription_detail
    where request_id = 10163 and text_5 IS NOT NULL
    order by request_id desc

     

    The column text_5 holds the rate/price of the service option.

     

    Kind regards, Louis.