16
Views
4
Comments
Solved
Error - Inserting data into the database

Hello again,

i have two dropdown boxes:

I changed it to when I selected a user, that user would be unavailable in the other dropdown box. I used two variables, customer actions and filters in the database.

Now, when I try to insert some value in the database it gives me the following error:

Before making these changes, the error did not occur.

Now I can't insert or change the data.


Thanks.

Rank: #70
Solution

Hi SpiritFox,


The record from entity {Troca} you are trying to create has at least one attribute of the type User Identifier which is marked as mandatory and has the Delete Rule to Protect. When you have this, the database will prevent you from filling these fields to Null and that's why you have the mistake.


If I recall your example on a previous post, you have them binded to a variable Dropdown_envia.


You can bind it directly to the attribute UserId_Envia from Trocas, in this way when you send the record to the database the value goes filled and the exception is not thrown.



You should then apply it to the dropdown below to variable Trocas.UserId_Recebe.

OML with the aforementioned fixes in attachment.


Regards,
João

TrocasProdutosv1.1.5UserIdReferenceFixed.oml

Rank: #70

Hi SpiritFox,


Make sure that your second dropdown "Para:" is binded to GetTrocaById.List.Current.Trocas.UserId_Recebe instead of UserId_Envia.


Regards,

João