AnsweredAssumed Answered

Help with ca_pam_getDatasetData

Question asked by samuel.leibowitz on Feb 25, 2014
Latest reply on Feb 27, 2014 by samuel.leibowitz
Hi all,
 
I have a question about dynamically populating a form field from a dataset in PAM 4.2.
 
I'm currently trying to create a SRF form which reads a field from a dataset on the orchestrator and populates the contents of a text field accordingly.  In the form's onLoad() property, I've tried the following, which seems to work fine:
 
updateEnvironmentInfoField : function() {
var environmentInfoText = "Hi there."
ca_pam_setTextFieldValue("Form.EnvironmentInfo", environmentInfoText)
  },
 
  
However, I can't seem to get the call to ca_pam_getDatasetData to run correctly.  The following just doesn't seem to do anything:
 
updateEnvironmentInfoField : function() {
 
envCallBack = new Object();
 
 
envCallBack.onSuccess = function() {
 var environmentInfoText = "Hooray."
 ca_pam_setTextFieldValue("Form.EnvironmentInfo", environmentInfoText)
}
 
envCallBack.onFailure = function() {
 var environmentInfoText = "This seems like a problem."
 ca_pam_setTextFieldValue("Form.EnvironmentInfo", environmentInfoText)
}
 
ca_pam_getDatasetData(Datasets['/Development/Sam/WestChicken'].Customer, envCallBack)
  },
  
Does anyone have any suggestions? I have confirmed that the path to the dataset is correct, and that there is a Customer field in that dataset.
 
Many thanks,
Sam

Outcomes