Populate dropdowns when reviewing record

Populate dropdowns when reviewing record

  

I am having a problem.  I have a form that uses dropdowns to select items.  Everything saves fine.  The issue is when I try to open the form again the dropdowns do not populate with the attribute assigned.

I have a customer detail screen.  On the screen it allows the user to create a new work order.  When this is done the work order form is opened with the record ID = Nullidentifier().  The user fills out the form and saves it to local storage.  The user has the option of creating a new work order or return to the customer detail screen where the user can view previous work order in a list.  I have set the left swipe of the list to allow the user to go back to that specific record to modify it if needed.  The issue is the dropdowns do not populate with the correct items. 

Do I have to set input variables to set each dropdown to show correctly?


I have included the oml


Thanks

Andy

Hello Andrew

I did not have time yet to see your .oml, but I think you should filter the aggregate that feeds the form with the form variable.

Tell me if  that works. I will be able to look at the .oml later today and check if this is the problem


Regards,

Ângelo

I have been.  The only thing that show up correctly are the cases

The .oml you provided references a lot of other application and modules that I do not use. Could you provide a simpler .oml, perhaps with only the screens you are having problems with?

Thanks

Really new to OutSystems... but having a look at the .oml, it looks like your ListItem1 On Click is pointing to MainFlow\Work ... which doesn't exist.  What if you set On Click to MainFlow\WorkB2 and then set the params?

Thanks.  I am aware of that.  I am trying to get the swipe to work but i should change that too

Here is a smaller oml

Hi Andrew,

The Variable properties for your Dropdowns are local variables that haven't been initialized, and as such will be empty (or have the first value from the dropdown list), but the dropdown lists themselves should have the correct elements, am I right?

You will notice that the Cases input is the only one whose Variable property is set to an attribute from the GetLocalOutTransactionBy aggregate... that's why it is showing the correct value.

The solution to your problem is, depending on why you are using those local variables:

  1. set all Variable properties from your Dropdowns to the corresponding attributes on the GetLocalOutTransactionBy.Current.LocalOut_Transactions; or
  2. Setup a handler for the GetLocalOutTransactionBy OnAfterFetch event, where you initialise all local variables that you are using on the Variable properties with values from that aggregate.

I'd typically recommend the 1st option.

Hope this helps!

Im using the local variables to perform a cascading lookup.  Is there a better way to do that? 

I guess not... Aggregates don't seem to be able to use the outputs of other Aggregates on screen as part of their filtering, so you're left with the second option:

  1. Setup a handler for the GetLocalOutTransactionBy OnAfterFetch event, where you initialise all local variables that you are using on the Variable properties with values from that aggregate.