Populate drop-down from the response of REST call

0
On Product_NewEdit page, while creating a new product. I want to list all the available promotions in the dropdown out of which user can select one. I am getting list of promotions via REST call from a legacy module. As I am not using the default ‘Create’ button, I have created product object and passed it as page parameter for Product_NewEdit page.   After making the rest call for available promotions, how can I set the association with the product so that I can use it with reference selector on Product_NewEdit. Domain model:   Microflow for create (What should be the step for the activity to list all available promotions on page): Currently, I am getting a blank drop-down for promotions on my page.   Product_NewEdit page:   Or some other change is required in the domain model itself?
asked
2 answers
3

To me it looks like you’re trying to select a promotion from a list in memory – I cannot tell what your service does exactly without seeing the configuration but I assume it doesn’t commit. 

If my assumption above is correct, in order to display the promotions you have a few options:

  1. Commit them 
  2. Add another association of Many promotions to One product and which you assign in that microflow (i.e. assign those promotions to the object) then display a grid/list of the associated (not xpath) promotions for the user to pick from 
  3. Sync the objects to a different entity of your own unique ID and manage which ones are active separately

Hope this helps

answered
5

If you have the reference selector on the page, no extra microflow actions are required. You only need to make sure that your user has read/write access to the association and at least read access on the promotion entity. And you need to make sure that you have promotion objects in your database.

answered