Neha,
You need to understand how INDEXES work.
First stop: https://success.outsystems.com/Documentation/10/Reference/Data/Database_Reference/Database_Indexes
Second stop: https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Data_Modeling/Create_an_Entity_Index
Basically, an index helps database be more efficient (and fast) during search. In OutSystems, we also use them to define that an attribute, or a group of attributes can not appear repeated in the entity.
Example. Take the beloow entity.
MyEntity
id - Name - Age
1 - Joao - 21
2 - Maria - 22
a) Index UNIQUE for Column Name
If I try to insert (Pedro, 21) -> Ok
If I try to insert (Maria, 30) -> FAIL, because there is already a record (id 2) in the database with name Maria
b) Index UNIQUE for columns Name AND Age (in the same index)
if I try to insert (Joao, 25) -> Ok, because there is NO record with both values already in the table
If I try to insert (Pedro, 21) -> Ok, because there is NO record with both values already in the table
If I try to insert (Joao, 21) -> Fail, because there is a record (id 1) with both values.
The error message you are receiving is this:
Cannot insert duplicate key row in object 'dbo.OSUSR_CF9_FIXEDCOST1' with unique index 'OSIDX_OSUSR_CF9_FIXEDCOST1_4YEAR_10RECORDDATE'. The duplicate key value is (2018, ).
So, you have an INDEX in your entoty, that is marked as UNIQUE (will not allow records with all the values in the attributes of the index to appear repeated), and it is saying to you that you are trying to insert a record with values for its attributes (the attributes in the index) that already exist in the entity.
So, the solution is:
1. If repeated values for this "group" of fields should be allowed, remove the UNIQUE of the index.
2. If repeated values for this "group" of fields are not allowed, fix your logic to guarantee you do not try to insert repeated values.
Cheers.