I am having a editable grid in that there is a field that should autopopulate a value
eg. there are two fields start date and end date I want to find the difference and then in days field it autopopulate the no of days
In interface level the value is showing in that field but it is not saving in rule input
Discussion posts and replies are publicly visible
Hi, sorry for the question, but did you save the value in the rule input in the correct place?
yes
To save the values to the rule input you need to perform a action try using a button or dynamic link to save the values to rule input.
As start date, end date and day values are auto populated then please set them in the CDT/ dictionary/ map at the start of your UI, don`t use default value function in the value. Whenever there is a change in the start date or end date recalculate the difference and store it in the day.
Only no of days needs to be auto populate after user selecting the start date and end date
then in saveinto set the value of differnece in case of whenever user set value in any of the date field.
Apply the below logic on your end date it will directly save the number of days to your rule input.
a!dateField( label: "End Date", value: ri!date, saveInto: { ri!date, a!save( ri!days, tointeger(tointervalds(save!value) -tointervalds(today()))/*today is your start date*/ ) } )
I was using a grid field In that the value is not saving
share some reference for your code it should work.
a!integerField( value: ( if( a!isNullOrEmpty( ri!RMS_AddResourceModelContractPricing.enddate ), {}, ( tointeger( tointervalds( ri!RMS_AddResourceModelContractPricing.enddate) - tointervalds(ri!RMS_AddResourceModelContractPricing.startdate ) ) ) ) ), saveInto: fv!item.demandhours ),
This code for no.of days grid field