Hello,
in the attached file I made a 1 to many relationship between (News) and (NewsInDetails) also 1 to many with (NewsInDetails) and (Language) but I don't know how to implement this in the save button to create/edit.
How I can achieve that please?
Hi
I have Updated your Oml with both the Arabic and English language solution
Now both will be saved in your detail Entity with language identifier
however it was not pretty clear to understand , so I have to check everything so it took some long time to figure it out
Here I am attaching Oml for you with the solution to save the data to your detail entity
I hope this will help
Also I have made changes to your List page to show proper records in a single row
Sample
Best Regards
Tousif Khan
Hi Mohamed,
What exactly don't you know how to achieve? In SaveOnClick, you call the CreateOrUpdate action (which you should really rename, it's very unclear what gets created or updated!). However, the NewsId output parameter I would expect is actually specified as an input parameter, so in SaveOnClick there's no way of knowing the Id!
So first fix that bug, then use the output NewsId to create both the English(?) and Arabic NewsInDetails records using the NewsId that's returned. (Also, why is it called "NewsInDetails", not just "NewsDetails"?)
Hi Kilian,
Sorry for misleading you the CreateOrUpdate is a server action to save the data using the 4 entities (I just didn't know what to call it when using it in the save action)
Now when I include CreateOrUpdateDetailsInNews Server Action in the shown image it leads to errors which I can't fix it.
I had to called it NewsInDetails instead of NewsDetails as service studio changes it automatically to NewsDetails2.
If you want to support only two languages you can have two field (One for each language). Of course in terms of scability it's better like you did.
The oml from @Tousif Khan have what you need. Anyway if you did your code like that you should separate screen, tables and Business Logic.
- CS module for Database and CRUD action
- BL module for action to save in this two tables
- FrontEnd module
Regards