IT Process Automation

 View Only
  • 1.  Dynamic dropdown code for IRF

    Posted Jul 08, 2014 10:26 AM

    Hey guys,

     

    I am trying to pull data from a dataset to populate a dropdown in an IRF.

     

    I am calling the function to pull data from the dataset on load. However, the function to pull data from a Dataset is not tripping any of the callback functions.

     

    {
      populateDataInTable : function()
      {
      var callBack = new Object();
      callBack.onSuccess = function(result)
      {
       alert("Success");
       alert(result);
       var Titles = ca_pam_convertToSimpleArray( result, 'resource_name');
       var TitlesUUID = ca_pam_convertToSimpleArray( result, 'uuid');
       alert(Titles);
       alert(TitlesUUID);
       ca_pam_clearSelectStore(Form.jobTitle);
       ca_pam_addValuesInSelectStore('Form.jobTitle', ca_pam_createSelectStore(Titles ,TitlesUUID ));
      
      }
    
      callBack.onFailure = function(caught)
      {
       alert(caught);
      }
    
      alert("Get");
      ca_pam_getDatasetData(Datasets["Job Titles Dataset"], callBack);
    
      }
    }
    
    

     

    I started spamming alert funcitons to determine where the code get fired. At this moment only the "Get" alert is tripping.

     

    Here is the dataset:

    dataset.JPG

    Any suggestions would be greatly appreciated.

     

    -Dylan



  • 2.  Re: Dynamic dropdown code for IRF

    Posted Jul 17, 2014 06:28 PM

    Dylan,

     

    I think you have to pass more information as to the path and object from which the dataset is being called.

     

    (from the Content Designer Guide)

     

    /////////

    datasetExpression (string)

     

        Defines a string, expression, or function call that results in an absolute path to a dataset. This parameter includes the Datasets keyword, the library path to a dataset object, and the ValueMap array variable name.

     

        Datasets["/BR412-DATA-FOLDER-20111214/Folder_FORMS_20120328/dataset_forms_demo/My_Dataset55"].MyVal

    /////////

     

    Good Luck,

    jw1



  • 3.  Re: Dynamic dropdown code for IRF
    Best Answer

    Posted Jul 23, 2014 10:27 AM

    Hi Dylan,

     

    Here's how it should look:  ca_pam_getDatasetData('Datasets["/full/path/to/Job Titles Dataset"]', callBack);

     

    Note that this method requires the full path to the dataset AND you need to enclose the entire first argument in quotes (see the single quotes I used the in example above).

     

    Thanks,

    Tom