Can't create new many-to-many relationship entries

Hello,

I'm creating a website where I can monitoring the books that I borrowed.
The Entity Diagram is:


The idea is, I have a book with all of the information about itself (Title, Author, etc and Owner). The same book can be borrowed to difference users (not at the same time); different users can received and borrowed several books.

To have all the information stored and organized, I created the 'BorrowingReturning' entity (an many-to-many relationship). It's like a contract between two users. Which book is been borrowed? To whom? From whom? When?.

I created this page:



where I put the information about the book (Title, Author, etc) and the user's email to whom I am borrowing the book.


When I press 'Save', that error in the image appears.


I tried with CreateOrUpdate action and doesn't occur the error, but the 'BorrowingReceiving' entity has always only on entry (id = 0) and keeps updating that entry and not creating new values.

I tried many alternatives (including putting the id with null value at the assign) but none worked.

I can't understand why I it can't create new values. The information is always different (the BookId is always a new value).

Can you guys helping me? What I am doing wrong? Maybe is something in the core module.

Solution

Hi,

Can you make sure to set the auto number property to yes in BorrowingReturning

Regards.

Solution

Prasad Rao wrote:

Hi,

Can you make sure to set the auto number property to yes in BorrowingReturning

Regards.

 

 Thank you so much! Never thought that was the case.
Already corrected and it's working :)

Hi Afonso,


Please, can you mark Prasad answer as solution?

This can help in future similar problems that our colleges can found. ;)

Thanks!


Best regards,

Ricardo M Pereira