cancel
Showing results for 
Search instead for 
Did you mean: 

Production orders fails due to cast conversion error

Former Member
0 Kudos

Hi,

i have an issue in creation an production order from stock transfer request.

B1 version 9.0 PL06

here my code :

Accepted Solutions (1)

Accepted Solutions (1)

Johan_H
Active Contributor
0 Kudos

Hi Vincent,

Does the error occur on the double.Parse line ?

Regards,

Johan

Former Member
0 Kudos

hi, Johan

Thanks for your help

the message is not on the double.parse line

i have no error on compilation but only during execution.

herewith the whole message

System.InvalidCastException : Unable to cast COM object of type 'System.__ComObjet' to interface type 'SAPbouiCOM.Matrix'. This operation failed because the QueryInterface call on the COM component for the interface with IDD '{DD7804DC-811B-4829-8E87-2F

thanks for your support

Vincent

edy_simon
Active Contributor
0 Kudos

Hi Vincent,

Not sure about swissaddon framework.

But your error message is coming from somewhere in your code when you reference your matrix object.

Maybe you are missing the ".Specific" method ?

Regards
Edy

Johan_H
Active Contributor
0 Kudos

Hi Vincent,

When you debug this code, does it throw the error on a certain line, or when you call oPo.Add ?

Regards,

Johan

Former Member
0 Kudos

please double check the unique ids you are using in getmatrix, one of them is not a matrix.

first of all identify the line in which the error occurs, debug your code.

then check if the following are really matrixes:

Matrix.GetFromUID(pVal.Form, "3") -> is really "3" a matrix?  no, it's an edittext ( bp code )

Matrix.GetFromUID(pVal.Form, "1250000072") -> is this? no, it's an edittext ( docduedate )

Matrix.GetFromUID(pVal.Form, "23") -> yes, this item is a matrix

double check those unique identifiers, always verify item type.

btw which type does method "Matrix.GetFromUID" returns? i think it should be a matrix. that's your problem.

i don't know swiss framework, but i believe you are using the wrong method to get an item value from a form.

Former Member
0 Kudos

Hi Christian

you are correct.

i have changed the Matrix to TextEdit and corrected the rest.

thanks a lot.

Answers (0)