Difference between webform and dataclass functions applied to entities

i have an entity function. i am calling it during the on select event of a data table. i see the function name appear in two places: one under “webform”, and one under the name of the data source which gets the entity from the selected row. what is the difference between these? the behavior seems to be the same.

Hello Mikey,

In fact, both have the same function that exists in the class Entity of Shipment. The difference between the first one and the second one is on datasources:

  • for the first one, the datasource “shipment” exists only in the webform where that function is called (this webform).
  • and for the second one, the dataource “shipment” is in the namespace “currentShipment” and it could be used in any webforms.

Best regards.

uhhhhh now i’m more confused.
in each case, “shipment” is the entity selected from an entity selection that was in a dataTable

You need to check the location where the datasource of the datatable’s selected element is created.
For example, this is a datatable, its datasource is “products” and it exists in the namespace called “namespace”.
The selected element of the datatable is the entity “product” and this datasource also exists in the same namespace.
If you have an entity datasource for the selected element and it is created in “this webform”, you will see something like this: (white background and a purple text color to indicate that the datasource is created only in the current webform)

is namespace portable between weforms? i thought every datasource in the catalog for a webform was local to that form.
so, in this case, isn’t product still local to the form, since it is the selected element of the datatable? i still have to create it in the catalog for the webform.

Yes, exactly @mikey , all datasources that are in Namespaces are shared in all webforms. On the other hand, datasources that are created in “this webform” are used only in the current webform.
So, in my example, the datasource product can be used not only in the current webform, but also in other webforms (because I created it in a namespace called “namespace”).

1 Like

this might deserve some special explanation in the docs, because it’s different.

1 Like