Error on using ACCPAC libraries for custom 3rd Party Application

SOLVED

Hi all, 

I am developing an app using ACCPAC libraries:

I have difficulty to do an Order Entry from my application, especially on setting the value of CUSTOMER (OE0520) and ITEM(OE0500), to do RecordCreate(ACCPAC.Advantage.ViewRecordCreate.Insert) function

the error is: 

System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at AccpacCOMSVR.AccpacSvrViewFieldClass.set_Value(Object& pVal)
at ACCPAC.Advantage.Server.View.FieldSetValue(FieldValue fieldValue, Boolean verify)
at ACCPAC.Advantage.ViewField.SetValue(Object newValue, Boolean verify)

Above error happen while trying to set value for CUSTOMER: _viewOEHeader.Fields.FieldByName("CUSTOMER").SetValue("AA000001", true);

Other fields where the data is not consider derived from other tables or KEY can be set successfully.

this is what I have done:

- username and password is correct

- I have followed the sequence to open session, open dblink, set array etc in the macro that I record from OE1100. 

- open Visual Studio as Admin and run / open the application as Admin

but same error result.

Please help. Thank you.

Parents
  • +1
    verified answer

    Well 0x80004005 smells of permissions.

    Turn off UAC. You need to query the Sage errors collection as that error is a standard error you'll see any time you get an error.

    The errors collection is in the Sage session object. Loop through it. Clear it after the loop. I've got code to do it but not with me right now.

Reply
  • +1
    verified answer

    Well 0x80004005 smells of permissions.

    Turn off UAC. You need to query the Sage errors collection as that error is a standard error you'll see any time you get an error.

    The errors collection is in the Sage session object. Loop through it. Clear it after the loop. I've got code to do it but not with me right now.

Children