25
Views
6
Comments
Need to implement the removal of record from Entity

I  need help in removing  a specific id  based on location column in outsystem

1.The button shall be visible only, if  same id has at least 2 different locations.

2.Record should be deleted for specific location for that id not both the records.


Consider for example i have  2 Entities , where id and name comes from Cell entity and rest of the  columns referring to id and name has locations,racks in another table called Inventory etc.


Cell.CellId  Cell.CellName  Inventory.location Inventory.Rack

1                       abc                             4                                                 loc4

1                       abc                              3                                                loc3


Here from this example, Loc4 has same cellid and cellName like the same for  Loc3.

 i want to delete location 4 record alone. in my case,both records are getting deleted. I need to delete cell ID for specific loc4.  Is it  possible?


Please suggest me how to do it outsystem, as i am very new to this platform .Please give me how to  proceed

Rank: #301

Hi Swethasree,

If possible, could you please share the OML to look into the issue?

Thanks & Kind Regards,

Sachin


As per the snapshot  Inventory is the entity which has ID and CellLineID (where  ID  is inventory  ID and CellLineID is  CellLine Entity ) and other columns with LOT,NumberofVials,Box,Rack  etc...

1. Here the condition i want to be as -record should be deleted based on the  Box column .

Example :  

Inventory ID  CellLine.ID  Inventory.location             Inventory.Rack

1                       abc                             4                                                 loc4

1                       abc                              3                                                loc3


If i delete the  location 4 ,only  record needs to be deleted for loc4 but not to be deleted from the  loc3 .(BAsically each InventoryId has multiple locations ,if we delete one  location ,the Inventory ID need to be deleted for that particulat  location)

is it  possible can we delete based on the  location.

Screenshotinventory.PNG

Rank: #151

Hi Swethasree,

A possible solution for your case is to create a third table where you will store

Cell.CellId and Inventory.Id, example:

I created an example for you to try to understand how the delete will be done.


see the attached .OML.

Hope this helps.

Regards.

Example.oml

As per the snapshot  Inventory is the entity which has ID and CellLineID (where  ID  is inventory  ID and CellLineID is  CellLine Entity ) and other columns with LOT,NumberofVials,Box,Rack  etc...

1. Here the condition i want to be as -record should be deleted based on the  Box column .

Example :  

Inventory ID  CellLine.ID  Inventory.location             Inventory.Rack

1                       abc                             4                                                 loc4

1                       abc                              3                                                loc3


If i delete the  location 4 ,only  record needs to be deleted for loc4 but not to be deleted from the  loc3 .(BAsically each InventoryId has multiple locations ,if we delete one  location ,the Inventory ID need to be deleted for that particulat  location)

is it  possible can we delete based on the  location.

Screenshotinventory.PNG

Rank: #288

Hi Swethasree

If the key of the Cell Entity is CellId I don't think you can create 2 same Id records.

So I assume you got another field for the key. You can use an Aggregate  filter by CellId and location,
Then delete the selected record. If it has multiple records, Then use a loop

Kind Regard


Hi @Swethasree ,

Please make sure you mark a solution if there is any from the suggestions.

Thank you and kind regards,

Chris