Why current is not the real current of the list?

Hi, im using Service Studio 11 and traditional web

i have a list of products, and i want to add the quantity of current product.

but dont matter what row i click, its allways the last row add +1


Im using this logic:


I really dont understand, why the current is not the real current, but allway the last row... 

The list is a variable type list

thanks!

Hi Arcturo,

Why are you manipulating the list? What you try to achieve? Manipulating the list does not reflect that change on the database. 

I would refactor this code as follows:

  1. Add BasketId as input parameter to ChangeQty, and fill it with BasketList.Current.Id
  2. In ChangQty retrieve the record either with an aggregate with filter on the BasketId or with a GetBasket entity action.
  3. Change and save the retrieve record
  4. Do refresh of the aggregate that populates the table records and do an ajax refresh of the table records.

Regards,

Daniel

Hi Arcturo,

Adding on to Daniel's note, I just want to include a sample app based on your use-case

Please refer the attached .oml file

Hope this helps you..


Regards,

Benjith Sam

Daniël Kuhlmann wrote:

Hi Arcturo,

Why are you manipulating the list? What you try to achieve? Manipulating the list does not reflect that change on the database. 

I would refactor this code as follows:

  1. Add BasketId as input parameter to ChangeQty, and fill it with BasketList.Current.Id
  2. In ChangQty retrieve the record either with an aggregate with filter on the BasketId or with a GetBasket entity action.
  3. Change and save the retrieve record
  4. Do refresh of the aggregate that populates the table records and do an ajax refresh of the table records.

Regards,

Daniel

 Hi Daniel, thanks for helping

im manipulating the list because i dont want to save the list on data base. i want that if the end user refresh the page, the list become empty... So, i can manipulate the list, or the table.... i tried both and didnt work well...

 

i cant use the ID because its always 0... its no persisted on database

Benjith Sam wrote:

Hi Arcturo,

Adding on to Daniel's note, I just want to include a sample app based on your use-case

Please refer the attached .oml file

Hope this helps you..


Regards,

Benjith Sam

 

 Hi Benjith!

Thanks for helping

but... i don't see great difference between your logic and mine... you manipulated the tablelist... and i the variablelist, wich is the source of the tablelist...

I'll attach my oml file if anyone want to look

Hi Arcturo,

I also tried with the Local List variable and it's working as expected.... do the below changes in the Ajax node (specify the table row number)

See the attached .oml solution file (ListTask_ListVar Screen)

Hope this helps you!


Regards,

Benjith Sam