How to read single record with BOI (C#)

SOLVED

Hello All,

Can anyone help me in getting a single record from Sage BOI script. I am using the following code but no data is returned.

int taskId = (int)oSs.InvokeMethod("nLookupTask", "AR_Customer_ui");
oSs.InvokeMethod("nSetProgram", taskId);

using (var arCustSvc = new DispatchObject(pvx.InvokeMethod("NewObject", "AR_Customer_svc", oSs.GetObject())))
{
    arCustSvc.InvokeMethod("nSetKeyValue", "ARDivisionNo$", "00");
    arCustSvc.InvokeMethod("nSetKeyValue", "CustomerNo$", "0000007");

    int returnValue = (int)arCustSvc.InvokeMethod("nFind");
    if (returnValue > 0)
    {
        int retVal = 0;

        string str1 = "", str2 = "";
        retVal = (int)arCustSvc.InvokeMethod("nGetRecord", str1, str2);
    }
}

here retVal is 1, but str1 and str2 is empty.

Is there anything i am doing wrong here?

Parents
  • 0

    This is what the file and layouts says about the GetRecord method.

    So i don't think you are going to be able to use it with C# unless you use the Evaluate method of the PVX object to return the compiled IOLIST. Depending on what you are trying to accomplish, it might be easier to just use the GetValue method of your arCustSvc object.

Reply
  • 0

    This is what the file and layouts says about the GetRecord method.

    So i don't think you are going to be able to use it with C# unless you use the Evaluate method of the PVX object to return the compiled IOLIST. Depending on what you are trying to accomplish, it might be easier to just use the GetValue method of your arCustSvc object.

Children