Auto Update Data after SQL Syntax - Currpage.update is not working

julkifli33
Member Posts: 1,092
Hi All,
I have 1 customization using System.Data.SqlClient.SqlConnection
insert and update data is successfull
but the problem is sometimes when i open the page it will not changed immediately.
after i press refresh then it will change.
i have added in OnOpenPage ()
Currpage.update;
but still not working.
any idea what should I add?
I have 1 customization using System.Data.SqlClient.SqlConnection
insert and update data is successfull
but the problem is sometimes when i open the page it will not changed immediately.
after i press refresh then it will change.
i have added in OnOpenPage ()
Currpage.update;
but still not working.
any idea what should I add?
0
Best Answers
-
This is fundamentally the wrong way of inserting/updating data in NAV/BC - you should use webservices instead.
When that said, you can probably use this command: https://docs.microsoft.com/en-us/dynamics-nav/selectlatestversion-function--database-
...to fix it, but it will still be the wrong approach as it will hurt performance...6 -
@julkifli33,
Depending on you NAV version, you can actually use webservice between different NAV databases.
I will allways agree with @lynge, going throw SQL is not a good idea.
But to help with your current problem, you could try to use SELECTLATESTVERSION
https://docs.microsoft.com/en-us/dynamics-nav/selectlatestversion-function--database-
But it would hurt preformensFor help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.5
Answers
-
This is fundamentally the wrong way of inserting/updating data in NAV/BC - you should use webservices instead.
When that said, you can probably use this command: https://docs.microsoft.com/en-us/dynamics-nav/selectlatestversion-function--database-
...to fix it, but it will still be the wrong approach as it will hurt performance...6 -
Hi Lynge, i have no choice
this one i push data from database A to Database B
if only 1 database, i can use Changecompany0 -
@julkifli33,
Depending on you NAV version, you can actually use webservice between different NAV databases.
I will allways agree with @lynge, going throw SQL is not a good idea.
But to help with your current problem, you could try to use SELECTLATESTVERSION
https://docs.microsoft.com/en-us/dynamics-nav/selectlatestversion-function--database-
But it would hurt preformensFor help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.5 -
Hi SanderDk,
thanks for the advise.
Selectlatestversion works for me.
thank you so much !0 -
Hi All
I have Added this codetrigger OnOpenPage() begin SelectLatestVersion(); CurrPage.Update(); end;
but when i drilldown i got this error message.
do i need this --> CurrPage.Update();
in my code
Thanks0 -
No, not if you do not make changes to your dataFor help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0
-
Hi Sander,
i used this code in the pagetrigger OnOpenPage() begin SelectLatestVersion(); CurrPage.Update(); end;
When i drilldown from jetreport, it supposed to open this page
but it will show error message
0 -
I am not code but still I try to learn things from posts like here.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions