CA Service Management

 View Only
  • 1.  How do I populate a select field without a report or a plugin

    Posted Oct 06, 2017 10:25 AM

    Hi guys,

     

    I want to use a pure javascript implementation that would allow me to populate a select field with data.

    When I check the documentation, All I can find are get or select operations, not a set one. 

    To save time, these are the methods

     

    Is that possible? Has anyone done this? I'm currently using Service catalog 14.1 version, with the latest patch



  • 2.  Re: How do I populate a select field without a report or a plugin

    Broadcom Employee
    Posted Oct 06, 2017 10:49 AM

    Good Afternoon Marcel.

     

    Attached you'll find two text files. Containing possible helpful information for you on this subject.

     

    Kind regards, Louis van Amelsfort.



  • 3.  Re: How do I populate a select field without a report or a plugin

    Posted Oct 06, 2017 11:26 AM

    Hi Louis,

     

    Unfortunately, your examples did not help me, as one populates text fields and the other uses a report. I really would love something like ca_fdSetTextFieldValue, that you have shown in the lookup example, to select options.

     

     

    I need to populate/create the options of a select field using only javascript and no report/plugin. So i n essence I want to do the same thing that a report or a plugin/report does, but without using them.

     

    As I said, I have getters but no setters for this type of field. 

     

    But Thanks anyway

     



  • 4.  Re: How do I populate a select field without a report or a plugin

    Broadcom Employee
    Posted Oct 09, 2017 05:03 AM

    Good Morning Marcel.

     

    Thanks for further explaining this.

    What data do you then want to populate the form-field with?

    A fixed value? Or a value 'to be retrieved'? From where? Another field?

     

    Please advise. Thanks in advance and kind regards, Louis.



  • 5.  Re: How do I populate a select field without a report or a plugin
    Best Answer

    Posted Oct 09, 2017 09:51 AM

    Hi Louis, I have a working javascript that do some ajax and gather info, in this case, I get some data from vmware rest api. But when I get one example working, I would extend to many use cases. Some customers don't like to have to use the java plugin, and these would be an alternative. 



  • 6.  Re: How do I populate a select field without a report or a plugin

    Broadcom Employee
    Posted Oct 09, 2017 05:24 AM

    Good Morning Marcel.

     

    Perhaps the following example helps you further?

    onSubmit: function(){
    if (_.request.status != 101 && _.request.status != 100

    {
        return true;
    }
    if(ca_fdGetSelectedRadio(ca_fd.formId,'user_selection_type') == 'newUser'){
        var kundnr  = ca_fdGetTextFieldValue(ca_fd.formId, 'cust_no');
        var kod2    = ca_fdGetSelectedOptionValues(ca_fd.formId,'sel_kod2')[0];
        var user    = ca_fdGetTextFieldValue(ca_fd.formId, 'best_for');
        var newUser = kundnr + ':' + user + ':' + kod2;

     


        ca_fdSetTextFieldValue(ca_fd.formId,'user_asset_name', newUser);

     

        ca_fdSetTextFieldValue(ca_fd.formId,'custom2_user', newUser);

     

    }

     

    Kind regards, Louis.