Hi! I´m trying to reference a related record action (update of fields, which has another interface and works properly) in another interface. I´m using the "record action field" component in the interface menu, but some errors appeared:
First of all, I tried to emulate the same code that I had in my related record action, but it doesnt recognize the rv!identifier and the following error appears ("could not find variable rv!identifier")
That´s why I skipped that part and tried to put only the rule, being my code the following one:
In this case, the related record action appears correctly in the interface. But the following error appears when I click in the button ("An error occurred while applying the context for the CPF Maestro Pedidos related action [identifier=235]. Details: The record data does not exist, has been deleted, or you do not have sufficient privileges to access it.")
On the other hand my related action is:
I´m wondering where is the problem, and if someone could help me to understand this error. Thank you so much!
Discussion posts and replies are publicly visible
The identifier in the recordActionItem must be the primary key value of that record.
Thank you so much Stefan! I tried this way but the same error appears. Am I putting it in a correct way, or should I use another expression?
Thanks again for your time!
Hi , You cannot use rv!identifier in your SAIL interface (in record action component) , you can use that in your record , specifically in record actions tab. If you are calling record action field in interface , you need to pass the primary key as context in your identifier. In interface ,for related action pass your primary key . You can store the data in a variable and then pass
EX: action:recordtypename.actions.relatedactionname,
identifier: local!dataset[recordname.primarykey]
I don't understand what you are doing.
By "primary key value", I mean the actual value like 1, 2 or 42! Not the name of the field. Appian does NOT apply any magic in the background. You need to pass the value.
The documentation says for the identifier field:
Individual record ID within the record type. Only required for related actions. - For record types that use a database as a data source, record ID is the primary key in the data store entity. - For record types that use a process as the data source, record ID is the ID for the process. - For record types that use a web service as the data source, record ID is the value returned to the ID field of the DataSubset produced by the record's source expression.
docs.appian.com/.../Record_Action_Item_Component.html
Hi carlosp5114,The recordActionItem works in a way that you just need to pass the id of the data you need to act on. So your use case should look like
recordActionItem( record:recordtype!(this is correct in your case), identifier:ri!id (here you just need to pass the primary key of the data set you need to perform the action on for eg-1 or 2 or 4, etc)
Thanks! I tried this way, using my primary key of the record (idPedido) but in this case no related action appeared
Hi carlosp5114,
The above screenshot shows no values in the ri!record. Related action will appear only if the identifier has the proper record primary key value and the related action visibility of the corresponding record is true()
I tried in the site and it works properly! Thank you so much