<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://vstoolsforum.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Dynamics GP</title><subtitle type="html">Notes, Tips and Tricks on Developing in Dynamics GP</subtitle><id>http://vstoolsforum.com/blogs/dynamicsgp/atom.aspx</id><link rel="alternate" type="text/html" href="http://vstoolsforum.com/blogs/dynamicsgp/default.aspx" /><link rel="self" type="application/atom+xml" href="http://vstoolsforum.com/blogs/dynamicsgp/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20611.960">Community Server</generator><updated>2010-01-20T15:34:00Z</updated><entry><title>Script to insert a line into the batch table (SY00500)</title><link rel="alternate" type="text/html" href="http://vstoolsforum.com/blogs/dynamicsgp/archive/2010/03/10/script-to-insert-a-line-into-the-batch-table-sy00500.aspx" /><id>http://vstoolsforum.com/blogs/dynamicsgp/archive/2010/03/10/script-to-insert-a-line-into-the-batch-table-sy00500.aspx</id><published>2010-03-10T13:21:00Z</published><updated>2010-03-10T13:21:00Z</updated><content type="html">&lt;p&gt;This isn&amp;#39;t set to work against all modules, but if you look and see what&amp;#39;s going on, it can be easily adopted. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre style="overflow: scroll; background-color: #f2f2f2;"&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt; &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- =============================================&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- Steve Gray&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- 4Penny.net&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- 941-747-3669&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- =============================================&lt;/span&gt;


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;IF&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;SELECT&lt;/span&gt; name 
       &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;FROM&lt;/span&gt;   &lt;span style="color: LawnGreen;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;sysobjects&lt;/span&gt; 
       &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;WHERE&lt;/span&gt;  name = N&lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'_4P_sy00500_UPD'&lt;/span&gt; 
       &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;AND&lt;/span&gt;    type = &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'P'&lt;/span&gt;)
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;DROP&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;PROCEDURE&lt;/span&gt; _4P_sy00500_UPD
GO


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;CREATE&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;PROCEDURE&lt;/span&gt; _4P_sy00500_UPD


&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--  _4P_sy00500_UPD 'import','RM_Sales', 'sgray',3&lt;/span&gt;


@vchrBatchNumber &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(15),
@bchsourc &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(15),
@vchrUserID &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(15) ,
@intSeries &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;int&lt;/span&gt; = 3


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;AS&lt;/span&gt;


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @currDocAmount &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;as&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;money&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @intDocCount &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;as&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;int&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @dtDate &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;as&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;datetime&lt;/span&gt;


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @dtDate = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;convert&lt;/span&gt;(&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(10), &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;getdate&lt;/span&gt;(),101)


&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--============================================================================&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- create the batch, if necessary&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--============================================================================&lt;/span&gt;


&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--see if the batch exists&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;not&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;exists&lt;/span&gt; (&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; dex_row_id 
                    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; sy00500 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock) 
                    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber 
                        &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; bchsourc = @bchsourc)
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;insert&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;into&lt;/span&gt; sy00500 (GLPOSTDT,  BCHSOURC  ,BACHNUMB        ,  SERIES    ,  MKDTOPST,  NUMOFTRX,  RECPSTGS,  DELBACH,  MSCBDINC,  BACHFREQ,  RCLPSTDT  ,  NOFPSTGS,  BCHCOMNT,  BRKDNALL,  CHKSPRTD,  RVRSBACH,  USERID     ,  CHEKBKID      ,  BCHTOTAL,  BCHEMSG1,  BCHEMSG2,  BACHDATE  ,  BCHSTRG1,  BCHSTRG2,  POSTTOGL,  MODIFDT,  CREATDDT,  NOTEINDX,  CURNCYID,  BCHSTTUS,  CNTRLTRX,  CNTRLTOT,  PETRXCNT,  APPROVL,  APPRVLDT,  APRVLUSERID,  ORIGIN,  ERRSTATE,  GLBCHVAL,  Computer_Check_Doc_Date,  Sort_Checks_By,  SEPRMTNC,  REPRNTED,  CHKFRMTS,  TRXSORCE,  PmtMethod,  EFTFileFormat) 
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;values&lt;/span&gt;          (@dtDate ,  @bchsourc ,@vchrBatchNumber,  @intSeries,  0       ,  0       ,  0       ,  0      ,  0       ,  1       ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'1/1/1900'&lt;/span&gt;,  0       ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;''&lt;/span&gt;      ,  0       ,  0       ,  0       ,  @vchrUserID,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'ST OPERATING'&lt;/span&gt;,  0.00    ,  0       ,  0       ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'1/1/1900'&lt;/span&gt;,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;''&lt;/span&gt;      ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;''&lt;/span&gt;      ,  0       ,  @dtDate,  @dtDate ,  0       ,  0       ,  0       ,  0       ,  0       ,  0       ,  0      ,  @dtDate ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;''&lt;/span&gt;         ,  1     ,  0       ,  0       ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'1/1/1900'&lt;/span&gt;             ,  0             ,  0       ,  0       ,  0       ,  &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;''&lt;/span&gt;      ,  0        ,  1)


 


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @intDocCount = 0
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @currDocAmount = 0


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; @bchsourc = &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'Sales Entry'&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
    &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--get the number of docs and the sum&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; 
            @intDocCount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;count&lt;/span&gt;(docamnt), 
            @currDocAmount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;isnull&lt;/span&gt;(&lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;sum&lt;/span&gt;(docamnt),0)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; sop10100 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber
            &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; voidstts = 0
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt; 
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; @bchsourc = &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'RM_Sales'&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
    &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--get the number of docs and the sum&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; 
            @intDocCount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;count&lt;/span&gt;(docamnt), 
            @currDocAmount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;isnull&lt;/span&gt;(&lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;sum&lt;/span&gt;(dbo.f_4p_Modifier2(docamnt, rmdtypal)),0)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; rm10301 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt; 
       
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; @bchsourc = &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'IV_Trxent'&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; 
            @intDocCount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;count&lt;/span&gt;(trxqtytl), 
            @currDocAmount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;sum&lt;/span&gt;(trxqtytl)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; iv10000 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber
    
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; @bchsourc = &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'PM_Trxent'&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; 
            @intDocCount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;count&lt;/span&gt;(DOCAMNT), 
            @currDocAmount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;sum&lt;/span&gt;(DOCAMNT)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; pm10000 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber
      


