Skip to main content
Solved

Extend Customer to Vendor and vice versa to import scenario?

  • August 14, 2024
  • 6 replies
  • 196 views

vgonzalez
Freshman I

Hello good afternoon community

I am importing customers and vendors through the import scenario, there are approximately 16,000 customers and about 4,000 vendors, many of them are customer/vendor at the same time.

When I do this I get an error saying that I cannot have the same customer and vendor ID during the import. These customers/vendors have the same ID. since they are the same.

Is there a configuration that allows it? Is there a way to import them by import scenario? because there are about 950 customers/vendors that exist with this condition. I hope you can help me since it is impossible to create them one by one manually.

I am driving Acumatica version 2023R2

I look forward to your help and thank you in advance.

Vanessa.

Best answer by hkabiri

@vgonzalez When Customer is being extended to Vendor or vice versa, the Corresponding Business Account being changed to VC which means both Vendor and Customer. Given BAccount Table has Does not accept same AcctCD with different BaccountId your only way is extend vendor to customer or vice versa using the import scenario or API.

Following post available on community and github but some of solutions might be obsolete

https://community.acumatica.com/configuration%2Dand%2Dinstallation%2D114/how%2Dto%2Dextend%2Da%2Dbusiness%2Daccount%2Dto%2Dvendor%2Dusing%2Dan%2Dapi%2Drequest%2D5764

https://github.com/Acumatica/Acumatica-ExtendToCustomerVendorDuringImport

View original
Did this topic help you find an answer to your question?

6 replies

hkabiri
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Support Team
  • 215 replies
  • Answer
  • August 14, 2024

@vgonzalez When Customer is being extended to Vendor or vice versa, the Corresponding Business Account being changed to VC which means both Vendor and Customer. Given BAccount Table has Does not accept same AcctCD with different BaccountId your only way is extend vendor to customer or vice versa using the import scenario or API.

Following post available on community and github but some of solutions might be obsolete

https://community.acumatica.com/configuration%2Dand%2Dinstallation%2D114/how%2Dto%2Dextend%2Da%2Dbusiness%2Daccount%2Dto%2Dvendor%2Dusing%2Dan%2Dapi%2Drequest%2D5764

https://github.com/Acumatica/Acumatica-ExtendToCustomerVendorDuringImport


Graeme Laughton-Mutu
Freshman II
Forum|alt.badge.img

The problem when I explored doing this via Import Scenario is that when you do the extension, the new record appears on screen and needs you to click Save, the Import Scenario only handles the initial screen and fields/options on it, not the next screen in the process.

Eg. An import scenario can select the Extend as Vendor action, from the Customers screen, but the next step in the UI doing this would be the Vendors screen opening, pre-populated with the details and you would need to click Save for the new Vendor record. The import scenario doesn’t reach this far.

My workaround for around 50 records was to setup and use a Power Automate workflow to work through a list of Customer ID’s and simulate the keyboard and mouse actions of a user keying each Customer ID, then clicking the extend as Vendor action, then clicking Save. 

 


Forum|alt.badge.img+3
  • Varsity I
  • 215 replies
  • October 23, 2024

The GitHib package does not compile in 24R1.

 


Forum|alt.badge.img
  • Varsity I
  • 71 replies
  • February 21, 2025

Hi,

Thanks for providing the information above.  I recently had this exact same problem.  Followed the posts provided by hkabiri.  He was correct that the code was obsolete for R2024.  The concept of creating a custom action to extend the Customer to Supplier and trigger via an import scenario was good though - really helped me out.

The below is a R2024 compatible version of the action to extend a customer to a supplier that I put together after reviewing the links provided above.

 

Pretty short piece of code but it took me a couple of hours to figure out! Maybe of use to others.

 

Thanks,

John.


Graeme Laughton-Mutu
Freshman II
Forum|alt.badge.img

Nice one ​@JWS539 
To help others wanting to try this, I’ve transposed the code screenshot into text :)

 

namespace PX.Objects.AR
{
    public class CustomerMaint_Extension : PXGraphExtension<PX.Objects.AR.CustomerMaint>
    {
        public PXAction<Customer> CustomExtendToVendor;
        [PXButton(CommitChanges = true)]
        [PXUIField(DisplayName = "Custom Extend To Vendor", Enabled = true)]

        protected virtual IEnumerable customExtendToVendor(PXAdapter adapter)
        {
            Vendor vendor = SelectFrom<Vendor>.Where<Vendor.acctCD.IsEqual<@P.AsString>>.View.Select(Base, Base.BAccount.Current.AcctCD);

            if (vendor == null)
            {
                CustomerMaint.ExtendToVendor ext = Base.GetExtension<CustomerMaint.ExtendToVendor>();

                VendorMaint vendorGraph = ext.Extend();

                vendorGraph.BaseLocations.SetValueExt<Location.vPaymentMethodID>(vendorGraph.BaseLocations.Current, "MANUAL");
                vendorGraph.Save.Press();
            }
            else
            throw new PXException((string)"Vendor already exists");

            return adapter.Get();
        }
    }
}

 


gorazem
Varsity I
Forum|alt.badge.img
  • Varsity I
  • 46 replies
  • March 3, 2025

I actually have a pull request open on this repo. The working branch I requested to be merged as been working in our system on 2024R1 for some time.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings