it seem not possible that a SRF reach a Dataset variable out of a script
what did I miss?
{
setVals: function()
{
ca_pam_clearSelectStore('Form.verfahren_name')
var newOptionNames = new Array();
newOptionNames[0] = "" + Datasets["/BLKA/Prozesse/SOI/Dataset"].Verfahren_Liste.length;
ca_pam_addValuesInSelectStore('Form.verfahren_name', ca_pam_createSelectStore(newOptionNames))
}
}
Release : 4.3
Component : Process Automation
I suppose there are two questions/queries in the whole discussion.
1. It seem not possible that an SRF reach a Dataset variable out of a script.
2. We want to fill a Drop-down Field in an SRF, the values should come out of a ValueMap Field in a global Dataset
For question 1:
SRF script section cannot access the global Dataset variable for populating data in any of its components, this is as per the component design. Script section is for performing actions within the Form section and it has no access to the ITPAM library as such. The functionality is only limited to any of the form methods exposed (ca_pam_*) along with native JavaScript methods, the only access points of the script section for getting data and populating the form fields are REST calls, SOAP calls and database calls and this can be achieved with the help of pre-defined form functions ca_pam_getRESTData, ca_pam_getSOAPData,ca_pam_getSQLData respectively.
(The only exception to this is with ca_pam_getDatasetData with limitations of only showing one column of elements (an array) even in this case) but again this method is only for displaying that value in a pop table but not to populate any form data.)
For question 2:
Dropdown field in an SRF can only be filled with a string array but not with a value map, this is because of the format of values it can hold. The way you have suggested (reorganizing your value map as suggested) is the only solution to read values from Value Map to drop down in an SRF (by modifying the value map to the desired format as suggested in Out of box content and my making use of Dataset Expression parameter in the dropdown field in SRF).
Recommended reorganizing the dataset to follow the examples in the out of the box content.