seems I almost there, the problem I found is that the value i supposed to be saved for a!query is not the standard form. What should be the correct one?
a!save(target:ri!userrole.USER_ID, value:cast(type!Integer, a!queryEntity( entity:cons!KONE_Development_userrole_Constant, fetchTotalCount:true, query:a!query( selection: a!querySelection( columns: { a!queryColumn( field: "USER_ID" ) } ), filter:a!queryFilter( field:"NAME",operator:"=", value:ri!userinputsheet.kone_user_name, applyWhen:not(isnull(ri!userinputsheet.KONE_user_name)) ), pagingInfo:a!pagingInfo( startIndex: 1, batchSize: 50 ) ) ).data.USER_ID) ),
Discussion posts and replies are publicly visible
Why are you doing this in this spot, exactly? And how (and when) does the value of `ri!userinputsheet.kone_user_name` get set?
what do you mean, I did in the rule input
Your query is attempting to look up the user ID of the database entry(s) matching `ri!userinputsheet.kone_user_name`. I'm trying to discern what your use case is exactly, and that includes how the value of this is initialized.
I solved this already, I have another question not sure whether you have been faced before, Whenever i want to update the row value of database, i enlist them out in editable grid, however, if i want just update one column of value but have to resave others column of value again, or just this column value get updated, others column all change to be null.
you either have to re-save all columns along with the changed one (making sure to correctly populate them in your CDT first), or if your need is strong enough, you can instead create a separate CDT that contains only the columns for the table Primary Key ID, and the column(s) you want to change. I advise only going with this solution when the use for it in your system will be very common, as it creates extra setup and maintenance hassles.