Issues with a!PickerFieldUsers() function

Certified Associate Developer

Hello,

I have a requirement to build up a dynamic form based on the CDT we receive from API call. On the basis of keyAttribute value we are displaying the various controls. Now what i'm doing is I'm displaying the controls and their default values from the CDT received and saving the values to another CDT. Every other controls are working fine but with a!pickerFieldUser() funciton i'm getting errors. Below is the code I'm using

 

load(
local!tempUservalue:if(or(isnull(ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue),
len(ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue)=0),
null,
ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue
),

with(
a!pickerFieldUsers(
label:ri!defDataContentMetrics_cdt[ri!index].ContentMetric,
lablePosition: "ABOVE",
maxSelections: 1,
value: local!tempUserValue,
saveInto: {
local!tempUserValue,
a!save(
ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue,
if(
or(
isnull(save!value),
len(save!value) = 0
),
null,
save!value
)
),

 

a!save(
ri!ContentMetricsUpdatedValue_cdt[ri!index].FormAttributeValue,
if(
or(
isnull(save!value),
len(save!value) = 0
),
null,
save!value 
)
)
},
required: if(ri!defDataContentMetrics_cdt[ri!index].Required=1,true,false)
)

)
),

 

Where defDataContentMetrics_cdt is fetching values from API Call and ContentMetricsUpdatedValue_cdt is used to store the values. Can somebody tell me what is wrong inside the code?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Associate Developer
    in reply to bradc
    Hey Brad,

    I checked this by placing a textfield control and its shows the value null(Which is the expected outcome), Also I tried by removing with() clause but it haven't make any difference. One more thing i noticed is its taking the same user name as a default value and when I checked the directory there is no such user with that username.
Children