Skip to main content
September 14, 2022
Question

What´s the best way to work this and why does it gives me this error?

  • September 14, 2022
  • 7 replies
  • 0 views

Hello, 

I'm not quite sure if  I'm working with this pickerFieldRecord correctly (it is not saving any value in the rule input) and I don't understand why it says that "idSkill" is type Text because it isn't... 





 a!localVariables(
  
  local!Skill,
  
  
 
 (...)
 
 
 
 
 
 a!pickerFieldRecords(
                    label: "Competências",
                    labelPosition: "ABOVE",
                    placeholder: "-- selecione uma ou mais competências --",
                    maxSelections: 3,
                    recordType: 'recordType!{b10f5f28-725c-4c8b-a211-776386be5222}RM_ref_Skill',
                   
                    value: ri!recordCandidateSkills.idSkill,
                    saveInto: {local!Skill, a!save(
                      ri!recordCandidateSkills.idSkill,
                      if(
                        a!isNullOrEmpty(local!Skill),
                        {},
                        a!forEach(
                          local!Skill.idSkill,
                          property(fv!item, "idSkill", null())
                        )
                      )
                    )},
                    
                    

7 replies

durgeshk0003
September 14, 2022

Check your forEach loop, it should loop through your Skills and then pickup the idSkill, or replace the proprty() function with fv!item, this should work.

stefanhelzle0001
Brainy
September 14, 2022

The issue is with your local!Skill. The picker field will store just the ID of the selected record to local!Skill wich makes this a list of integer. Then in line 27 you try to do something by indexing into this local.

joaoc1131Author
September 14, 2022

I was trying to save the id of the selected skills in a local and then, in the forEach, save them in the rule inputs "idSkill".

mikes0011
Brainy
September 14, 2022

local!skill does NOT have a property called "idSkill", but you're trying to directly refer to such a property anyway.  Needless to say, that won't work.

The Expression Guru