{{indexmenu_n>1}} ====== ACTION Node ====== \\ Node where the actions to be performed will be displayed in the events defined in our application.\\ \\ The name of the action defines what it will perform. \\ ===== SETVAL ===== \\ It consists of assigning a value to a property of the object. You can use macros in the value attribute. \\ \\ ^Attribute ^Description ^ | **name** | Name of the action to execute | | **field** | Field to be updated | | **value** | Value that will be assigned to the field | ===== RUNSCRIPT ===== \\ Execution of XOneScript code within our application. In this case, it does not have any attributes, but it does have a node where the script will be executed, as shown in the example below.\\ \\ \\ ===== SETFLDVAL ===== \\ To take a value from a field in the father collection and put it in a field of the daughter collection. Used in the contents.\\ \\ Although this action keeps working, currently is in disuse, since practically everything is made by script. The instruction to assign/ get a value from your "father" collection is:\\ 1.- In vbscript: this("NOMBRE")=this.OwnerCollection.ownerobject("MAP_DELPADRE") 2.- In javascript: self.NOMBRE=self.getOwnerCollection().getOwnerObject().MAP_DELPADRE; \\ ^Attribute ^Description ^ | **name** | Name of the action to execute | | **targetfld** | Field to be updated with the father's field | | **sourcefld** | Field of the father collection that will give value to the field of this collection | ===== MAPVAL ===== \\ We look for a value in another collection and we bring the value of some field. \\ \\ ^Attribute ^Description ^ | **name** | Name of the action to execute | | **field** | Field to be updated | | **targetfld** | Name of the field that has the value that will be assigned to the **field** field | | **coll** | Collection where the search of the field that will have the required value is going to be made | | **mapfld** | Field of the collection defined in the **coll** attribute, that is the first key of it | | **mapvalue** | Value of the first key field to rescue the log searched | ===== EXECUTESQL ===== \\ To execute an SQL sentence, Insert, Update or Delete. It does not make sense to execute a Select, because the action does not return any value. \\ Very used in header collections, when you are deleting a record, it deletes all its associated lines. \\ \\ \\ ^Attribute ^Description ^ | **name** | Name of the action to execute. | | **sql** | SQL sentence that you want to execute. Only is valid the Insert, Update or Delete execution. | ===== LINK ===== \\ To update the link field of a detail collection with the ID of the header. \\ \\ Used EXCLUSIVELY in the INSERT node of a header collection. To link the detail lines of the CONTENTS collection when the header and details are being registered at the same time, because until the header is not recorded, the detail lines do not know what the ID of their father is. Currently, although this method obviously continues to work automatically to update the IDENLACE with the header in the details (contents, subgrid or whatever you want to call it ...) once the header is recorded, this node is in disuse and practically everything is controled by script and it is the programmer who makes the data association, header-details. \\ \\ However, the framework internally continues trying to find a link field between the contents and the collection "header" where they are included in. To avoid this behavior, in the contents collection, at the COLL level, you must specify the **check-owner="false"** and **dependent="false"** attributes.\\ \\ ^Attribute ^Description ^ | **name** | Name of the action to execute | | **coll** | Collection searched to update the link field with this Father collection | | **field** | Name of the field of the collection with the name that is defined in the ** coll ** attribute and that is the link with this collection Father | | **value** | Value assigned to the link field between the Father collection and the daughter collection | ====== NODO BEFOREACTION ====== \\ Node where the actions to be performed will be displayed in the events defined in our application, being able to execute each and every one of the types of actions available in the ** action node **. \\ However, as an important point to keep in mind, this action is only valid for the [[wiki:2.-desarrollo-app:2.3.-codigo:c.-eventos:3.-insert:start| Insert ]] event, and it is used to validate fields, in case it gives error, the object won´t be saved and the user is forced to insert a value for the validated field. .