Skip to main content
July 9, 2023
Question

Error When referencing a related record action into an interface

  • July 9, 2023
  • 8 replies
  • 1 view

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!

    8 replies

    stefanhelzle0001
    Brainy
    July 9, 2023

    The identifier in the recordActionItem must be the primary key value of that record.

    July 9, 2023

    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!

    shikhat
    July 10, 2023

    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]

    July 10, 2023

    Hi [mention:f1950f4100b949739ed29e1582abf1f2:e9ed411860ed4f2ba0265705b8793d05],

    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)

    July 10, 2023

    Thanks! I tried this way, using my primary key of the record (idPedido) but in this case no related action appeared

    jonesprakashs0001
    July 10, 2023

    Hi [mention:f1950f4100b949739ed29e1582abf1f2:e9ed411860ed4f2ba0265705b8793d05],

    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()