Hi experts
I am going to work on integration. I needs your guidance to start my integration development.
Requirement: Some master data want to share with third party app on the base of master data sales orders / purchase orders happens on third party application and third party application wants to pushed these orders details to D365FnO On-Pram version.
we needs to create sales-order/ purchase-orders in D365FnO On-Pram version.
Please some one guide which integration approch is best it will be helpfull if you share with me any example link.
Please advice.
Thank you, Let me check and get back to you.
'var' isn't a type. It's just a way of leaving the system to decide which type it is, based on what it on the right side. This may be the source of your problem; use a specific method for the given type, e.g. GetString().
More robust frameworks can handle it for you. I've used Dapper, LINQ to SQL and Entity Framework, for instance, but there are surely many more.
Thank you, Martin Drab, for your response.
I have checked the details of the exception in the debug window and have not found any other errors apart from the one mentioned in the screenshot above. One thing to note is that the external database's customers table has varchar data types for fields such as custcode, custname, shortname, and city, but I am receiving values in a var type variable.
Can you suggest if this could be an issue?
Could you also share a link or example for a strongly-typed API.?
My code compiles successfully with ExecuteNonQueryAsync() without any parameters. I have also tried using ExecuteNonQuery() with the same result.
Any suggestion.
Look at details of the exception. All I can say from your screenshot is that you have an invalid cast somewhere. For example, is CustCode a text field?
You may prevent this kind of bugs by using a strongly-typed API instead of the old SqlCommand.
It's strange if your code compiles at all, because ExecuteNonQueryAsync() requires a parameter and you didn't provide any. It's not a correct way of an asynchronous call anyway; rather use ExecuteNonQuery() instead.
By the way, there is no point in calling Dispose() on success, on error and then in the 'finally' block, because the last one covers the other two. And you can simplify it with the 'using' statement.,
Hi experts,
I am connecting the external Database in D365FO using SQLClient and Select Customers after selection I am updating the City of the Customers but my Update query is not working below is my Code:
using System.Data.SqlClient; class RunnableClass2 { public static void main(Args _args) { Counter counter = 0; SqlConnection conn = new SqlConnection("Server=serverIp; Database=dataBaseName; User Id=UsrId; Password=pswd;"); str sqlL = "SELECT TOP 10 * FROM Customers"; SqlCommand command = new SqlCommand(sqlL, conn); System.Data.SqlClient.SqlDataReader reader; System.Data.SqlClient.SqlParameterCollection parameterCollection; new InteropPermission(InteropKind::ClrInterop).assert(); try { conn.Open(); try { reader = command.ExecuteReader(); while (reader.Read()) { counter ; var custcode = reader.get_Item("custcode"); var custname = reader.get_Item("custname"); var shortname = reader.get_Item("shortname"); var custCity = reader.get_Item("city"); if(custcode == '000009') { str update="UPDATE Customers SET city = 'Lahore' WHERE custcode = '000009'"; SqlCommand updateCmd = new SqlCommand(update, conn); updateCmd.ExecuteNonQueryAsync(); } Info(strFmt("%1 - %2 - %3", prdcode,custname,shortname)); } Info(strFmt("%1", counter)); reader.Dispose(); } catch { reader.Dispose(); } catch(Exception::CLRError) { reader.Dispose(); } finally { conn.Dispose(); } } catch { conn.Dispose(); } catch(Exception::CLRError) { conn.Dispose(); } command.Dispose(); CodeAccessPermission::revertAssert(); } }
I have debugged the issue, below is screenshot of debug windows.
Someone help me in this error I am badly stuck at Updating record query.
Hi Judy,
Thank you for your response, let me check the link I will get back to you.
Hi Abdul,
Please refer to the discussion for the same topic:
community.dynamics.com/.../d365fo-integration-with-on-premise-system-file-db
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156