Question Status

Suggested Answer
Romryan asked a question on 1 Dec 2017 3:45 PM

Dear all,

I have seen sop c# integration console application and I really appreciates but it puts one sop document/transaction.

Is there one whereby when ran,several documents (read from a file or another database) are uploaded to gp as oppose to initializing on transaction directly on C# or vb codes.

RomRyan

Reply
Suggested Answer
Srinivas Ramidi responded on 1 Dec 2017 4:41 PM

Hello,

What's wrong with importing transaction by transaction, move all your implementation code to class and call the method for each document. Any how you can check SmartConnect or Scribe tools if you want to mass import automatically.

Best,

Srini

Reply
Romryan responded on 2 Dec 2017 3:34 AM

I just want to insert data more data i.e.

let give an example of when creating a customer

// Create the customer.

               taUpdateCreateCustomerRcd customer = new taUpdateCreateCustomerRcd();

               customer.CUSTNMBR = "TEST001";

               customer.CUSTNAME = "Test Customer";

how can I create ten customers i.e. instead of initializing to TEST001, I intialize to customers who are fetched from a select query from another table.

RomRyan

Reply
Tim W responded on 2 Dec 2017 12:35 PM

If I'm reading this correctly....

What I do is create an array in my dot net program.

Do a SQL query to fill the array (from say a list of customers in another table or database or a flat file read)

Loop that array and call my eConnect procedure to create a single record in GP

write back results as needed

This way once I've got my eConnect procedures debugged it's just how many times do I need to call it from the rest of the code.  I do that in almost every eConnect program I've ever written.

Such that I'd write a wrapper around what you have (please excuse my vb.net, it's easier for me to read):

Public Sub eConnectCall ( l_cust As String, l_name As String)

  taUpdateCreateCustomerRcd customer = new taUpdateCreateCustomerRcd();

              customer.CUSTNMBR = l_cust

              customer.CUSTNAME = l_name

   Try

               bStatus = eConnectCall.CreateEntity(sConnectionString, customer)

   Catch ex As Exception

End Sub

Reply
Romryan responded on 2 Dec 2017 3:16 PM

Tim,

Thanks for the update.

Do you have the full code for populating either customers, documents etc even if its VB.NET. kindly paste.

Reply
Romryan responded on 3 Dec 2017 3:56 PM

Tim,

Any codes??

Reply
Tim Wappat responded on 4 Dec 2017 7:05 AM

I use the same technique as Tim W.

I don't have any generic code samples for this, what Tim has given you should be enough to work with to get a solution for your particular needs. Generally people on here don't mind giving some advice but we can't write the solution for you.

Tim

Reply
Richard Wheeler responded on 4 Dec 2017 7:57 AM

I am currently developing my own SOP eConnect application that includes sales tax. I am starting simply with the eConnect nodes and I am also stuck on the sales tax issues. Once I work this through I will update this case with the correct timing of what is needed.

Reply
Romryan responded on 4 Dec 2017 10:14 AM

Richard,

As I endeavour to develop the solution. I will appreciate your share if your complete it before.

Thanks,

RomRyan

Reply
Richard Wheeler responded on 4 Dec 2017 10:30 AM

I just found KB927322 which says it has an example. I am perusing it right now. Let's hope it helps.

Reply
Romryan responded on 4 Dec 2017 10:40 AM

Thanks Richard for the follow up and let me check too.

Reply
Tim W responded on 4 Dec 2017 10:46 AM

I don't have access to a customer import that I can find, but if I did I'd be violating terms to give it to you regardless as that code is not mine to share but rather paid for by others.  Maybe I'll write a simple import for you at some point but I'd rather not get into an infinite loop on this request.

Point I was trying to make when responding to your initial question and maybe I wasn't clear enough was: I don't see eConnect as the problem, it's your experience with C# that seems to be more the issue.  If you don't have experience with passing parameters to procedures or querying SQL directly from VS or using data sets or arrays then I think it's tough to start where you are starting.  Understanding deployment, ini files, includes all part of the process here.

That said, I'll see if I can write something simple but if I'm putting in community time today it will be testing sales tax calculations for Richard.

Reply
Richard Wheeler responded on 4 Dec 2017 11:40 AM

Tim, I am just sitting in SQL and issuing direct SQL commands using taSOPLineIvcInsert, taSopLineTaxInsert and taSopHdrIvcInsert commands trying to find the right combination for sales tax. Once I find the right connection the C# part is a snap. I have found article that claims to have the answer. We shall see will see.

Reply
Romryan responded on 5 Dec 2017 6:00 AM

Tim,

In fact what I am doing is similar to what Richard is doing, I gave customer import as an example. What I need is the concept. i.e. if I can import an SOP invoice (several records from another system's table) then the same concept applies to PO,POP invoice. I am working on SOP one and once I succeed POP one will follow.

Let me see if I can get things right.

RomRyan

Reply
Richard Wheeler responded on 5 Dec 2017 6:59 AM

support.microsoft.com/.../sample-xml-document-that-you-can-use-to-import-tax-information-for-a-s

I followed this example exactly using only T-SQL commands and I got it to work. My only issue was error 3565 on the header insert. This is in regards to updating the next note index. Why that occurs is a mystery but the header record does get inserted. I am now going to build on this to customize it to what I need. The biggest reason I wanted to use eConnect was to have a lot of the work done for me especially when it came to sales tax. If I have to compute the sales tax and supply all the values then eConnect really has no value. I will simply write directly to the tables or worse yet use IM to import the orders.

Reply
Suggested Answer
Srinivas Ramidi responded on 7 Dec 2017 7:33 PM

Hello Richard,

Can you check if you have correct value in INTERID field  in table DYNAMICS.dbo.SY01500

community.dynamics.com/.../107348

Reply
Suggested Answer
Srinivas Ramidi responded on 1 Dec 2017 4:41 PM

Hello,

What's wrong with importing transaction by transaction, move all your implementation code to class and call the method for each document. Any how you can check SmartConnect or Scribe tools if you want to mass import automatically.

Best,

Srini

Reply
Suggested Answer
Srinivas Ramidi responded on 7 Dec 2017 7:33 PM

Hello Richard,

Can you check if you have correct value in INTERID field  in table DYNAMICS.dbo.SY01500

community.dynamics.com/.../107348

Reply