How to get back the rest API call from a fragment
My question is on the UI Designer.
I have a list of lines.
On each line, the user gives some values (categories).
From these values, I need to call a REST API to get the price of the benefit according to values. This cost
must be displayed in the line and send back to the server.
With the UI Designer, it is not possible to call a REST API per line, so I created a fragment. In the
fragment, I get the line in parameter, and I call the REST API when values change. The name of my rest
API variable is "cost";.
Question: how do I send back this "cost" to the parent form?
Cost is a REST API and cannot be exposed.
$data.line.cost = $data.cost;
"saveTheCost" is not used, not displayed).
Thank you for your return.
This is how I would be doing the same.
First you must have a collection. Your fragment will be placed inside this collection. Lets call the collection as formInput.myItems.
Now each row inside the fragment would be referred as $item
In the main page, if you check formInput.myItems , it should contain $item.cost with different cost values for each row.