<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-581400760890821489</id><updated>2025-05-02T07:45:30.756-07:00</updated><category term="Microsoft Dynamics GP"/><category term="SmartConnect"/><category term="Microsoft SQL Server"/><category term="Speciality Software"/><category term="BI360"/><category term="Business Technology"/><category term="Epicor"/><title type='text'>Enterprise Dynamics: Microsoft Dynamics GP &amp;amp; other business technology</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>52</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-9215532778903053825</id><published>2016-06-23T08:37:00.004-07:00</published><updated>2016-06-23T08:37:43.313-07:00</updated><title type='text'>[RESOLVED] Dynamics GP Error &quot;The selected document may be damaged. Please rebuild the RM Keys File to correct it &quot;</title><content type='html'>We were getting this error when we were trying to apply a payment&lt;br /&gt;
&lt;br /&gt;
The standard response from GP and the community is to run check links&lt;br /&gt;
&lt;br /&gt;
When we ran the check links against the open transaction table in the test environment, it actually &lt;b&gt;deleted the payment (which was wrong because it had posted to bank, been reconciled and posted to GL as well)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We decided then to manually fix the RM Keys table by running the following query where&lt;br /&gt;
xxxx was the document number (i.e. PYMNTxxxxxx)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; RM00401&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt; DOCNUMBR&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;RMDTYPAL&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;2&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;BCHSOURC&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;TRXSORCE&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;CUSTNMBR&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;CHEKNMBR&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;DOCDATE&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;0 &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; RM20101&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&amp;nbsp;DOCNUMBR=&#39;&lt;span style=&quot;background-color: yellow;&quot;&gt;xxxxxx&lt;/span&gt;&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; DOCNUMBR &lt;span style=&quot;color: grey;&quot;&gt;IN&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; DOCNUMBR &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt;
RM00401&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This resolved the issue without deleting a valid document&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/9215532778903053825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2016/06/resolved-dynamics-gp-error-selected.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/9215532778903053825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/9215532778903053825'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2016/06/resolved-dynamics-gp-error-selected.html' title='[RESOLVED] Dynamics GP Error &quot;The selected document may be damaged. Please rebuild the RM Keys File to correct it &quot;'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-2755046599507482479</id><published>2016-02-04T08:11:00.002-08:00</published><updated>2016-02-04T08:11:32.807-08:00</updated><title type='text'>SQL Server stored procedure to query all GP databases and return a single table</title><content type='html'>This procedure runs a single query against multiple GP databases and returns it in a single recordset with company name and INTERID appended to each record&lt;br /&gt;
&lt;br /&gt;
This procedure requires three parameters&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SQLstrtempl_sel = the part of the query before &#39;from&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SQLstrtempl_from = the part of the query from the word from&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@GPdatabasestoincl = the databases to include separated by |. If blank all databases are included.&lt;br /&gt;
&lt;br /&gt;
In the query, you must use the parameter #GPDBName# to represent the database&lt;br /&gt;
#GPDBName# will be replaced by the actual database name when running&lt;br /&gt;
&lt;br /&gt;
This is callable from SSRS reports so we use it to let users access the&amp;nbsp;smartlist&amp;nbsp;views across multiple databases on an ad hoc basis&lt;br /&gt;
&lt;br /&gt;
For example, if the query is&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;select [journal entry],[account number],[debit amount]-[credit amount]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;from TWO..accounttransactions&lt;br /&gt;
&lt;br /&gt;
and you want to run it against the TWO and ONE companies,&amp;nbsp;you execute the procedure as follows&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;EXECUTE QUERYALLGPDBS&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;select [journal entry],[account number],[debit amount]-[credit amount]&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;from #GPDBName#..accounttransactions&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;TWO|ONE&#39;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In the third parameter, the company INTERIDs must be separated by |&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you want to run against all GP companies, you can just leave it blank and it will run against all GP companies that are in the DYNAMICS..SY01500 table on the server - an example follows&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;EXECUTE QUERYALLGPDBS&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;select [journal entry],[account number],[debit amount]-[credit amount]&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;from #GPDBName#..accounttransactions&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;&#39;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;USE [DYNAMICS]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/****** Object: &amp;nbsp;StoredProcedure [dbo].[QUERYALLGPDBS] &amp;nbsp; &amp;nbsp;Script Date: 02/04/2016 11:02:13 ******/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SET ANSI_NULLS ON&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SET QUOTED_IDENTIFIER ON&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;/* ------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;This procedure requires three parameters&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SQLstrtempl_sel = the part of the query before &#39;from&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SQLstrtempl_from = the part of the query from the word from&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@GPdatabasestoincl = the databases to include separated by |. If blank all databases are included.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;In the query, you must use the parameter #GPDBName# to represent the database&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;#GPDBName# will be replaced by the actual database name when running&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for example, if the query is&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;select #GPDBName# as database, [journal entry],[account number],[debit amount]-[credit amount]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;from #GPDBName#..accounttransactions&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;you execute the procedure as follows&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;EXECUTE QUERYALLGPDBS&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;select #GPDBName# as [database], [journal entry],[account number],[debit amount]-[credit amount]&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;from #GPDBName#..accounttransactions&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;TWO|ONE&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;------------------------------------------------ */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE PROCEDURE [dbo].[QUERYALLGPDBS]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SQLstrtempl_sel NVARCHAR(MAX),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SQLstrtempl_from NVARCHAR(MAX),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@GPdatabasestoincl NVARCHAR(MAX)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AS&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @DB_Name nvarchar(MAX)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @column_name nvarchar(MAX)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @altercolumns int&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @SQLstr nvarchar(MAX)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SET @altercolumns=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE database_cursor CURSOR FOR select interid from dynamics..sy01500&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;order by interid&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OPEN database_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;FETCH NEXT FROM database_cursor INTO @DB_Name&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;set @SQLstr = cast(&#39;&#39; as nvarchar(max))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if object_id(&#39;tempdb..##QUERYALLGPDBStbl&#39;) is NOT null&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;drop table ##QUERYALLGPDBStbl&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;BEGIN&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (@GPdatabasestoincl =&#39;&#39; or charindex(rtrim(@DB_Name)+&#39;|&#39;,@GPdatabasestoincl+&#39;|&#39;)&amp;gt;0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if object_id(&#39;tempdb..##QUERYALLGPDBStbl&#39;) is null&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;set @SQLstr = replace(@SQLstrtempl_sel,&#39;#GPDBName#&#39;,rtrim(@DB_Name))+&#39;,(select cmpnynam from dynamics..sy01500 where interid=&#39;&#39;&#39;+rtrim(@DB_Name)+&#39;&#39;&#39;) as Company INTO ##QUERYALLGPDBStbl &#39;+replace(@SQLstrtempl_from,&#39;#GPDBName#&#39;,rtrim(@DB_Name))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;set @altercolumns=1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;set @SQLstr =&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&#39;INSERT INTO ##QUERYALLGPDBStbl &#39;+replace(@SQLstrtempl_sel,&#39;#GPDBName#&#39;,rtrim(@DB_Name))+&#39;,(select cmpnynam from dynamics..sy01500 where interid=&#39;&#39;&#39;+rtrim(@DB_Name)+&#39;&#39;&#39;) as Company &#39;+replace(@SQLstrtempl_from,&#39;#GPDBName#&#39;,rtrim(@DB_Name))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;print @SQLStr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;exec sp_executesql @SQLStr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if @altercolumns=1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DECLARE columns_cursor CURSOR FOR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;select column_name from tempdb.information_schema.columns&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;where table_name LIKE &#39;##QUERYALLGPDBStbl&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;and data_type like &#39;%char%&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;OPEN columns_cursor &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;FETCH NEXT FROM columns_cursor INTO @column_name&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;BEGIN&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;set @SQLstr = &#39;alter table ##QUERYALLGPDBStbl alter column [&#39;+@column_name+&#39;] varchar(max)&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;print @SQLStr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;exec sp_executesql @SQLstr&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;FETCH NEXT FROM columns_cursor INTO @column_name&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;END&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;CLOSE columns_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DEALLOCATE columns_cursor &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SET @altercolumns=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;print @DB_Name+&#39; skipped&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;FETCH NEXT FROM database_cursor INTO @DB_Name&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;END&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CLOSE database_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DEALLOCATE database_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;select * from ##QUERYALLGPDBStbl order by company&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;drop table ##QUERYALLGPDBStbl&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/2755046599507482479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2016/02/sql-server-stored-procedure-to-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/2755046599507482479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/2755046599507482479'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2016/02/sql-server-stored-procedure-to-query.html' title='SQL Server stored procedure to query all GP databases and return a single table'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-1318900918364698385</id><published>2015-04-13T12:36:00.001-07:00</published><updated>2015-04-14T11:12:38.952-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SmartConnect"/><title type='text'>Smartconnect Calculated Column VB.NET SQL Lookup code for multicompany integrations</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;Smartconnect&#39;s MS SQL lookup column lets you look up a value from a SQL Server based on a value in the integration file or elsewhere&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;This however only works when you know the database in advance and does not work if&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;the integration is hitting multiple companies&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;For example, in our sales integration, we have a field called COMPANY - the sales line goes into that database ID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;We require a SQL lookup to get an attribute of the item being integrated and the following code - modified from eone&#39;s standard code - accomplishes this&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
To get this to work, you can simply create a calculated field for this and paste the following code into the calculated field script editor&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;You will need&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;1) a MS SQL default connection to the server with a login and password or integrated authentication that has access to all the companies the integration could use - in our case, this connection is called DYNAMICSCOMPANY and the script refers to this as&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: orange; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;_SQLDEF_DYNAMICSCOMPANY&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: orange; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;You will see your connections on the left of the script editor (expand default connections, generic connections and MSSQL default connections)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: orange; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;2) a field called &lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: inherit;&quot;&gt;COMPANY &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;in your integration or some way to determine the company&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;In this case, we are looking up the user defined category 2 (&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: cyan;&quot;&gt;USCATVLS_2&lt;/span&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;in the inventory master (&lt;span style=&quot;background-color: lime;&quot;&gt;IV00101&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; Script Name: &amp;nbsp;SQLQuerySelectTemplate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; Created On: &amp;nbsp; 4/9/2010&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; Author: &amp;nbsp; &amp;nbsp; &amp;nbsp; Chris Hanson&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; Purpose: &amp;nbsp; &amp;nbsp; &amp;nbsp;This script is a template that shows how to use a sql query to return a&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value from a table in a SQL Server database.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; History: &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; Requirements: This script should be located in a calculate field in the map.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; Setup: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;There are six variables to assign in the configuration section. The&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; first four determine which values are used in the connection string.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Those four variables - the server (data source), database (intial&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catalog), user, and password should be changed to the needed values.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The last variable, sqlQuery, contains the query message that is going&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to be executed. This needs to be changed to reference an actual table&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and its corresponding columns before the script will run.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Update: If the map that the script is attached to is going to be&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;scheduled or run real-time then the mapInterface variable should&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;be set to 0.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;0 = scheduled map / real-time map&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;1 = manually run map&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;----------------------------------- CONFIGURATION -------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Dim sqlQuery As String = &quot;Select &lt;span style=&quot;background-color: cyan;&quot;&gt;USCATVLS_2 &lt;/span&gt;from &quot; &amp;amp; &lt;span style=&quot;background-color: yellow;&quot;&gt;_COMPANY&lt;/span&gt; &amp;amp; &quot;..&lt;span style=&quot;background-color: lime;&quot;&gt;IV00101 &lt;/span&gt;where ITEMNMBR = &#39;&quot; &amp;amp;_ITEMNUMBER &amp;nbsp;&amp;amp; &quot;&#39;&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Dim mapInterface As Integer = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;---------------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Dim queryResult As String = &quot;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&#39;Declare the connection string based on the configuration variables&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Dim conString As String = &lt;span style=&quot;background-color: orange;&quot;&gt;_SQLDEF_DYNAMICSCOMPANY&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&#39;Declare the datareader&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Dim dr As System.Data.SqlClient.SqlDataReader&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&#39;Define the SQL connection and open it&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Dim myConn As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(conString)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;myConn.Open()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&#39;Declare the SQL command as the query string and execute it&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Dim command As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(sqlQuery, myConn)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dr = command.ExecuteReader()&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dr.Read()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;queryResult = dr(0).ToString()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&#39;Close the connection&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;myConn.Close()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Catch ex As Exception&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;If (mapInterface = 1) Then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Messagebox.Show(ex.Message, &quot;SQLQuerySelect Script Error&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;End If&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Return &quot;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;End Try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Return queryResult&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/1318900918364698385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/04/smartconnect-calculated-column-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/1318900918364698385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/1318900918364698385'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/04/smartconnect-calculated-column-vbnet.html' title='Smartconnect Calculated Column VB.NET SQL Lookup code for multicompany integrations'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-1528166869171860924</id><published>2015-04-10T09:54:00.003-07:00</published><updated>2015-04-14T11:12:33.942-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>[Resolved] Dynamics GP eConnect taPopRcptLineInsert error Decimal Places passed in on UNITCOST does not match setup </title><content type='html'>The item was setup but the currency was a new currency which had not been used before&lt;br /&gt;
&lt;br /&gt;
When we associated the item with currency (Cards &amp;gt; Inventory &amp;gt; Item Currency) the integration worked fine&lt;br /&gt;
&lt;br /&gt;
Entry 5029 in our &quot;Useful error messages&quot; series&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/1528166869171860924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/04/resolved-dynamics-gp-econnect.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/1528166869171860924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/1528166869171860924'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/04/resolved-dynamics-gp-econnect.html' title='[Resolved] Dynamics GP eConnect taPopRcptLineInsert error Decimal Places passed in on UNITCOST does not match setup '/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-4711525880227348948</id><published>2015-03-19T07:29:00.001-07:00</published><updated>2015-03-19T07:30:09.261-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SmartConnect"/><title type='text'>[Resolved] Smartconnect map export exports blank file with no error/issue</title><content type='html'>When we tried to export a map from Smartconnect, it exported a file without any error.&lt;br /&gt;
&lt;br /&gt;
When we tried importing it, it said &quot;No importable entities were found within selected files&quot;&lt;br /&gt;
&lt;br /&gt;
However, this map had a map data check task which had a data source&lt;br /&gt;
&lt;br /&gt;
When we removed the map data check task, the map exported correctly&lt;br /&gt;
&lt;br /&gt;
Smartconnect support told us that exports of multisource maps had never worked&lt;br /&gt;
&lt;br /&gt;
Even though this was a single source map, Smartconnect seems to have considered the data source used in the map data check another data source making this effectively a multisource map&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/4711525880227348948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/03/resolved-smartconnect-map-export.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/4711525880227348948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/4711525880227348948'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/03/resolved-smartconnect-map-export.html' title='[Resolved] Smartconnect map export exports blank file with no error/issue'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-777526477762921766</id><published>2015-02-24T07:35:00.001-08:00</published><updated>2015-03-19T07:29:45.517-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>[Resolved] Dynamics GP Incorrect Unapplied Amount on Apply Sales Document window </title><content type='html'>When we pulled up a non functional currency document in the Apply Sales Documents window, it showed an amount that was different from the amount remaining on that document&lt;br /&gt;
&lt;br /&gt;
Reconcile did not fix the balance&lt;br /&gt;
&lt;br /&gt;
When we dug further, using SQL profiler, we found that GP was reading the balance from the ORCTRXAM field in the MC020102 table and the value in this field was wrong - this should be the outstanding balance in the non functional currency&lt;br /&gt;
&lt;br /&gt;
We found the document using the following script&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM MC020102&lt;br /&gt;
WHERE DOCNUMBR=&#39;z&#39;&lt;br /&gt;
&lt;br /&gt;
We updated the balance using the following script&lt;br /&gt;
&lt;br /&gt;
UPDATE MC020102&lt;br /&gt;
SET ORCTRXAM=y.yy&lt;br /&gt;
WHERE DEX_ROW_ID=x&lt;br /&gt;
&lt;br /&gt;
y.yy was the correct non functional amount&lt;br /&gt;
x was the DEX_ROW_ID of the document with the incorrect amount&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/777526477762921766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/02/resolved-dynamics-gp-incorrect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/777526477762921766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/777526477762921766'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/02/resolved-dynamics-gp-incorrect.html' title='[Resolved] Dynamics GP Incorrect Unapplied Amount on Apply Sales Document window '/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-7097819575350265087</id><published>2015-02-17T10:53:00.002-08:00</published><updated>2015-03-19T07:29:45.513-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>[Resolved] Dynamics GP 10 PO Receipt not showing in auto invoice screen</title><content type='html'>We were unable to invoice a receipt in GP 10 using the auto invoice screen&lt;br /&gt;
&lt;br /&gt;
1. Thanks to &lt;a href=&quot;http://dynamicserppros.com/solving-microsoft-dynamics-gps-unable-enter-invoice-po-receipt-issue/&quot;&gt;this post from McGladrey&lt;/a&gt;, we were able to find that this was probably due to an incomplete delete and which tables we needed to look at&lt;br /&gt;
&lt;br /&gt;
2. We ran the following query to see if there were stranded invoices&lt;br /&gt;
&lt;br /&gt;
SELECT POPRCTNM, VENDORID, * FROM POP10500 P (NOLOCK)&lt;br /&gt;
WHERE PONUMBER = &#39;xxxxxxx&#39; AND&lt;br /&gt;
POPRCTNM NOT IN&lt;br /&gt;
(SELECT POPRCTNM FROM POP10300 PW WHERE PW.VENDORID=P.VENDORID&lt;br /&gt;
UNION ALL&lt;br /&gt;
SELECT POPRCTNM FROM POP30300 PH WHERE PH.VENDORID=P.VENDORID)&lt;br /&gt;
&lt;br /&gt;
This returned one RCT number&lt;br /&gt;
&lt;br /&gt;
3. We went into the enter match invoices screen and entered the receipt number from 3&lt;br /&gt;
&lt;br /&gt;
4. Because the matched invoice line table had not been properly deleted, the line items showed up&lt;br /&gt;
&lt;br /&gt;
5. We entered the vendor ID and the date&lt;br /&gt;
&lt;br /&gt;
6. We clicked Delete to delete this resurrected invoice and the receipts were available for posting again&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;(We could have deleted the lines from the POP10500 but we preferred this method because its using the standard GP delete method which may adjust others things we didn&#39;t know about)&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/7097819575350265087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/02/resolved-dynamics-gp-10-po-receipt-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7097819575350265087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7097819575350265087'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/02/resolved-dynamics-gp-10-po-receipt-not.html' title='[Resolved] Dynamics GP 10 PO Receipt not showing in auto invoice screen'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-6935698908491083699</id><published>2015-01-07T06:53:00.005-08:00</published><updated>2015-01-07T06:54:14.010-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Epicor"/><title type='text'>[Resolved] Epicor 7.4 GL Journal Error after Excel Import </title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
We got the following error after importing a Journal entry into Epicor 7.4 from an Excel sheet&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-sW2FuLMfeeY/VK1FJz8212I/AAAAAAAAROU/PHfI1cOOXcg/s1600/epicorgljournalentryerrorafterexcelimport.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://1.bp.blogspot.com/-sW2FuLMfeeY/VK1FJz8212I/AAAAAAAAROU/PHfI1cOOXcg/s1600/epicorgljournalentryerrorafterexcelimport.jpg&quot; height=&quot;117&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&quot;The database record associated with this form has been updated by another user or process since you opened the record.&lt;br /&gt;
The record must be reloaded from the database to continue.&lt;br /&gt;
Close the form and reload the form from the menu.&lt;br /&gt;
Press close to continue.&quot;&lt;br /&gt;
&lt;br /&gt;
When we looked at the gltrxdet table for this journal entry, we found a duplicate sequence_id using the query below&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT *&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;FROM GLTRXDET (NOLOCK)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHERE journal_ctrl_num=&#39;x&#39;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
(x is the journal entry number)&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Because it is a duplicate, we couldn&#39;t remove the line from the front end&lt;br /&gt;
&lt;br /&gt;
To fix this, we used SQL Server Management Studio to update one of the records to have a unique sequence_id using the following query&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;update&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GLTRXDET&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;set sequence_id=(select MAX(sequence_id)+1 from GLTRXDET WHERE journal_ctrl_num=&#39;x&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHERE journal_ctrl_num=&#39;x&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;and sequence_id=y&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;and account_code=&#39;z&#39;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
(x is the journal entry number, y is the sequence_id and z is the account code in one of the two lines)&lt;br /&gt;
&lt;br /&gt;
To be very safe, I asked the user to then delete the updated line and reenter it manually.&lt;br /&gt;
&lt;br /&gt;
Once done, the entry posted correctly.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/6935698908491083699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/01/resolved-epicor-74-gl-journal-error.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6935698908491083699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6935698908491083699'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2015/01/resolved-epicor-74-gl-journal-error.html' title='[Resolved] Epicor 7.4 GL Journal Error after Excel Import '/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-sW2FuLMfeeY/VK1FJz8212I/AAAAAAAAROU/PHfI1cOOXcg/s72-c/epicorgljournalentryerrorafterexcelimport.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-3139449801072565057</id><published>2014-10-23T08:40:00.003-07:00</published><updated>2015-03-19T07:30:09.258-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SmartConnect"/><title type='text'>[Resolved] eOne Smartconnect webservice throws Could not save record error or takes long time to return a result</title><content type='html'>We kept getting the following error the first time we tried to run a Smartconnect map via the Excel add in and web service&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyryWBsSjbjybLuLWg0DcgSCiMsJ6K2sB840EJeXvQLOG0uzYCqaO5xWUtsnJL2dty4rCuMMvzNafAC7oVSfMalx5DxGV_r_chNfXlLLofgAElrpoEKEyOvphoaCJI7LgPy8WT8FhWvn4/s1600/smartconnect+webservice+error+could+not+save+record.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyryWBsSjbjybLuLWg0DcgSCiMsJ6K2sB840EJeXvQLOG0uzYCqaO5xWUtsnJL2dty4rCuMMvzNafAC7oVSfMalx5DxGV_r_chNfXlLLofgAElrpoEKEyOvphoaCJI7LgPy8WT8FhWvn4/s1600/smartconnect+webservice+error+could+not+save+record.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
It turned out to be an IIS configuration issue where it shuts down the worker processes after an idle period.&lt;br /&gt;
&lt;br /&gt;
Bringing this back up takes time which causes the issue.&lt;br /&gt;
&lt;br /&gt;
(This happened in SQL Server Reporting Services too and we found &lt;a href=&quot;http://coresql.com/2013/03/12/slow-response-on-opening-first-report-and-after-a-certain-timeout-period-or-after-ssrs-restart/&quot;&gt;this resolution for it&lt;/a&gt; which is how we realised what was going on here.)&lt;br /&gt;
&lt;br /&gt;
To resolve it, we went to the properties for the Smartconnect application pool&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKBmDDpMyDGHvjWrbyJpj1BV2wgbBs3EMRzj6E3cOi6aKU9ubCe3TB_vNApJyufuJZXQkT1OuK_30s__-Hp_KHgYrC4cAT3Z0QuncNF4MzKBTMgefwcEztiZKMkdjLsGuoGZnfvKsnZ2w/s1600/smartconnect+webservice+iis+properties.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKBmDDpMyDGHvjWrbyJpj1BV2wgbBs3EMRzj6E3cOi6aKU9ubCe3TB_vNApJyufuJZXQkT1OuK_30s__-Hp_KHgYrC4cAT3Z0QuncNF4MzKBTMgefwcEztiZKMkdjLsGuoGZnfvKsnZ2w/s1600/smartconnect+webservice+iis+properties.JPG&quot; height=&quot;320&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
and unchecked the Shutdown Worker Processes... checkbox under the Performance Tab&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYaRKlmeXZcWYN4OoGyNdi42LXS9sS1lh8ALgVyMH-ihymZfCYMIhQFS-VaFjqk9ZYHLJ8xF8BBQTlwkWnwWVxAQ6nZ0NRz6_Asg-RJ0BG48dH48ixDIx9Q10bRpmQMEEZquGZI8gRTAs/s1600/smartconnect+webservice+iis+properties+performancetab.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYaRKlmeXZcWYN4OoGyNdi42LXS9sS1lh8ALgVyMH-ihymZfCYMIhQFS-VaFjqk9ZYHLJ8xF8BBQTlwkWnwWVxAQ6nZ0NRz6_Asg-RJ0BG48dH48ixDIx9Q10bRpmQMEEZquGZI8gRTAs/s1600/smartconnect+webservice+iis+properties+performancetab.JPG&quot; height=&quot;79&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/3139449801072565057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/resolved-eone-smartconnect-webservice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/3139449801072565057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/3139449801072565057'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/resolved-eone-smartconnect-webservice.html' title='[Resolved] eOne Smartconnect webservice throws Could not save record error or takes long time to return a result'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyryWBsSjbjybLuLWg0DcgSCiMsJ6K2sB840EJeXvQLOG0uzYCqaO5xWUtsnJL2dty4rCuMMvzNafAC7oVSfMalx5DxGV_r_chNfXlLLofgAElrpoEKEyOvphoaCJI7LgPy8WT8FhWvn4/s72-c/smartconnect+webservice+error+could+not+save+record.bmp" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-5697498697860829279</id><published>2014-10-20T13:20:00.002-07:00</published><updated>2014-10-20T13:23:37.505-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SmartConnect"/><title type='text'>eOne Smartconnect How to Prompt for Company ID in the Run Map screen</title><content type='html'>&lt;span style=&quot;background-color: white;&quot;&gt;We needed a way to use the same integration for multiple companies but w&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;e also only want the user to access the Run Map menu of SmartConnect&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;This script provided a way to do both; it prompts for the Database ID before running the map&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: red; color: white;&quot;&gt;Note that there is no validation: an incorrect database ID will just throw a cannot open database error&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
1. Setup a global variable to hold the Company ID - in my case, I used GBL_DATABASE&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqm6T8mf2lWVHFuphq5W1A9FWCiDO2efWNcT_XxVdLWpR2lQyjkarmbWSDidOVo6bfAsjWKCkkoS1I2uCMipPLMv_nUfgK3QJ9YoYIXyWZMFXGcD7jML6Wtjk98INatyKgzHAZXzEJ_l4/s1600/eonesmartconnectglobalvariable.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqm6T8mf2lWVHFuphq5W1A9FWCiDO2efWNcT_XxVdLWpR2lQyjkarmbWSDidOVo6bfAsjWKCkkoS1I2uCMipPLMv_nUfgK3QJ9YoYIXyWZMFXGcD7jML6Wtjk98INatyKgzHAZXzEJ_l4/s1600/eonesmartconnectglobalvariable.JPG&quot; height=&quot;182&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
2. Go into the map you&#39;re going to use&lt;br /&gt;
3. Click on Tasks button on top&lt;br /&gt;
4. Click on Tasks that run before the map&lt;br /&gt;
5. Select Add New Task &amp;gt; Run script&lt;br /&gt;
6. Give it a name and enter the following script text&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;dim s as string&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;s=&quot;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;s = Microsoft.VisualBasic.inputBox(&quot;Company ID ?&quot;,GlobalMapDescription,&quot;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;loop until s&amp;lt;&amp;gt;&quot;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GBL_DATABASE=Microsoft.VisualBasic.left(s,5)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;return true&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgae0ce9yFbJabWXorL7nEBe6OP-3rdO07NSoEVQR3JDxyguWw40dlR70eFOb19_ALQGpW8FTjj3TcmagtyQBuTnz5k0sWtEiC7PYU0VWXzmFcQJLkmfeKlwu3EstZwKKvustW45xspnJU/s1600/eonesmartconnectscripttask.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgae0ce9yFbJabWXorL7nEBe6OP-3rdO07NSoEVQR3JDxyguWw40dlR70eFOb19_ALQGpW8FTjj3TcmagtyQBuTnz5k0sWtEiC7PYU0VWXzmFcQJLkmfeKlwu3EstZwKKvustW45xspnJU/s1600/eonesmartconnectscripttask.JPG&quot; height=&quot;98&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
7. Click Save&lt;br /&gt;
8. Click OK&lt;br /&gt;
9. Click on the Source &amp;amp; Destination Tab&lt;br /&gt;
10. Expand the destination and click on the Companies button&lt;br /&gt;
&lt;span style=&quot;background-color: red;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;11. Uncheck all the companies; if any are checked, this will not work&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
12. Click Define button&lt;br /&gt;
13. In the script text, type&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;return GBL_DATABASE&lt;/span&gt;&lt;br /&gt;
14.Click OK&lt;br /&gt;
15. Now every time you run the integration, it will prompt you for a database ID&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/5697498697860829279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/eone-smartconnect-how-to-prompt-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/5697498697860829279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/5697498697860829279'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/eone-smartconnect-how-to-prompt-for.html' title='eOne Smartconnect How to Prompt for Company ID in the Run Map screen'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqm6T8mf2lWVHFuphq5W1A9FWCiDO2efWNcT_XxVdLWpR2lQyjkarmbWSDidOVo6bfAsjWKCkkoS1I2uCMipPLMv_nUfgK3QJ9YoYIXyWZMFXGcD7jML6Wtjk98INatyKgzHAZXzEJ_l4/s72-c/eonesmartconnectglobalvariable.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-8282444103994961758</id><published>2014-10-07T08:31:00.001-07:00</published><updated>2015-01-07T06:56:09.118-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Dynamics GP SQL eConnect script to assign a group of items to a group of vendors</title><content type='html'>We assign groups of items to groups of vendors&lt;br /&gt;
&lt;br /&gt;
Dynamics GP has no easy way to do this (that I&#39;ve seen anyway)&lt;br /&gt;
&lt;br /&gt;
Here&#39;s a script that&lt;br /&gt;
1) cycles through a group of items and a group of vendors,&lt;br /&gt;
2) checks for missing associations&lt;br /&gt;
3) creates the association through eConnect stored procedure calls&lt;br /&gt;
&lt;br /&gt;
You can remove the yellow highlighted sections to make it assign all items to all vendors&lt;br /&gt;
or change them to select different groups.&lt;br /&gt;
&lt;br /&gt;
For example, LIKE &#39;A%&#39; will give you all IDs beginning with A.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @RC int&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @I_vITEMNMBR char(30)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @I_vVENDORID char(15)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @O_iErrorState int&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @oErrString varchar(255)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE vendor_cursor CURSOR FOR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;select VENDORID from PM00200 WHERE VENDORID &lt;span style=&quot;background-color: yellow;&quot;&gt;LIKE &#39;E-%&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE item_cursor SCROLL CURSOR FOR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;select ITEMNMBR from IV00101 WHERE ITEMNMBR &lt;span style=&quot;background-color: yellow;&quot;&gt;LIKE &#39;E-%&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OPEN vendor_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OPEN item_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;FETCH NEXT FROM vendor_cursor INTO @I_vVENDORID&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;BEGIN&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;FETCH FIRST FROM item_cursor INTO @I_vITEMNMBR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BEGIN&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;IF (SELECT COUNT(*) FROM IV00103 WHERE ITEMNMBR=@I_vITEMNMBR AND VENDORID=@I_vVENDORID)=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;PRINT &#39;Adding &#39;+@I_vITEMNMBR+&#39; to &#39;+@I_vVENDORID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;EXECUTE @RC = [taCreateItemVendors]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; @I_vITEMNMBR=@I_vITEMNMBR&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;,@I_vVENDORID=@I_vVENDORID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;,@O_iErrorState=@O_iErrorState OUTPUT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;,@oErrString=@oErrString OUTPUT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;FETCH NEXT FROM item_cursor INTO @I_vITEMNMBR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;END&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;FETCH NEXT FROM vendor_cursor INTO @I_vVENDORID&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;END&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CLOSE vendor_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DEALLOCATE vendor_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CLOSE item_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DEALLOCATE item_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/8282444103994961758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/dynamics-gp-sql-script-to-assign-group_7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/8282444103994961758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/8282444103994961758'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/dynamics-gp-sql-script-to-assign-group_7.html' title='Dynamics GP SQL eConnect script to assign a group of items to a group of vendors'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-3159367651242223844</id><published>2014-10-03T06:19:00.000-07:00</published><updated>2015-01-07T06:56:17.034-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Dynamics GP eConnect SQL script to assign a group of items to a group of sites</title><content type='html'>We had a requirement to assign a lot of sites to a lot of items - this is a tedious and manual process in Dynamics GP 10&lt;br /&gt;
&lt;br /&gt;
I found a useful script at&amp;nbsp;&lt;a href=&quot;http://kbase.icbconsulting.com/dynamics-gp/assign-1-inventory-item-to-every-inventory-site-using-econnect&quot;&gt;http://kbase.icbconsulting.com/dynamics-gp/assign-1-inventory-item-to-every-inventory-site-using-econnect&lt;/a&gt; but it only assigns one item at a time&lt;br /&gt;
&lt;br /&gt;
To resolve this, I created the script below which will assign multiple items to multiple sites&lt;br /&gt;
&lt;br /&gt;
The default is to assign all items to all sites&lt;br /&gt;
&lt;br /&gt;
You can modify the highlighted queries to filter the list of items or sites so that you can focus on a group of items or sites&lt;br /&gt;
&lt;br /&gt;
For example,&amp;nbsp;&lt;span style=&quot;background-color: yellow;&quot;&gt;SELECT locncode from iv40700 WHERE LOCNCODE LIKE &#39;A%&#39;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
which will only pick sites beginning with A&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @RC int&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @I_vITEMNMBR char(30)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @I_vLOCNCODE char(15)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @O_iErrorState int&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @oErrString varchar(255)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE site_cursor CURSOR FOR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;--modify the query below to change the list of sites&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;SELECT locncode from iv40700&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE item_cursor SCROLL CURSOR FOR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;--modify the query below to change the list of items&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT ITEMNMBR from IV00101&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OPEN site_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OPEN item_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;FETCH NEXT FROM site_cursor INTO @I_vLOCNCODE&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;BEGIN&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;FETCH FIRST FROM item_cursor INTO @I_vITEMNMBR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;WHILE @@FETCH_STATUS = 0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BEGIN&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;IF (SELECT COUNT(*) FROM IV00102 WHERE ITEMNMBR=@I_vITEMNMBR AND LOCNCODE=@I_vLOCNCODE)=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;PRINT &#39;Adding &#39;+@I_vITEMNMBR+&#39; to &#39;+@I_vLOCNCODE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;EXECUTE @RC = taItemSite&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; @I_vITEMNMBR=@I_vITEMNMBR&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;,@I_vLOCNCODE=@I_vLOCNCODE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;,@O_iErrorState=@O_iErrorState OUTPUT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;,@oErrString=@oErrString OUTPUT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;FETCH NEXT FROM item_cursor INTO @I_vITEMNMBR&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;END&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;FETCH NEXT FROM site_cursor INTO @I_vLOCNCODE&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;END&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CLOSE site_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DEALLOCATE site_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CLOSE item_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DEALLOCATE item_cursor&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/3159367651242223844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/dynamics-gp-sql-script-to-assign-group.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/3159367651242223844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/3159367651242223844'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/10/dynamics-gp-sql-script-to-assign-group.html' title='Dynamics GP eConnect SQL script to assign a group of items to a group of sites'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-589251808071149894</id><published>2014-09-24T06:59:00.001-07:00</published><updated>2015-01-07T06:58:15.953-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Dynamics GP SQL Script to open GL module for current fiscal period across all databases</title><content type='html'>Dynamics GP lacks an interface where we could do the same process in multiple companies at once&lt;br /&gt;
&lt;br /&gt;
We&#39;ve got some 100 companies so this is pretty tough to handle&lt;br /&gt;
&lt;br /&gt;
We schedule this script monthly to open the current month&#39;s fiscal periods so we don&#39;t have to go company by company to do it&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;declare @periodidtoopen char(2)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;declare @fiscalyear char(4)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT @periodidtoopen=month(getdate())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;select @fiscalyear=year(getdate())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @SQLstr varchar(MAX)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SET @SQLSTR=&#39;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @retstat int&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @param5 int&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;use ?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if exists ( select INTERID from DYNAMICS..SY01500 D where INTERID = &#39;&#39;?&#39;&#39; )&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/* this ia a Great Plains company db */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if exists (select year1 from SY40101 where year1=&#39;+@fiscalyear+&#39;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;/* the fiscal year exists */&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;EXEC @RETSTAT=smPeriodUpdateFinancialSeries &#39;+@periodidtoopen+&#39;, &#39;+@fiscalyear+&#39;, 0, 103, @param5 OUT&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;--print &#39;&#39;Opened fiscal period &#39;+@periodidtoopen+&#39;/&#39;+@fiscalyear+&#39; in database ? - result &#39;&#39; + cast(@retstat as varchar(2)) + &#39;&#39; - &#39;&#39; + cast(@param5 as varchar(2))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;print &#39;&#39;fiscal year &#39;+@fiscalyear+&#39; does not exist in ? &#39;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print &#39;&#39;? skipped&#39;&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;exec sp_MSforeachdb @SQLSTR&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/589251808071149894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/09/dynamics-gp-sql-script-to-open-gl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/589251808071149894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/589251808071149894'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/09/dynamics-gp-sql-script-to-open-gl.html' title='Dynamics GP SQL Script to open GL module for current fiscal period across all databases'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-6721523433114917743</id><published>2014-09-23T10:49:00.003-07:00</published><updated>2015-01-07T06:58:15.956-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Resolved GP 10 Error &quot;This document is being edited by another user&quot; when voiding sales/receivables documents</title><content type='html'>&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;We were trying to void a debit note in Dynamics GP 10 (Transactions &amp;gt; Sales &amp;gt; Posted Transactions) and and kept getting this error&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBuv3uR-cZODd_U_vPvbT6YboPA41drBYX7PbaA69AUXQYT_Ybu68NHMfDupixws9eY0CwGWqtZEzcmYynfLYTQH8VuV7qWozpONDv5ljR9cMS3rhCTyF9HwKCX2OTxrH1FUT31CDZZNc/s1600/dynamicsgpthisdocumentisbeingeditedbyanotherusererror.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBuv3uR-cZODd_U_vPvbT6YboPA41drBYX7PbaA69AUXQYT_Ybu68NHMfDupixws9eY0CwGWqtZEzcmYynfLYTQH8VuV7qWozpONDv5ljR9cMS3rhCTyF9HwKCX2OTxrH1FUT31CDZZNc/s1600/dynamicsgpthisdocumentisbeingeditedbyanotherusererror.JPG&quot; height=&quot;120&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
This document is being edited by another user&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;We checked the SY00800 and SY00801, dex_session and dex_lock tables as per the kb article but found nothing&lt;/li&gt;
&lt;li&gt;We ran a SQL Server SQL Profiler trace and saw that it was checking the RM Keys table&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Turns out it was missing a record for the debit note&amp;nbsp;&lt;/li&gt;
&lt;li&gt;We ran Checklinks on the Receivables open and history transaction files which recreated the key record and all was good after that&lt;/li&gt;
&lt;li&gt;This has been #9372 in our series &quot;Very Informative Error Messages&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHv5225OMox4pZTYXcR_4N9vcu2Vtw8NcHjXkbHZixuh73lXXtNom-i9MmOy4AfBvgalQXmELAmDs1p1IhZjG_yaIa1yDey4QSwJNg6foWxQwJd3Kx2mw-9uBB3Xnmr1yi58TFkTzXtxM/s1600/checklinks.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHv5225OMox4pZTYXcR_4N9vcu2Vtw8NcHjXkbHZixuh73lXXtNom-i9MmOy4AfBvgalQXmELAmDs1p1IhZjG_yaIa1yDey4QSwJNg6foWxQwJd3Kx2mw-9uBB3Xnmr1yi58TFkTzXtxM/s1600/checklinks.JPG&quot; height=&quot;190&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/6721523433114917743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/09/resolved-gp-10-error-this-document-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6721523433114917743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6721523433114917743'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/09/resolved-gp-10-error-this-document-is.html' title='Resolved GP 10 Error &quot;This document is being edited by another user&quot; when voiding sales/receivables documents'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBuv3uR-cZODd_U_vPvbT6YboPA41drBYX7PbaA69AUXQYT_Ybu68NHMfDupixws9eY0CwGWqtZEzcmYynfLYTQH8VuV7qWozpONDv5ljR9cMS3rhCTyF9HwKCX2OTxrH1FUT31CDZZNc/s72-c/dynamicsgpthisdocumentisbeingeditedbyanotherusererror.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-5934579190155740937</id><published>2014-07-04T07:30:00.002-07:00</published><updated>2014-07-09T11:45:40.745-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Speciality Software"/><title type='text'>A-PDF Content Splitter Service Handle Leak Workaround</title><content type='html'>The A-PDF Content Splitter Service has a serious handle leak that crashed our server after a few weeks of being on&lt;br /&gt;
&lt;br /&gt;
While waiting for them to resolve the issue, we worked around it by scheduling a restart of the service every morning&lt;br /&gt;
&lt;br /&gt;
1. Create a batch file with the following text&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;net stop &quot;A-PDF Content Service&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;net start &quot;A-PDF Content Service&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. Create a scheduled task to run the batch file&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-jkHVFJ6zxtU/U7bVz05_fUI/AAAAAAAAOm8/YUUQyL7g3es/s1600/restart+apdf.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://4.bp.blogspot.com/-jkHVFJ6zxtU/U7bVz05_fUI/AAAAAAAAOm8/YUUQyL7g3es/s1600/restart+apdf.JPG&quot; height=&quot;350&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/5934579190155740937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/07/a-pdf-content-splitter-service-handle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/5934579190155740937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/5934579190155740937'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/07/a-pdf-content-splitter-service-handle.html' title='A-PDF Content Splitter Service Handle Leak Workaround'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-jkHVFJ6zxtU/U7bVz05_fUI/AAAAAAAAOm8/YUUQyL7g3es/s72-c/restart+apdf.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-3792096193620824859</id><published>2014-07-04T07:25:00.000-07:00</published><updated>2014-07-09T11:45:40.742-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Speciality Software"/><title type='text'>A-PDF Content Splitter Service Solution Design and Rules setup</title><content type='html'>We use the A-PDF Content Splitter service software to split PDFs that are generated from multiple legacy systems that cannot for one reason or another support the code change required to generate separate PDFs for each customer&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;It is a fantastic piece of software for $99 dollars; we asked our local preferred vendor to do something similar for just one type of invoice and were quoted in the 10K to 20K range&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
It lets you select a section of text in a page and split the file when that text changes&lt;br /&gt;
&lt;br /&gt;
For example, if the file has the invoice number in the top left, you can select it and have the PDF split into a separate file every time it changes&lt;br /&gt;
&lt;br /&gt;
It will also let you name the file based on the text that changes&lt;br /&gt;
&lt;br /&gt;
So we will get INV100.PDF INV101.PDF from a single INVOICES.PDF&lt;br /&gt;
&lt;br /&gt;
The service part of it can be set to watch a folder and the split will automatically be done into another folder&lt;br /&gt;
&lt;br /&gt;
This way users don&#39;t need to do anything: they just save the file into one folder, wait and look in the other folder for the split files.&lt;br /&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://www.a-pdf.com/content-splitter-service/a-pdf-content-splitter-service-doc.pdf&quot;&gt;setup documentation here &lt;/a&gt;is fairly easy but one of the things is glosses over is rules setup. Here&#39;s how you do it:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Download the trial version of the A-PDF Content Splitter&lt;/li&gt;
&lt;li&gt;Setup the rule&lt;/li&gt;
&lt;li&gt;Go to&amp;nbsp;C:\Documents and Settings\&amp;lt;username&amp;gt;\Local Settings\Application Data\A-PDF\Content Split\Rules&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;where&amp;nbsp;&amp;lt;username&amp;gt; is your current Windows username&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;You will see the rules you saved there&lt;/li&gt;
&lt;li&gt;Copy the rule to&amp;nbsp;C:\Documents and Settings\All Users\Application Data\A-PDF\PDFSplit\Rules&lt;/li&gt;
&lt;li&gt;Now when you click on the Add Folder, the rule you just will appear in the Rules dropdown&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;The service has one bug we found: a handle leak that we worked around by having the service restart daily. &lt;a href=&quot;http://enterprise-dynamics.blogspot.com/2014/07/a-pdf-content-splitter-service-handle.html&quot;&gt;See here for more details.&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/3792096193620824859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/07/a-pdf-content-splitter-service-solution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/3792096193620824859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/3792096193620824859'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/07/a-pdf-content-splitter-service-solution.html' title='A-PDF Content Splitter Service Solution Design and Rules setup'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-7269875411708654125</id><published>2014-06-26T08:18:00.001-07:00</published><updated>2015-01-07T06:58:39.616-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>SQL Script to compare two Dynamics GP 10 users&#39; security roles and company access </title><content type='html'>&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;declare @fromuserid nvARCHAR(max)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;declare @touserid nvARCHAR(max)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;declare @cmpanyid int&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;set @fromuserid = &#39;lessonuser1&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;set @touserid = &#39;lessonuser2&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;set @cmpanyid = -1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT (select cmpnynam from DYNAMICS..SY01500 where cmpanyid=s.cmpanyid) as missingcompany&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;FROM DYNAMICS..SY60100 s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHERE&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;USERID=@fromuserid&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;and cmpanyid not in&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(select cmpanyid from DYNAMICS..SY60100 WHERE USERID =@touserid)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT @touserid,1,SECURITYROLEID as missingrole&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;FROM DYNAMICS..SY10500 WHERE&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;cmpanyid=@cmpanyid and&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;USERID =@fromuserid and&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SECURITYROLEID not in (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT SECURITYROLEID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;FROM DYNAMICS..SY10500 WHERE USERID =@touserid&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AND cmpanyid=@cmpanyid )&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/7269875411708654125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/06/sql-script-to-compare-two-dynamics-gp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7269875411708654125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7269875411708654125'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/06/sql-script-to-compare-two-dynamics-gp.html' title='SQL Script to compare two Dynamics GP 10 users&#39; security roles and company access '/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-977413824730007775</id><published>2014-05-23T09:08:00.002-07:00</published><updated>2014-05-23T09:17:41.226-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SmartConnect"/><title type='text'>Resolved - Smartconnect Error Processing failed for rows matching ...</title><content type='html'>One of the values in a numeric field of a query was null&lt;br /&gt;
&lt;br /&gt;
I replaced the field in the query with the following&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;ISNULL(field,0) as field&lt;br /&gt;
&lt;br /&gt;
and the integration ran correctly&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/977413824730007775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/05/resolved-smartconnect-error-processing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/977413824730007775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/977413824730007775'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/05/resolved-smartconnect-error-processing.html' title='Resolved - Smartconnect Error Processing failed for rows matching ...'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-7289454126136590891</id><published>2014-05-06T06:39:00.000-07:00</published><updated>2014-05-23T09:17:47.310-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Dynamics GP 10 Receivables Aged Trial Balance with Collection Management Notes in Excel</title><content type='html'>1. Create the stored procedure below in the GP company&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;@hatbdate should be in yyyy.mm.dd format&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE PROCEDURE [dbo].[hatb]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@hatbdate nvarchar(255)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;as&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;set nocount on&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @stored_proc_name char(36)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @retstat int&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DECLARE @param46 int&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE TABLE #hatb2163311 (CUSTNMBR char(15) NOT NULL, DSCRIPTN char(31) NOT NULL, AGNGDATE datetime NOT NULL CHECK (DATEPART(hour,AGNGDATE) = 0 and DATEPART(minute,AGNGDATE) = 0 and DATEPART(second,AGNGDATE) = 0 and DATEPART(millisecond,AGNGDATE) = 0), DEX_ROW_ID int identity NOT NULL)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALTER TABLE #hatb2163311 ADD CONSTRAINT PK#hatb2163311 PRIMARY KEY NONCLUSTERED (DSCRIPTN, CUSTNMBR)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE TABLE #hatb0003411 (CUSTNMBR char(15) NOT NULL, CHCUMNUM char(15) NOT NULL, DOCNUMBR char(21) NOT NULL, RMDTYPAL smallint NOT NULL, DSCRIPTN char(31) NOT NULL, CURNCYID char(15) NOT NULL, ORTRXAMT numeric(19,5) NOT NULL, CURTRXAM numeric(19,5) NOT NULL, AGNGBUKT smallint NOT NULL, CASHAMNT numeric(19,5) NOT NULL, COMDLRAM numeric(19,5) NOT NULL, SLSAMNT numeric(19,5) NOT NULL, COSTAMNT numeric(19,5) NOT NULL, FRTAMNT numeric(19,5) NOT NULL, MISCAMNT numeric(19,5) NOT NULL, TAXAMNT numeric(19,5) NOT NULL, DISAVAMT numeric(19,5) NOT NULL, DISTKNAM numeric(19,5) NOT NULL, WROFAMNT numeric(19,5) NOT NULL, TRXDSCRN char(31) NOT NULL, DOCABREV char(3) NOT NULL, CHEKNMBR char(21) NOT NULL, DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), GLPOSTDT datetime NOT NULL CHECK (DATEPART(hour,GLPOSTDT) = 0 and DATEPART(minute,GLPOSTDT) = 0 and DATEPART(second,GLPOSTDT) = 0 and DATEPART(millisecond,GLPOSTDT) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), POSTDATE datetime NOT NULL CHECK (DATEPART(hour,POSTDATE) = 0 and DATEPART(minute,POSTDATE) = 0 and DATEPART(second,POSTDATE) = 0 and DATEPART(millisecond,POSTDATE) = 0), DINVPDOF datetime NOT NULL CHECK (DATEPART(hour,DINVPDOF) = 0 and DATEPART(minute,DINVPDOF) = 0 and DATEPART(second,DINVPDOF) = 0 and DATEPART(millisecond,DINVPDOF) = 0), CURRNIDX smallint NOT NULL, XCHGRATE numeric(19,7) NOT NULL, ORCASAMT numeric(19,5) NOT NULL, ORSLSAMT numeric(19,5) NOT NULL, ORCSTAMT numeric(19,5) NOT NULL, ORDAVAMT numeric(19,5) NOT NULL, ORFRTAMT numeric(19,5) NOT NULL, ORMISCAMT numeric(19,5) NOT NULL, ORTAXAMT numeric(19,5) NOT NULL, ORCTRXAM numeric(19,5) NOT NULL, ORORGTRX numeric(19,5) NOT NULL, ORDISTKN numeric(19,5) NOT NULL, ORWROFAM numeric(19,5) NOT NULL, DENXRATE numeric(19,7) NOT NULL, MCTRXSTT smallint NOT NULL, Aging_Period_Amount numeric(19,5) NOT NULL, DEX_ROW_ID int identity NOT NULL)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALTER TABLE #hatb0003411 ADD CONSTRAINT PK#hatb0003411 PRIMARY KEY NONCLUSTERED (RMDTYPAL, DOCNUMBR)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE UNIQUE INDEX AK1#hatb0003411 ON #hatb0003411 (CUSTNMBR, CURNCYID, DSCRIPTN, DEX_ROW_ID)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE UNIQUE INDEX AK2#hatb0003411 ON #hatb0003411 (CURNCYID, DSCRIPTN, DEX_ROW_ID)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE TABLE #hatb0463411 (APFRDCNM char(21) NOT NULL, APFRDCTY smallint NOT NULL, FROMCURR char(15) NOT NULL, APTODCNM char(21) NOT NULL, APTODCTY smallint NOT NULL, APPTOAMT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, DATE1 datetime NOT NULL CHECK (DATEPART(hour,DATE1) = 0 and DATEPART(minute,DATE1) = 0 and DATEPART(second,DATE1) = 0 and DATEPART(millisecond,DATE1) = 0), POSTED tinyint NOT NULL, DISTKNAM numeric(19,5) NOT NULL, WROFAMNT numeric(19,5) NOT NULL, PPSAMDED numeric(19,5) NOT NULL, GSTDSAMT numeric(19,5) NOT NULL, CURRNIDX smallint NOT NULL, XCHGRATE numeric(19,7) NOT NULL, RLGANLOS numeric(19,5) NOT NULL, ORAPTOAM numeric(19,5) NOT NULL, ORDISTKN numeric(19,5) NOT NULL, ORWROFAM numeric(19,5) NOT NULL, DENXRATE numeric(19,7) NOT NULL, MCTRXSTT smallint NOT NULL, DEX_ROW_ID int identity NOT NULL) &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ALTER TABLE #hatb0463411 ADD CONSTRAINT PK#hatb0463411 PRIMARY KEY NONCLUSTERED (APFRDCNM, APFRDCTY, APTODCNM, APTODCTY)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE UNIQUE INDEX AK1#hatb0463411 ON #hatb0463411 (APTODCTY, APTODCNM, APFRDCTY, APFRDCNM, DEX_ROW_ID)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT @stored_proc_name = &#39;rmHistoricalAgedTrialBalance&#39;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;EXEC @retstat = @stored_proc_name&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;#hatb2163311&#39;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;#hatb0003411&#39;, &#39;#hatb0463411&#39;, &#39;&#39;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;--&#39;2012.03.31&#39;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@hatbdate,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&#39;&#39;, &#39;þþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþþþþþþþ&#39;, &#39;&#39;, &#39;þþþþþþþþþþþþþþþþþþþþþ&#39;, 1, 1, 0, &#39;1900.01.01&#39;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;--&#39;2012.03.31&#39;,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;@hatbdate,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;0, 1, 0, 1, 1, 0, 1, 0, &#39;CAD&#39;, 1, 0, 0.0000000, 1, 2, 0, @param46 OUT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(SELECT CMPNYNAM FROM DYNAMICS..SY01500 WHERE INTERID=DB_NAME()) as [Business Line],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;C.CUSTNAME as [Customer Name],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;HATB.CUSTNMBR as [Customer ID],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;convert(varchar, HATB.DOCDATE, 101) as [Document Date],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;HATB.DOCNUMBR as [Document Number],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;HATB.CURNCYID as [Currency],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;HATB.CURTRXAM as [Current Amount],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=1 THEN HATB.CURTRXAM ELSE 0 END AS [Current],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=2 THEN HATB.CURTRXAM ELSE 0 END AS [1 - 30 Days],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=3 THEN HATB.CURTRXAM ELSE 0 END AS [31 - 60 Days],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=4 THEN HATB.CURTRXAM ELSE 0 END AS [61 - 90 Days],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=5 THEN HATB.CURTRXAM ELSE 0 END AS [91 - 180 Days],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=6 THEN HATB.CURTRXAM ELSE 0 END AS [181 - 360 Days],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: yellow; font-family: Courier New, Courier, monospace;&quot;&gt;case when HATB.AGNGBUKT=7 THEN HATB.CURTRXAM ELSE 0 END AS [361+ Days],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;C.SLPRSNID as [Salesperson],&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;(SELECT TOP 1 CONVERT(VARCHAR,DATE1+TIME1,101)+&#39;-&#39;+RTRIM(USERID)+&#39;-&#39;+RTRIM(NOTE_DISPLAY_STRING) FROM CN00100 WHERE CUSTNMBR=hatb.CUSTNMBR ORDER BY DATE1+TIME1 DESC)as [Most Recent Coll Note]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;FROM #hatb0003411 hatb, RM00101 C&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;WHERE C.CUSTNMBR=HATB.CUSTNMBR&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;order by C.CUSTNAME, docdate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GRANT EXECUTE ON HATB TO DYNGRP&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GO&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The @hatbdate parameter should be in yyyy.mm.dd format&lt;br /&gt;
&lt;br /&gt;
3. You can modify the yellow highlighted portion to match your aging periods&lt;br /&gt;
&lt;br /&gt;
4. Use the steps documented here (&lt;a href=&quot;http://datapigtechnologies.com/blog/index.php/running-a-sql-stored-procedure-from-excel-with-dynamic-parameters/&quot;&gt;http://datapigtechnologies.com/blog/index.php/running-a-sql-stored-procedure-from-excel-with-dynamic-parameters/&lt;/a&gt;) to have Excel run the stored procedure inside a spreadsheet&amp;nbsp;(Note: the @hatbdate parameter should be in the format yyyy.mm.dd)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
5. Create an SSRS report to run the stored procedure above and export to Excel&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/7289454126136590891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/05/run-dynamics-gp-10-receivables-aged.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7289454126136590891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7289454126136590891'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/05/run-dynamics-gp-10-receivables-aged.html' title='Dynamics GP 10 Receivables Aged Trial Balance with Collection Management Notes in Excel'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-7878752505578416363</id><published>2014-04-29T12:56:00.001-07:00</published><updated>2014-04-29T13:08:04.991-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SmartConnect"/><title type='text'>Resolved - Smartconnect SQL Table Destination Error Column Name appears more than once in the result column list</title><content type='html'>I received the following error when trying to import a CSV file into a SQL table&lt;br /&gt;
&lt;br /&gt;
Error processing&amp;nbsp;Tenant SQL Server: XXXX&amp;nbsp;Database: XXXX&amp;nbsp;Column Name &#39;XXXX&#39; appears more than once in the result column list&lt;br /&gt;
&lt;br /&gt;
Everything looked fine in the mapping&lt;br /&gt;
&lt;br /&gt;
When I ran a SQL Trace using Profiler, it showed that, for each line, there was one insert being done correctly followed by another insert that repeated the table field names twice in the values&lt;br /&gt;
&lt;br /&gt;
After messing around a bit, in the Data Source section, I added all the fields in the CSV file to the Key Fields list.&lt;br /&gt;
&lt;br /&gt;
This for some god knows what reason fixed the issue!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/7878752505578416363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/04/resolved-eone-smartconnect-sql-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7878752505578416363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/7878752505578416363'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/04/resolved-eone-smartconnect-sql-table.html' title='Resolved - Smartconnect SQL Table Destination Error Column Name appears more than once in the result column list'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-4844285198759158166</id><published>2014-04-02T07:32:00.000-07:00</published><updated>2014-04-02T07:32:50.156-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Dynamics GP Audit Software for larger enterprises</title><content type='html'>First, I don&#39;t even know why I need to write this - any ERP worth its salt should have good audit trails built in. Maybe GP 2013 is better but GP 10, which we are on for the foreseeable future, is very limited.&lt;br /&gt;
&lt;br /&gt;
So the tools we are choosing in between then are Rockton Auditor (&lt;a href=&quot;http://www.rocktonsoftware.com/products.aspx?p=1&quot;&gt;http://www.rocktonsoftware.com/products.aspx?p=1&lt;/a&gt;) and Fastpath (&lt;a href=&quot;http://www.gofastpath.com/products/audit-trail.aspx&quot;&gt;http://www.gofastpath.com/products/audit-trail.aspx&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
We used this Comparison of Dynamics GP Audit Trail Solutions (&lt;a href=&quot;http://www.iconsa.net/descargas/files/Audit%20Trail%20Comparison.pdf&quot;&gt;http://www.iconsa.net/descargas/files/Audit%20Trail%20Comparison.pdf&lt;/a&gt;) as a base&lt;br /&gt;
&lt;br /&gt;
Both tools seem to have a good, wide base of installed users.&lt;br /&gt;
&lt;br /&gt;
The differentiators for us, so far anyway:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Pricing wise, based on our number of users, &lt;b&gt;Rockton works out to roughly double Fastpath&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Rockton requires rollout to each workstation. You can track at the SQL database level but then the table names are not friendly names but the physical SQL ones.&amp;nbsp;Fastpath runs on the server and doesn&#39;t require client rollout. &lt;b&gt;This is important as we have something like 100+ workstations that have GP clients.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Rockton runs through Smartlist which is slow for large datasets. Fastpath has its own audit trail viewer which is much more efficient.&lt;/li&gt;
&lt;li&gt;The segregation of duties audit component of Rockton is a simple GP report that flags potential issues. Fastpath&#39;s highlights it but also gives you the option to approve the specific conflict (which is logged) and remove it from future audits.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;We also liked Fastpath&#39;s active directory integration (an additional module) which allows single sign on for our users. This means new employees who require it will get GP access along with their AD credentials and will never get locked out or forget passwords or require password changes.&lt;/li&gt;
&lt;li&gt;Rockton has an impressive sounding electronic signature / approval module which can make the creation of vendors, GL accounts, etc require approval from a supervisor. However, it appears that the user who creates is stuck on the screen till the supervisor approves making this useful for smaller companies but not for us.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;Overall, our impression of Rockton Auditor was that it was a good product for smaller businesses but not quite enterprise ready. Fastpath&#39;s suite of products is feels more enterprise-y and, more importantly, actually is more enterprise-y, so that is what we went with.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/4844285198759158166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/04/selecting-dynamics-gp-audit-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/4844285198759158166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/4844285198759158166'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/04/selecting-dynamics-gp-audit-software.html' title='Dynamics GP Audit Software for larger enterprises'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-9120496969427304175</id><published>2014-03-31T06:59:00.000-07:00</published><updated>2014-06-26T08:08:40.593-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Business Technology"/><title type='text'>Why we consciously decoupled from our old ERP system</title><content type='html'>&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Our ERP is old and cruddy and we need to replace it. Unfortunately, our ecosystem of business applications has, as Gwyneth Paltrow would say, become unconsciously coupled. Because of this, the risk and work involved in upgrading or changing ERPs has become quite significant.&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
For example, the workflow application we use for expenses
and requisitions was custom built. Both workflows read data from the ERP
through direct database calls. For some reason, the expense workflow sends
transactions through the ERP’s web service but the requisition workflow sends
transactions to the ERP via SQL stored procedure calls. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Our financial reporting engine is owned but no longer
supported by the ERP software company and also does direct reads from the ERP
database. Our integration tool was custom built and again sends transactions to
the ERP via SQL stored procedure calls.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Our budget/forecasting system reads data from the ERP,
though how exactly is a mystery to the latter day Indiana Jones’s we’ve
sent to spelunk through the forgotten temples of doom/SSIS packages that
comprise the integration. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;To get out of this cycle of dependency and risk, we started introducing a more SOA&amp;nbsp;compliant&amp;nbsp;business system architecture, replacing the existing customizations with off the shelf systems and making &amp;nbsp;the integration points more&amp;nbsp;loosely coupled. In GOOP-speak, we began the process of conscious decoupling.&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We started with the integrations, bringing in off the shelf
integration software and a data warehouse based financial
reporting tool that can work with most ERPs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We’re now selecting an off the shelf expense and requisition
management software that can work with any ERP and
planning a rewrite of the budget/forecasting integration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Our goal next year is to be able to upgrade or replace the
ERP system. We’re happy enough with the ERP that we might go to the next
version but our ever growing corporate requirements may dictate a new, bigger ERP
altogether.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Removing the tight
integration between the software in our ecosystem will greatly reduce the risk
in either decision. As a bonus, we are not as dependent on the vendor who wrote the original code for the customizations.&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Apparently,
unconscious decoupling is supposed to start a year before the official
decoupling. As you can see, it’s no different with ERP systems.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/9120496969427304175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/how-we-consciously-decoupled-from-our.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/9120496969427304175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/9120496969427304175'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/how-we-consciously-decoupled-from-our.html' title='Why we consciously decoupled from our old ERP system'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-6449370207105254056</id><published>2014-03-25T08:32:00.003-07:00</published><updated>2014-03-27T07:01:02.838-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Resolved - Dynamics GP Integration Manager 10 integration and query export issues</title><content type='html'>We&#39;re switching to SmartConnect for all our&amp;nbsp;integration&amp;nbsp;soon but we still have a few legacy Integration Manager 10&amp;nbsp;integration&amp;nbsp;that we fix/modify in the test environment.&lt;br /&gt;
&lt;br /&gt;
During one of these times, I had multiple issues exporting an integration into a IM database - queries didn&#39;t get created, etc.&lt;br /&gt;
&lt;br /&gt;
To resolve it, I setting the destination database as the default integration database (Tools &amp;gt; Options) and imported the integration instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/6449370207105254056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/resolved-integration-manager-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6449370207105254056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6449370207105254056'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/resolved-integration-manager-10.html' title='Resolved - Dynamics GP Integration Manager 10 integration and query export issues'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-6484973723828462578</id><published>2014-03-10T09:12:00.002-07:00</published><updated>2014-03-24T06:48:13.418-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BI360"/><title type='text'>BI360 Report of accounts missing from account tree</title><content type='html'>&lt;div&gt;
We use BI360 for our reporting and it has been a marked improvement over our old FRx product&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
One of the things we always worry about though is new natural accounts that were missed from the natural account tree&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We set this SQL query up as a nightly SSRS report that we subscribe to&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This way, it emails us whenever there&#39;s a problem&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT code,description,accounttype,DEBITCREDIT,ACCOUNTCATEGORY,CREATEDTIME,UDF1 FROM BI360DW..d_account where&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;code not in (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT childcode FROM BI360DW..tree_structure_account)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;and accounttype IN (&#39;PLC&#39;,&#39;BLC&#39;) -- only PL and BS accounts&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;and isnumeric(code)=1 -- no non GL accounts&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;and active=1&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
In our version of SSRS, there&#39;s no way to stop the report being emailed if it is blank. We use the following workaround to stop it from running if there&#39;s no records returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;(SELECT count(*) FROM BI360DW..d_account where&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;code not in (&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SELECT childcode FROM&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;BI360DW..tree_structure_account)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and accounttype IN (&#39;PLC&#39;,&#39;BLC&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and isnumeric(code)=1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;AND SUBSTRING(CODE,1,1)&amp;lt;&#39;9&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and active=1)=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;RAISERROR (&#39;No Records Found&#39;,16,1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;SELECT &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;Code,Description,AccountType,DebitCredit,AccountCategory,Created&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;Time,UDF1 FROM BI360DW..d_account where&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;code not in (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;SELECT childcode FROM BI360DW..tree_structure_account)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and accounttype IN (&#39;PLC&#39;,&#39;BLC&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and isnumeric(code)=1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;AND SUBSTRING(CODE,1,1)&amp;lt;&#39;9&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and active=1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/6484973723828462578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/bi360-report-of-accounts-missing-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6484973723828462578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/6484973723828462578'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/bi360-report-of-accounts-missing-from.html' title='BI360 Report of accounts missing from account tree'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-581400760890821489.post-190290389131335726</id><published>2014-03-04T07:38:00.004-08:00</published><updated>2014-03-21T08:37:33.516-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Dynamics GP"/><title type='text'>Log of checks printed in Dynamics GP with vendor remit to addresses</title><content type='html'>&lt;br /&gt;
We had to get the check list with the vendor remit to address for an RBC (Royal Bank of Canada) Payee Match export process we were building&lt;br /&gt;
&lt;br /&gt;
Since we use Mekorma MICR, the ME27645 table does include check printing information for most checks.&amp;nbsp;We used that to populate the majority.&lt;br /&gt;
&lt;br /&gt;
About 25% were not there, however.&amp;nbsp;For these, since Dynamics GP does not include a check log, we had to recreate it using the following query&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.DOCNUMBR,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.DOCAMNT AS CHEKTOTL,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.DOCDATE,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.VENDORID,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.VNDCHKNM,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ADDRESS1,ADDRESS2,ADDRESS3,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CITY,[STATE],ZIPCODE,COUNTRY&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;FROM&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;PM30200 TH,PM30300 THA,PM30200 TH2,PM00300 VA&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;WHERE&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.VCHRNMBR=THA.VCHRNMBR &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;AND THA.APTVCHNM=TH2.VCHRNMBR&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AND TH2.VADCDTRO=VA.ADRSCODE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AND TH2.VENDORID=VA.VENDORID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AND ISNUMERIC(TH.DOCNUMBR)=1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AND TH.DOCTYPE=6&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AND TH.ELECTRONIC=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;AND TH.voided=0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;GROUP BY&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.DOCNUMBR,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.DOCAMNT,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.DOCDATE,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.VENDORID,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;TH.VNDCHKNM,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ADDRESS1,ADDRESS2,ADDRESS3,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CITY,[STATE],ZIPCODE,COUNTRY&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This does depend on the remit to address not changing between the check printing and the Payee Match export&lt;br /&gt;
&lt;br /&gt;
However, since the time elapsed between the two events is minimal, we chose to accept the possibility of false flags and went with this solution&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;a href=&quot;http://enterprise-dynamics.blogspot.com/&quot;&gt;Enterprise Dynamics: Business Technology and Dynamics GP in larger enterprises&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://enterprise-dynamics.blogspot.com/feeds/190290389131335726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/log-of-checks-printed-in-dynamics-gp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/190290389131335726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/581400760890821489/posts/default/190290389131335726'/><link rel='alternate' type='text/html' href='http://enterprise-dynamics.blogspot.com/2014/03/log-of-checks-printed-in-dynamics-gp.html' title='Log of checks printed in Dynamics GP with vendor remit to addresses'/><author><name>Foodie</name><uri>http://www.blogger.com/profile/07923230209685215650</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>