Customer integration issue after update to 2020

SUGGESTED

We have a customer that just upgraded their Sage 100 product to the 2020 version and are seeing some issues with integrating to our product.  They migrating from Sage 2016.  

Below is a code snippet of where the issue is coming from.  The error is “CI_NOF: 183 is not on file” when calling the SetKey method.

object obj = Mas90Plugin.Instance.ProvideX.NewObject("SY_ZipCode_bus", Mas90Plugin.Instance.Session.Object);

using (BusinessObject syZipCodeBus = new BusinessObject(obj))
{
    int result = syZipCodeBus.SetKey(address.Zip);
    if (result == 2)
    {
        syZipCodeBus.SetValue("City$", address.City);
        syZipCodeBus.SetValue("StateCode$", address.State);
        syZipCodeBus.SetValue("CountryCode$", string.IsNullOrEmpty(address.Country) ? "USA" : address.Country);
        syZipCodeBus.Write();
    }
}

Thank you for your help. 

Parents
  • 0
    SUGGESTED

    The table changed in v2020.  Primary Key now includes the Country Code too.

  • 0 in reply to Kevin M

    Are you suggesting the following?  

    object obj = Mas90Plugin.Instance.ProvideX.NewObject("SY_ZipCode_bus", Mas90Plugin.Instance.Session.Object);
    
    using (BusinessObject syZipCodeBus = new BusinessObject(obj))
    {
        int result = syZipCodeBus.SetKey(address.Zip);
        if (result == 2)
        {
    		result = syZipCodeBus.SetKey(string.IsNullOrEmpty(address.Country) ? "USA" : address.Country);
    		if (result == 2)
    		{
    			syZipCodeBus.SetValue("City$", address.City);
    			syZipCodeBus.SetValue("StateCode$", address.State);
    			syZipCodeBus.SetValue("CountryCode$", string.IsNullOrEmpty(address.Country) ? "USA" : address.Country);
    			syZipCodeBus.Write();
    		}
        }
    }

    By the way, I'm not the original developer of this code.  Any links to developer documentation and/or examples of integration using ProvideX and c# would be super helpful.

    Thank you.

Reply
  • 0 in reply to Kevin M

    Are you suggesting the following?  

    object obj = Mas90Plugin.Instance.ProvideX.NewObject("SY_ZipCode_bus", Mas90Plugin.Instance.Session.Object);
    
    using (BusinessObject syZipCodeBus = new BusinessObject(obj))
    {
        int result = syZipCodeBus.SetKey(address.Zip);
        if (result == 2)
        {
    		result = syZipCodeBus.SetKey(string.IsNullOrEmpty(address.Country) ? "USA" : address.Country);
    		if (result == 2)
    		{
    			syZipCodeBus.SetValue("City$", address.City);
    			syZipCodeBus.SetValue("StateCode$", address.State);
    			syZipCodeBus.SetValue("CountryCode$", string.IsNullOrEmpty(address.Country) ? "USA" : address.Country);
    			syZipCodeBus.Write();
    		}
        }
    }

    By the way, I'm not the original developer of this code.  Any links to developer documentation and/or examples of integration using ProvideX and c# would be super helpful.

    Thank you.

Children