on 2021 Jun 07 7:37 AM
Hello everyone,
I am using the ECTR API to find documents in ECTR that are linked to a material master. To do this, I am using the following code in Visual Studio:
Dim applType As String = "SLW"
Dim config As PlmConnectorConfig = New PlmConnectorConfig(applType)
config.ApiLevel = 2
Dim connector As IPlmConnector = Nothing
connector = PlmConnectorFactory.GetPlmConnector(config)
Dim mat As PlmMaterialImpl = New PlmMaterialImpl()
mat.Number = "000000000000703904"
Dim MaterialListe As PlmMaterialList = New PlmMaterialList()
MaterialListe = connector.MaterialFind(mat)
Unfortunately, when I run the connector.MaterialFind(mat) command in ECTR, I get the following error message:

Can anyone help me to fix this error?
Thanks a lot!
Request clarification before answering.
Just use the .ExtNumber instead of .Number -->
....
Dim mat As PlmMaterialImpl = New PlmMaterialImpl()
mat.ExtNumber = "000000000000703904"
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
thank you very much for your time! I will try the method materialGetData.
With kind regards
A. Huettinger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
it looks like there is a bug in the ECTR coding behind the connector method MaterialFind. I was able to reproduce the error using current development version, so unfortunately the bug is still there. We have to fix it in upcoming ECTR versions.
BTW, your example code looks like you already know the full material number. If this is true (in real project and not only in this example), then you can use another connector method to get material data - materialGetData. If material with the given number exists, then you will get material details for the number, if not, you will get null as a result.
With Kind Regards,
Waldemar Tribus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.