&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--update the batch with that info&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; @currDocAmount = 0 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;delete&lt;/span&gt; sy00500
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; bchsourc = @bchsourc
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;else&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;update&lt;/span&gt; sy00500 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; 
            numoftrx = @intDocCount, 
            nofpstgs = 0, 
            bchtotal = @currDocAmount
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; bachnumb = @vchrBatchNumber &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; bchsourc = @bchsourc
    
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt;         



GO


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;grant&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;all&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;on&lt;/span&gt; _4P_sy00500_UPD &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;to&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;public&lt;/span&gt;


 &lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;&lt;img src="http://vstoolsforum.com/aggbug.aspx?PostID=2407" width="1" height="1"&gt;</content><author><name>Steve Gray</name><uri>http://vstoolsforum.com/members/Steve-Gray.aspx</uri></author></entry><entry><title>Script to increment the next SOP number</title><link rel="alternate" type="text/html" href="http://vstoolsforum.com/blogs/dynamicsgp/archive/2010/03/05/script-to-increment-the-next-sop-number.aspx" /><id>http://vstoolsforum.com/blogs/dynamicsgp/archive/2010/03/05/script-to-increment-the-next-sop-number.aspx</id><published>2010-03-05T15:35:00Z</published><updated>2010-03-05T15:35:00Z</updated><content type="html">&lt;p&gt;This will work in most any module with small modifications. &lt;/p&gt;
&lt;p&gt;It will return the next SOP number&lt;/p&gt;
&lt;p&gt;To run, execute it in a company database. At the top of the procedure is a comment section, edit the values for DOCID and SOPTYPE and execute those four lines&lt;/p&gt;
&lt;p&gt;&lt;pre style="overflow: scroll; background-color: #f2f2f2;"&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- =============================================&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- Steve Gray&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- 4Penny.net&lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- &lt;/span&gt;
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- =============================================&lt;/span&gt;


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;IF&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;SELECT&lt;/span&gt; name 
       &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;FROM&lt;/span&gt;   &lt;span style="color: LawnGreen;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;sysobjects&lt;/span&gt; 
       &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;WHERE&lt;/span&gt;  name = N&lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'FP_getNextOrderNumber'&lt;/span&gt; 
       &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;AND&lt;/span&gt;    type = &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'P'&lt;/span&gt;)
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;DROP&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;PROCEDURE&lt;/span&gt; FP_getNextOrderNumber
GO


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;CREATE&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;PROCEDURE&lt;/span&gt; FP_getNextOrderNumber 


&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;/*


declare @DOCID varchar(15), @sopnumbe varchar(21), @soptype int
select @DOCID = 'STANDARD', @sopnumbe = '', @soptype = 3


execute FP_getNextOrderNumber @DOCID, @sopnumbe = @sopnumbe output, @SOPTYPE = @soptype
select @sopnumbe,@@trancount


*/&lt;/span&gt;



@DOCID &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(15),
@sopnumbe &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(21) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;output&lt;/span&gt;,
@SOPTYPE &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;int&lt;/span&gt;


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;AS&lt;/span&gt;
    
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @intPos &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;int&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @vchrSopnumbeBegin &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(21)
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @vchrSopnumbeEnd &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(21)
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @vchrSopnumbeNew &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(21)
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @vchrTemp &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(21)
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @intTemp &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;int&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @intRowCount &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;int&lt;/span&gt;



&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- turn off the rowcount display&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;nocount&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;on&lt;/span&gt;


