PythonCOM syntax question

Greg Pierce greg at turtleprod.com
Mon Apr 29 15:42:31 EDT 2002


I'm trying to interact with the Navision Axapta ERP package via it's COM connector...and I'm having trouble with particular types of calls.  I'm hoping someone can help me if there's some syntax problem I'm having.

I'm able to create the Axapta COM objects and can call certain methods on them, but not others.  I'm no COM expert, but there is a difference in the method specs that I can see.  Those that I _cannot_ call all have a "get" in the API documentation for Axapta -- like this:

HRESULT get_Field( [in] VARIANT field, [out, retval] VARIANT *pVal );

Those that I _can_ call don't -- like this: 

HRESULT Call(  [in] BSTR bstrMethod, [in, optional] VARIANT v1,  [out, retval] VARIANT *pResult);

Is there some different syntax I should need to use in Python to access those "get" methods?

This code in VB works ( where "buffer" is an already created COM object) :

MyValue = buffer.Call( "openBalanceMST" )
AccountNumber	= buffer.Field("AccountNum")

But in Python, the "call" line works, and then the "field" line returns a "com_error: (-2147352573, 'Member not found.', None, None)"

Any ideas?  Did that explanation make sense?

Thanks,

g.







More information about the Python-list mailing list