loading interface should hold Ids in rule input

load(
/*rule!DDG_getSetupQuestions()*/

local!ques: rule!DDG_getSetupQuestions(),
/*local!setUpResponse: rule!DDG_SetupQueResponseRule(),*/
/*local!answoption: rule!DDG_getSetQueAnsOption(6),*/
a!formLayout(
label: "SetUp Questions for " & ri!OppData.Opportunity_Id,
contents: {
a!columnsLayout(
columns: {
a!columnLayout(
contents: {
a!boxLayout(
label: "Questions",
contents: {
a!gridLayout(
totalCount: count(
local!ques
),
headerCells: {
a!gridLayoutHeaderCell(
label: "Sr. No."
),
a!gridLayoutHeaderCell(
label: "Questions"
), a!gridLayoutHeaderCell(
label: "Questions ID",
showWhen: true
),
a!gridLayoutHeaderCell(
label: "Answer"
)/* For the "Remove" column a!gridLayoutHeaderCell(label: "" ) */

},
/* Only needed when some columns need to be narrow */
columnConfigs: {
a!gridLayoutColumnConfig(
width: "NARROW"
),
a!gridLayoutColumnConfig(
width: "DISTRIBUTE",
weight: 3
), a!gridLayoutColumnConfig(
width: "DISTRIBUTE",
weight: 3,
showWhen: true
),
a!gridLayoutColumnConfig(
width: "DISTRIBUTE",
weight: 3
)
},
rows: a!forEach(
items: local!ques,
expression: a!gridRowLayout(
id: fv!index,
contents: {
/* For the Sr.NO Column*/
a!textField(
/* Labels are not visible in grid cells but are necessary to meet accessibility requirements */
label: "Que " & fv!index,
value: fv!index,
saveInto: fv!index,
required: true,
readOnly: true
),
/* For the Question Text Column*/
/*fv!item.ID & "Q." & fv!index & " " & */
a!textField(
/*label: "QueText " & fv!index,*/
label: ""&fv!item.QuestionText,
value: fv!item.QuestionText,
required: true,
/* saveInto: ri!setUpQueResponse.SetQuestId[fv!index],*/
readOnly: true
),

with(

a!textField(
value: fv!item.ID,
saveInto: ri!setUpQueResponse.SetQuestId[fv!index],
showWhen:true, readOnly: true
)
),
a!dropdownField(
label: "option " & fv!index,
placeholderLabel: "-- Select Answer -- ",
choiceLabels: fv!item.SetAnsCDT.Options,
choiceValues: fv!item.SetAnsCDT.Id,
value:fv!item.SetAnsCDT.Id[fv!index],
saveInto: ri!setUpQueResponse.SetAnsId[fv!index],
required: true

)
}
)
),
addRowlink: a!dynamicLink(
/*label: "ADD",*/
value: {
startDate: today() + 1
},
saveInto: {
a!save(
ri!setUpQueResponse,
append(
ri!setUpQueResponse,
save!value
)
)
}
)
)
},
style: "#AED6F1",
marginBelow: "STANDARD"
)
}
)
}
)
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidget(
label: "Submit",
submit: true,
style: "PRIMARY"
)
},
secondaryButtons: {
a!buttonWidget(
label: "Cancel",
value: true,
saveInto: ri!cancel,
submit: true,
style: "NORMAL",
validate: false
)
}
)
)
)

 

 

 

 

 

 

 

what we want is During Loading interface or Selecting Anwers option Question Id should also be Set in rule input.. Both SetqueId and SetAnsId are of Array type.

Both 

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    I've assumed that ri!setUpQueResponse is a CDT array so I think the following change to your dropdownField should work. Give it a try and let us know if you're not getting the desired result

    a!dropdownField(
     label: "option " & fv!index,
     placeholderLabel: "-- Select Answer -- ",
     choiceLabels: fv!item.SetAnsCDT.Options,
     choiceValues: fv!item.SetAnsCDT.Id,
     value: fv!item.SetAnsCDT[fv!index].Id,
     saveInto: {
      ri!setUpQueResponse[fv!index].SetAnsId,
      a!save(ri!setUpQueResponse[fv!index].SetQuestId, fv!item.ID)
     },
     required: true
    )

  • 0
    A Score Level 2
    in reply to Tim
    Sanjana,
    You can use the above code, Please not that the Question Id will not be saved if the user will not interact with the dropdown component.
    If you want to save the data regardless of the interaction then you can use saveInto of the submit button
    a!save(ri!SetQuestId,index(local!ques,"ID",{}))

    Hope your Rule Input is of type Number Integer and multiple
Reply Children
No Data