My requirement is to display current month as default option in dropdown and user can change month value from dropdown if they want to change and for each month there should be integer value saved in Rule Input "selectedMonth", so I have applied dropdownFieldByIndex() function for this. If user select blank then it will revert it to current month but I am getting below issue:
SAIL Code:
local!currMonth: datetext(today(),"M"), local!monthName: {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},
a!dropdownFieldByIndex( label: "", labelPosition: "ABOVE", placeholder: "--Select Month--", choiceLabels:union(local!monthName,local!monthName), /*choiceValues: tointeger(union(local!monthValue,local!monthValue)),*/ value: if(rule!APN_isNotBlank(ri!selectedMonth),ri!selectedMonth,local!currMonth), saveInto:ri!selectedMonth, searchDisplay: "ON" )
Can anyone help with this what is the issue?
Discussion posts and replies are publicly visible
Are you aware that regardless of whether you code works or not, the actual value of your rule input will not be updated to the current month in case the user selects no value?
I recommend to put that logic into the saveInto. Add an a!save() to check for the selected value and in case of NULL, write the current month into the rule input.