Reading external datasource in BPM

I have not done it directly through the datasource but I have accessed the datasource via an external BAQ and then used dynamic query in code to read. Gets the same result as going to the datasource and not SQL calls.

Yes I’ve done it check snipet

1 Like

can you please shared the snipet?

There is no use of doing it that way (that I can gather). Just use a SQL adapter in C#.

the problem is in kinetic the sql adapter of C# is not working at all it errors out with the following error

System.Drawing.Bitmap CS1069 The type name ‘SqlConnection’ could not be found in the namespace ‘System.Data.SqlClient’. This type has been forwarded to assembly ‘System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ Consider adding a reference to that assembly.

Longer term, you probably need to be moving to something else.

I dunno, my curiosity leads me to want to know too. Might be something there,
but that’s assuming I understand the question correctly. :slight_smile:

I dont know the proper way to use the ExtBAQ BO, but if one wanted to quickly start working, why not UBAQ an ExtBAQ?

Wont help with an SP unfortunately.

I am trying to find a long term solution but let me try this for now thanks so much

Might I suggest a medium term solution?

It seems like a Minimal API built in .Net might be a nice intermediary for comms between services.

What about using a trigger? Can you write to an external data source in a UBAQ?

Sure, if you can get SqlClient to complile :smile: Seriously though, I am unsure if ext baq supports direct update, hell it might!

Damn,that’s crafty. I bet it would work.

Well I can, I cheated, but check my link.

That’s what I wanted to know really. I’m cloud, so I can’t set those up.
(Well not without some um… crafitness) . I’m not even sure if it’s supported at all.

But I would like to know if on prem can do direct writes like that using the system tools.

direct sql update works but epicor is hating SQL in kinetic for some reason @klincecum can you please send me an snipet of the sql code above i couldnt understand how to se the line you sent above

This is just using System.Data.SqlClient via reflection.
This particular example calls a stored procedure.

CallStoredProcSQLClientEpicorBPM.txt (728 Bytes)

let me test it. thanks so much

i have to work on the Types meaning the 3 lines below.

Assembly System_Data_SqlClient = Assembly.Load(“System.Data.SqlClient”);

Type typeSqlCommand = System_Data_SqlClient.GetType(“System.Data.SqlClient.SqlCommand”);
Type typeSqlConnection = System_Data_SqlClient.GetType(“System.Data.SqlClient.SqlConnection”);

Since i was working with paramenters i needed to add the line below
command.parameters.Add(new SqlParameter(paramaeter name, sqlDbType.nvarchar){ Value = “SomeValue”};

When i get the code fully working, i will let you guys know.

@josecgomez do you have a long term solution to the SQL call via reflection?

No my solution is don’t call SQL. I still don’t understand the need you should be able to accomplish everything you need using either LINQ, C# or BAQs/UBAQs

I didn’t read the entire thread, but I’d be hard-pressed to find a need.

I went back and can’t figure out what you are trying to do, can you give me more details?