I was working to add a row in an editable grid that uses record types. I kept getting errors with indexing when I tried to use append in the add row link. I found a solution by saving a value into the list as shown:
This seems hacky, but it works. Does anyone know of an easier or better way to do this?
Discussion posts and replies are publicly visible
I never had any issues with append(). Maybe you want to get into more detail about what you observed using append().
), addRowlink: a!dynamicLink( label: "Add Group", value:'recordType!{c2131273-7291-4303-b11b-4d502c0de3e7}Component Function'('recordType!{c2131273-7291-4303-b11b-4d502c0de3e7}Component Function.fields.{18b9f077-d7fb-4d68-8b32-4575923a26c0}modelComponentFunctionId':-1), saveInto: { a!save( ri!componentFunction, append(ri!componentFunction,save!value) ) } ),
append should work the same way as a normal CDT type variable just make sure the value you are trying to append is created correctly using recordType!ABC( id:1)
Pass an empty record by using parentheses
addRowLink: a!dynamicLink( label: "Add row", value: recordType!Record_Name(), /* Pass an object using a parentheses */ saveInto: a!save( ri!input, append(ri!input, save!value) )