Hi! I was trying to create a button in an user interface. This button should change de value of the field "recepción" (boolean) to "true", and save it into the record type ("CPF_Maestro_Pedidos).
With my configuration, I can pass the "true" value to the rule input (record) associated with the record type, but I´m doubting about which is the best way to save (overwrite) the value into the record. Also, I don´t know if I should create an action associated with the button or not.
Additionally, the interface is a record view interface.
Options I thought:
1) Use an expression inside the button code (like WriteRecords) to overwrite directly from here --> ¿how would be the structure?
2) Make a process model and use this interface as the start form and use write records component. The problem is that when I try to do that, an error appears (rank ---> data inputs). But the variable "recepcionado = true" is passed when I review the history of the execution.
Discussion posts and replies are publicly visible
Hi carlosp5114,
a!writeRecords( records: { recordType!RecordName( recordType!RecordName.fields.recepción: true ) } )
Refer the Write Record function in the documentation.
docs.appian.com/.../Write_Records_Smart_Service.html
I tried this way but problems appeared :(
Also, shouldn´t I use an a!save function?
I'm not sure what you're trying to do within that writeRecords call - if your record data is stored in your rule input, and you're previously saving the value of "true" into one of the record fields, AFAIK you would just do that a!save and then immediately follow it with a!writeRecord, where all you'd need to reference is your rule input.
saveInto: { a!save( ri!record[...], true() ), a!writeRecords( records: ri!record ) }