16
Views
10
Comments
Solved
How Can Edit and delete when relationship between two entity Many to Many
Question
Application Type
Reactive

How Can Edit and delete when relationship between two entity Many to Many

 when i click edit the screen for details open without drop down no value how can fixed it 

and how can delete any item when i click delete how can do that

as in demo attachment

Deleteandedit.oml

mvp_badge
MVP
Rank: #177
Solution

Hello Andrew,

I'm not entirely sure what you are asking here, but I will take a guess and maybe you can elaborate?

  • Delete items with Many to Many
    • In your demo, you have Country, Holiday, and HolidayCountries
    • Your Delete Rule in HolidayCountries is set to Protect
    • In this case, you can use SQL (in a Server Action, not a Client Action) to delete the HolidayCountries, e.g.:
      DELETE FROM {HolidayCountry} WHERE {HolidayCountry}.[HolidayId] = @HolidayId
    • Then you can use the built in DeleteHoliday action on the Holiday
    • (Check the Learning pages to learn more about SQL and databases)
  • Drop Down Tags not Opening
    • When I use your demo, if I click on Search for Country I get a drop down. Can you explain what you are seeing vs what you are expecting?


Rank: #1400

when i need edit Holiday i click on the button for edit or click on name of holiday Gives me a screen to edit without the name of the country i need all details show on screen for edit 

1.JPG

mvp_badge
MVP
Rank: #177

Ah, I understand. You need to populate the SelectedItemsList on DropdownTags. You can create an aggregate that queries countries by holiday id, and then use that list as your SelectedItemsList

Rank: #1119
Solution

Hi Andrew,


Made some changes to the oml initial list, as well as to your logic. It is not perfect as it is, should be improved the edit logic, but I believe it is what you need.


Regards,

DropdwontageModifiedv2.oml

Rank: #1400

hello i found problem when i need edit then enter screen for edit the country in dropdown tag selected empty i need show this value of selected country

edit.JPG

Rank: #1119

Hi,

You are mentioning that the countries list it is empty when editing an element of list of the main screen?

Rank: #1119

Hi Andrew,

I've tested the app once again. When you're editing, the countries previously selected and associated are shown as expected. Can you please better explain the problem you found?

Regards,

mvp_badge
MVP
Rank: #50
Solution

Hi Andrew,

I updated the delete action please see the attached oml, please see if you are looking for something like this? If your requirement is different please let me know .



Regards,

-PJ-

Deleteandedit.oml

mvp_badge
MVP
Rank: #177
Solution

Hello Andrew,

I'm not entirely sure what you are asking here, but I will take a guess and maybe you can elaborate?

  • Delete items with Many to Many
    • In your demo, you have Country, Holiday, and HolidayCountries
    • Your Delete Rule in HolidayCountries is set to Protect
    • In this case, you can use SQL (in a Server Action, not a Client Action) to delete the HolidayCountries, e.g.:
      DELETE FROM {HolidayCountry} WHERE {HolidayCountry}.[HolidayId] = @HolidayId
    • Then you can use the built in DeleteHoliday action on the Holiday
    • (Check the Learning pages to learn more about SQL and databases)
  • Drop Down Tags not Opening
    • When I use your demo, if I click on Search for Country I get a drop down. Can you explain what you are seeing vs what you are expecting?


Rank: #1400

when i need edit Holiday i click on the button for edit or click on name of holiday Gives me a screen to edit without the name of the country i need all details show on screen for edit 

1.JPG

mvp_badge
MVP
Rank: #177

Ah, I understand. You need to populate the SelectedItemsList on DropdownTags. You can create an aggregate that queries countries by holiday id, and then use that list as your SelectedItemsList

mvp_badge
MVP
Rank: #50
Solution

Hi Andrew,

I updated the delete action please see the attached oml, please see if you are looking for something like this? If your requirement is different please let me know .



Regards,

-PJ-

Deleteandedit.oml

mvp_badge
MVP
Rank: #50

Hi Andrew,

I did some changes to populate selected countries in Edit as well , please see the attached oml.


Regards,

-PJ-

Deleteandedit.oml

Rank: #1119
Solution

Hi Andrew,


Made some changes to the oml initial list, as well as to your logic. It is not perfect as it is, should be improved the edit logic, but I believe it is what you need.


Regards,

DropdwontageModifiedv2.oml

Rank: #1400

hello i found problem when i need edit then enter screen for edit the country in dropdown tag selected empty i need show this value of selected country

edit.JPG

Rank: #1119

Hi,

You are mentioning that the countries list it is empty when editing an element of list of the main screen?

Rank: #1119

Hi Andrew,

I've tested the app once again. When you're editing, the countries previously selected and associated are shown as expected. Can you please better explain the problem you found?

Regards,

Rank: #1400

thanks