&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--get a new sop number&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;declare&lt;/span&gt; @blnOKtoExit &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;bit&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @blnOKtoExit = 0


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;tran&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;while&lt;/span&gt; @blnOKtoExit = 0
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--assume that this is all going to work&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @blnOKtoExit = 1


        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; 
                @sopnumbe = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;rtrim&lt;/span&gt;(sopnumbe)
            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; sop40200  &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (TABLOCKX &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;HOLDLOCK&lt;/span&gt;)
            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; docid = @DOCID
                &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; soptype = @soptype


        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--loop through the sopnumber backwards, find the first non-numeric character.&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @intPos = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;len&lt;/span&gt;(@sopnumbe)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;while&lt;/span&gt; &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;isnumeric&lt;/span&gt;(&lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;substring&lt;/span&gt;(@sopnumbe,@intPos,1)) = 1
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @intPos = @intPos - 1
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt;


        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--get the numeric portion       &lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @vchrSopnumbeEnd = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;right&lt;/span&gt;(&lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;rtrim&lt;/span&gt;(@sopnumbe),&lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;len&lt;/span&gt;(@sopnumbe) - @intPos)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @vchrSopnumbeBegin = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;left&lt;/span&gt;(@sopnumbe,@intPos)
        
        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--convert to int&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @intTemp = @vchrSopnumbeEnd


        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--increment&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @intTemp = @intTemp + 1
        
        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--stick the new number back on the prefix&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @vchrSopnumbeEnd = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;right&lt;/span&gt;(&lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'000000000000000000000000000'&lt;/span&gt; + &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;convert&lt;/span&gt;(&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;varchar&lt;/span&gt;(21),@intTemp),&lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;len&lt;/span&gt;(@sopnumbe) - @intPos)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @vchrSopnumbeNew = @vchrSopnumbeBegin + @vchrSopnumbeEnd
        
        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--update sop40200       &lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;update&lt;/span&gt; sop40200 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; sopnumbe = @vchrSopnumbeNew &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; docid = @DOCID &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; sopnumbe = @sopnumbe


        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;-- if there is no rowcount, do it again&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @intRowCount = &lt;span style="color: Fuchsia;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;@@rowcount&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; @intRowCount = 0 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @blnOKtoExit = 0
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt;


        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--make sure this number is not already assigned&lt;/span&gt;
        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--be sure that an index exists in sop10100 for this&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;exists&lt;/span&gt; (&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; sopnumbe &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; sop10100 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; sopnumbe = @sopnumbe &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; soptype = @soptype) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @blnOKtoExit = 0
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt; 


        &lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--be sure that an index exists in sop30200 for this&lt;/span&gt;
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;if&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;exists&lt;/span&gt; (&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;select&lt;/span&gt; sopnumbe &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;from&lt;/span&gt; sop30200 &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;with&lt;/span&gt; (nolock) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;where&lt;/span&gt; sopnumbe = @sopnumbe &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;and&lt;/span&gt; soptype = @soptype) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;begin&lt;/span&gt;
            &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;set&lt;/span&gt; @blnOKtoExit = 0
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt; 
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;end&lt;/span&gt;


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;commit&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;tran&lt;/span&gt;


 


GO


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;grant&lt;/span&gt; &lt;span style="color: Silver;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;all&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;on&lt;/span&gt; FP_getNextOrderNumber &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;to&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;public&lt;/span&gt;



    
&lt;span style="color: Teal;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;--select * from sop40200&lt;/span&gt;



 &lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;&lt;img src="http://vstoolsforum.com/aggbug.aspx?PostID=2406" width="1" height="1"&gt;</content><author><name>Steve Gray</name><uri>http://vstoolsforum.com/members/Steve-Gray.aspx</uri></author></entry><entry><title>GP10: Cannot access this form because the dictionary containing it is not loaded</title><link rel="alternate" type="text/html" href="http://vstoolsforum.com/blogs/dynamicsgp/archive/2010/01/20/gp10-cannot-access-this-form-because-the-dictionary-containing-it-is-not-loaded.aspx" /><id>http://vstoolsforum.com/blogs/dynamicsgp/archive/2010/01/20/gp10-cannot-access-this-form-because-the-dictionary-containing-it-is-not-loaded.aspx</id><published>2010-01-20T20:34:00Z</published><updated>2010-01-20T20:34:00Z</updated><content type="html">Cannot access this form because the dictionary containing it is not loaded 
&lt;p&gt;Two issues:&lt;/p&gt;
&lt;p&gt;Go into Tools &amp;gt; Setup &amp;gt; System &amp;gt; Alternate/Modified Forms and Reports, select a user, select a product, select &amp;#39;Windows&amp;#39;. Set all security back to the default form. &lt;/p&gt;
&lt;p&gt;Go into Tools &amp;gt; Utilities &amp;gt; System &amp;gt; Reconcile and reconcile &amp;#39;Security Assignment Alternate/Modified Operations&lt;/p&gt;
&lt;p&gt;That&amp;#39;ll fix it. &lt;/p&gt;&lt;img src="http://vstoolsforum.com/aggbug.aspx?PostID=2365" width="1" height="1"&gt;</content><author><name>Steve Gray</name><uri>http://vstoolsforum.com/members/Steve-Gray.aspx</uri></author></entry></feed>