Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 950

Re: Add a line in a udo form when a user pressed Tab button

$
0
0

Hi Angelos,

this problem occurs because you have to assign the new PK of the record.

eg.

If you have one UDO with MD and MD Lines the connection between them base on MD.Code = MDLines.Code. The uniqueness of the line based on the incremental field LineId.

In your case, if you have already one line in the MD Lines table, with the way that you are trying to make the update the system assigns to the field LineId the value of the previous record (LineId=1) and this gets you back this errorcode.

You can solve it by displaying the LineId in the column 0 of the matrix and in Tab press event, add a new row, clear the data, and set the new value that will have to have the field LineId

 

A sample below        

Matrix.FlushToDataSource();

for(int i=0;i<Matrix.VisualRowCount;i++)

{

Form.DataSources.DBDataSources.Item("TABLE_NAME").SetValue("LineId",i,i.ToString());

}

Matrix.LoadFromDataSource();


Viewing all articles
Browse latest Browse all 950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>