Skip to main content

Specific Data provider


SadokHanini
Freshman II

Can we develop a specific data provider type ?

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

11 replies

Gabriel Michaud
Captain II
Forum|alt.badge.img+11

Hi @SadokHanini 

 

Yes, you can write your own data provider. Here’s some boilerplate code to help you get started; Acumatica will automatically detect your provider. This is from an existing provider that I wrote, I just removed everything that is specific and provided just a base template for you.

InternalImport/InternalExport are the functions you need to implement and where the actual work happens.

 

using PX.Api;
using PX.Data;
using PX.DataSync;
using PX.Objects.AP;
using PX.SM;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;

namespace Velixo.Sample
{
    public class SampleProvider : PXSYBaseEncodedFileProvider, IPXSYProvider
    {
        protected const string MsgId = "MsgId";

        public string DefaultFileExtension => ".xml";

        public override string ProviderName => "My Provider";

        public override string Extensiton => DefaultFileExtension;

        public override PXFieldState[] GetSchemaFields(string objectName)
        {
            List<PXFieldState> ret = new List<PXFieldState>(base.GetSchemaFields(objectName));

			//TODO: Add the fields your provider will be exposing
            ret.Add(CreateFieldState(new SchemaFieldInfo(-1, MsgId)));

            return ret.ToArray();
        }

        protected override List<PXStringState> FillParameters()
        {
            List<PXStringState> ret = base.FillParameters();

			//TODO: Add the parameters your provider will be exposing

            return ret;
        }

        protected override byte[] InternalExport(string objectName, PXSYTable table)
        {
            throw new NotImplementedException();            
        }

        protected override void InternalImport(PXSYTable table)
        {
            throw new NotImplementedException();
        }
    }
}

 


gmercede
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • 77 replies
  • October 20, 2020

What are you trying to create the provider for?  Some multi-table type import operations might not be ideal to use integration scenarios.


Forum|alt.badge.img
  • Jr Varsity II
  • 32 replies
  • October 20, 2020

 

So this could work with any file extension or only the ones supported by acumatica (xml,  excel; csv..) ? 

public string DefaultFileExtension => ".xml";


SadokHanini
Freshman II
  • Author
  • Freshman II
  • 42 replies
  • October 21, 2020
gmercede wrote:

What are you trying to create the provider for?  Some multi-table type import operations might not be ideal to use integration scenarios.

For a specific file with .TRA extension that doesn’t exist already in acumatica


SadokHanini
Freshman II
  • Author
  • Freshman II
  • 42 replies
  • October 21, 2020
Gabriel Michaud wrote:

Hi @SadokHanini 

 

Yes, you can write your own data provider. Here’s some boilerplate code to help you get started; Acumatica will automatically detect your provider. This is from an existing provider that I wrote, I just removed everything that is specific and provided just a base template for you.

InternalImport/InternalExport are the functions you need to implement and where the actual work happens.

 

using PX.Api;
using PX.Data;
using PX.DataSync;
using PX.Objects.AP;
using PX.SM;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;

namespace Velixo.Sample
{
    public class SampleProvider : PXSYBaseEncodedFileProvider, IPXSYProvider
    {
        protected const string MsgId = "MsgId";

        public string DefaultFileExtension => ".xml";

        public override string ProviderName => "My Provider";

        public override string Extensiton => DefaultFileExtension;

        public override PXFieldState[] GetSchemaFields(string objectName)
        {
            List<PXFieldState> ret = new List<PXFieldState>(base.GetSchemaFields(objectName));

			//TODO: Add the fields your provider will be exposing
            ret.Add(CreateFieldState(new SchemaFieldInfo(-1, MsgId)));

            return ret.ToArray();
        }

        protected override List<PXStringState> FillParameters()
        {
            List<PXStringState> ret = base.FillParameters();

			//TODO: Add the parameters your provider will be exposing

            return ret;
        }

        protected override byte[] InternalExport(string objectName, PXSYTable table)
        {
            throw new NotImplementedException();            
        }

        protected override void InternalImport(PXSYTable table)
        {
            throw new NotImplementedException();
        }
    }
}

 

Thnk u :) 
where can i find this code to modify it ? thnx 


Gabriel Michaud
Captain II
Forum|alt.badge.img+11

@SadokHanini this is it, it’s the full provider, without an actual implementation.. you just need to add this to your project, and implement InternalImport and/or InternatExport based on your requirements. Here’s another link you will find useful: https://asiablog.acumatica.com/2016/09/custom-integration-services-data.html


SadokHanini
Freshman II
  • Author
  • Freshman II
  • 42 replies
  • October 28, 2020
Gabriel Michaud wrote:

@SadokHanini this is it, it’s the full provider, without an actual implementation.. you just need to add this to your project, and implement InternalImport and/or InternatExport based on your requirements. Here’s another link you will find useful: https://asiablog.acumatica.com/2016/09/custom-integration-services-data.html

Thanks :) 


  • Freshman I
  • 1 reply
  • June 21, 2022

Have you managed to create the data provider?


  • Freshman I
  • 2 replies
  • June 22, 2022

It depends on what type of data provider you want to create. Is it a B2B data provider designed specifically for sales?
You will need to understand the main features of B2B data providers and see how other data providers work. Here are some examples of good B2B data providers on the market:

  1. OneMoreLead
  2. PureB2
  3. Globaldatabase
  4. Salesify
  5. Leadspace

All of them offer the following services: data accuracy, CRM management, pipeline prediction, and more sales.
In conclusion, you better do some research and choose the best data provider as a prototype.


  • Freshman I
  • 1 reply
  • March 19, 2025
SadokHanini wrote:
Gabriel Michaud wrote:

@SadokHanini this is it, it’s the full provider, without an actual implementation.. you just need to add this to your project, and implement InternalImport and/or InternatExport based on your requirements. Here’s another link you will find useful: https://asiablog.acumatica.com/2016/09/custom-integration-services-data.html

Thanks :) 

Hi, I see there was a link associated with this posting, its not a valid link , can you provide a better updated link or even some documentation on building a custom specific data provider.


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi ​@tracy27,

Below is the working link, https://asiablog.acumatica.com/?p=5140 for that article. 


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