cancel
Showing results for 
Search instead for 
Did you mean: 

Error when posting AR Invoice with serial

Former Member
0 Kudos

Hi experts, just want to ask what is the problem when posting AR Invoice with serial number. The error is "Internal error (-5002) occurred [الرسالة 131-183]"

Here's my code :


                            If Not oSerial Is Nothing Then

                                oSerial.DefaultView.RowFilter = "product_reference_code = '" & oDrView("product_reference_code") & "' " 'AND site_reference = '" & oDrView("site_reference") & "' "

                                For Each oDrSerial As DataRowView In oSerial.DefaultView

                                    Try

                                        .Lines.SerialNumbers.Quantity = 1

                                        .Lines.SerialNumbers.InternalSerialNumber = oDrSerial("serial_no")

                                        .Lines.SerialNumbers.Add()

                                    Catch ex As Exception

                                    End Try

                                Next

                            End If

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Bryan,

Have you try to debug it , which line is causing problem.

With serial numbers you don't have to set the qty.

other fields that need to be set are :

for (int count = 0 ; count < totalcount; count ++)

{

     if (count > 0)

          .Lines.SerialNumbers.Add();

     .Lines.SerialNumbers.SystemSerialNumber = SysSerialNum;

     .Lines.SerialNumbers.ManufacturingSerialNumber = ManufacturingNum;

     .Lines.SerialNumbers.InternalSerialNumber = internalserialnumber;

    

     Count++ ;

}

Hope it will help.

Regards

AdKerremans
Active Contributor
0 Kudos

Hi Byan,

When you start with serials, there is already one line present.

So if you only have one serial you don't use the .Add command

When addin the second line you start with the .Add command.

in short, just remove the line with .Lines.SerialNumbers.Add() 

Regards

Ad

Former Member
0 Kudos

Dear Friend,

               Try to check , did  you give the proper Warehouse ,Check the Account Code for that item group if that time managed by Item Group . Check the Account code for that Warehouse if that item managed by Warehouse.

Regards,

Sakthivel K