How can I insert a value into database?

Hello I would like to know how to insert data into a database, my database is called "oapedidos",

I have a constant created to perform the queries,

and a CDT.

I have an interface

in which I simply write the name of an order and its status, and a button to register that data "ALTA". I do not know how it should be done, I have seen in the forum that it is with a! WriteToDataStoreEntity (
dataStoreEntity: cons! DATA_STORE_ENTITY,
valueToStore: ri! rule_input) but I don't know how it works,

Do I have to create a rule input in the interface whose type is CDT??

the code of my interface is:

{
  a!sectionLayout(
    label: "Alta pedido",
    contents: {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!textField(
                label: "Referencia del pedido",
                labelPosition: "ABOVE",
                saveInto: ri!oapedidos.nombrepedido,
                refreshAfter: "UNFOCUS",
                validations: {}
              )
            }
          ),
          a!columnLayout(
            contents: {
              a!textField(
                label: "Estado del pedido",
                labelPosition: "ABOVE",
                saveInto: ri!oapedidos.estadopedido,
                refreshAfter: "UNFOCUS",
                validations: {}
              )
            }
          )
        }
      )
    }
  ),
  a!buttonArrayLayout(
    buttons: {
      a!buttonWidget(
        label: "Alta",
        saveInto: a!writeToDataStoreEntity(
          dataStoreEntity: cons!GP_Pedido_Entity,
          valueToStore: ri!oapedidos),
        style: "NORMAL"
      )
    },
    align: "START"
  )
}

By the way how can I make refreshAfter: "UNFOCUS" be when I press the "ALTA" button?

forgive my ignorance I'm still learning,

greetings and thanks

  Discussion posts and replies are publicly visible