<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Massive Dynamics NAV</title>
	<link>http://mibuso.com/blogs/massivedynamicsnav</link>
	<description>What Don't We Do?</description>
	<pubDate>Wed, 16 Jan 2013 07:21:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Deleting data in many tables - quick and easy</title>
		<link>http://mibuso.com/blogs/massivedynamicsnav/2009/11/22/delete-data-in-many-tables-quick-and-easy/</link>
		<comments>http://mibuso.com/blogs/massivedynamicsnav/2009/11/22/delete-data-in-many-tables-quick-and-easy/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 07:54:48 +0000</pubDate>
		<dc:creator>gerdhuebner</dc:creator>
		
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://mibuso.com/blogs/massivedynamicsnav/2009/11/22/deleting-data-in-many-tables-quick-and-easy/</guid>
		<description><![CDATA[When you are going live with a NAV database environment at your customer&#8217;s you may be in a situation where it is necessary to delete some data your customer has played around the preceeding months (may be ledger entries, sales line, &#8230;) but you don&#8217;t want to delete some other data which you or your [...]]]></description>
			<content:encoded><![CDATA[<p>When you are going live with a NAV database environment at your customer&#8217;s you may be in a situation where it is necessary to delete some data your customer has played around the preceeding months (may be ledger entries, sales line, &#8230;) but you don&#8217;t want to delete some other data which you or your customer has already prepared for the live scenario (master data,&#8230;). In this situations where it is necessary to delete all data in certain and may be many tables, it would be nice to have a tool. This tool should be as easy as possible. It should not be necessary to use additional tables or complicated setup to delete the desired table data. In fact NAV already provides a tool to setup table data - the user rights management. The idea is as follows: Setup a user role, let&#8217;s call it _DELETE_DATA and supply this user role with appropriate delete permissions for the table data you want to delete. Then run a simple report (using a RecordRef) to delete the data.</p>
<p>So let&#8217;s start with this. When you setup the user role you have got two possibilities. You can either add each table data to delete manually (this would be the way to go, if the number of tables is not to great) or you can start with all table datas to delete and remove the delete permission from those tables you don&#8217;t want to delete data. To do it the second way you first will have to comprise a line like this:<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/11/pic10.jpg" title="pic10.jpg"></a><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/11/pic10.jpg" title="pic10.jpg"><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/11/pic10.thumbnail.jpg" alt="pic10.jpg" /></a><br />
Then after clicking at &#8220;All Objects&#8221;, you can remove the delete permission from those tables, you don&#8217;t want to delete data.<br />
Now here is the simple report you will have to run finally in order to delete the data.�<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/11/report98001.txt" title="report98001.txt">report98001.txt</a><br />
The report will work very quickly (because of the DELETEALL and no performing of DELETE-triggers), but you might need SUPER-user rights in order to delete some data (the permissions of the role _DELETE_DATA are not checked by the NAV permission management system, since the user role is not assigned to any login). Nevertheless be careful when deleting data. Note that you are using the code on this site at your own risk. No liabilty can be taken from the author.</p>
<p><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/11/pic10.jpg" title="pic10.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mibuso.com/blogs/massivedynamicsnav/2009/11/22/delete-data-in-many-tables-quick-and-easy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to use Job Queue in NAV Client</title>
		<link>http://mibuso.com/blogs/massivedynamicsnav/2009/10/15/how-to-use-job-queue-in-nav-client/</link>
		<comments>http://mibuso.com/blogs/massivedynamicsnav/2009/10/15/how-to-use-job-queue-in-nav-client/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 17:35:43 +0000</pubDate>
		<dc:creator>gerdhuebner</dc:creator>
		
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://mibuso.com/blogs/massivedynamicsnav/2009/10/15/how-to-use-job-queue-in-a-nav-client/</guid>
		<description><![CDATA[As is well known, the Job Queue functionality of NAV is only intended to be used from an application server. Though this module is part of BE and AM edition, it can not be used from the scratch from within a GUI NAV Client. But unfortunately some jobs will not work when they are started from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic6.jpg" title="pic6.jpg"></a><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic7.jpg" title="pic7.jpg"></a>As is well known, the Job Queue functionality of NAV is only intended to be used from an application server. Though this module is part of BE and AM edition, it can not be used from the scratch from within a GUI NAV Client. But unfortunately some jobs will not work when they are started from an application server service. For example it is not possible to run dataports or use the HYPERLINK command from application server. Furthermore, some automation servers will not work. For that reason, it is sometimes useful to do a small customization, which enables the Job Queue functionality to be used from a self starting NAV client running on a server.<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic61.jpg" title="pic61.jpg"><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic61.jpg" alt="pic61.jpg" /></a></p>
<p><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic6.jpg" title="pic6.jpg"></a></p>
<p>There exists already a similar functionality for doing background jobs from within a normal NAV client, namely the E-Mail logging functionality which is launched in the LogInStart function of codeunit 1:<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic71.jpg" title="pic71.jpg"><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic71.jpg" alt="pic71.jpg" /></a><br />
So it is only straightforward to implement a similar functionality for the job queue. At first we define a &#8220;Job Queue User ID&#8221; in the &#8220;Job Queue Setup&#8221; table (don&#8217;t forget to provide validate and lookup functionality for the field as you can find in table &#8220;Marketing Setup&#8221;):<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic8.jpg" title="pic8.jpg"><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic8.jpg" alt="pic8.jpg" /></a></p>
<p>It is advantegeous to choose a windows login as &#8220;Job Queue User ID&#8221;, because a windows login can be configured to start a NAV client automatically, when windows is started.</p>
<p>All what is left is to put some code into codeunit 1 in order to start the job queue scheduler, when the &#8220;Job Queue User ID&#8221; logs in:<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic91.jpg" title="pic91.jpg"><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic91.jpg" alt="pic91.jpg" /></a><br />
So every time the &#8220;Job Queue User&#8221; logs in, the global scheduler codeunit is started in the background to check periodically for jobs to perform. Don&#8217;t forget to supply the &#8220;Job Queue User&#8221; with appropriate rights to perform his jobs. But as the NAV client session is always accesible from the console, the user should not have too much rights. For example it is often unnecessary to grant rights to any forms, object designer, etc&#8230;.</p>
<p><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/10/pic8.jpg" title="pic8.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mibuso.com/blogs/massivedynamicsnav/2009/10/15/how-to-use-job-queue-in-nav-client/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating and managing individual Online Help</title>
		<link>http://mibuso.com/blogs/massivedynamicsnav/2009/08/29/creating-and-managing-individual-online-help/</link>
		<comments>http://mibuso.com/blogs/massivedynamicsnav/2009/08/29/creating-and-managing-individual-online-help/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 08:18:18 +0000</pubDate>
		<dc:creator>gerdhuebner</dc:creator>
		
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://mibuso.com/blogs/massivedynamicsnav/2009/08/29/creating-and-managing-individual-online-help/</guid>
		<description><![CDATA[As is well known, the extension of the standard online help of NAV is a little bit elaborate (I wonder how many customizations have found their way into the standard online help, at all&#8230;). So it would be nice to have an easy way to write one&#8217;s own online help may be with word, etc., [...]]]></description>
			<content:encoded><![CDATA[<p>As is well known, the extension of the standard online help of NAV is a little bit elaborate (I wonder how many customizations have found their way into the standard online help, at all&#8230;). So it would be nice to have an easy way to write one&#8217;s own online help may be with word, etc., put some explanations and screenshots into it, save it as a pdf file and make it public to all NAV clients in an easy way. With the following idea this can be accomplished even for end users, i. e., a system administrator of a company using NAV can write its own online help documents for forms and/or reports and make them available for other NAV users. All you need is: a form/report designer, an additional table (lets call it &#8220;Online Help Document&#8221;) with an additional tabular form (&#8221;Online Help Documents&#8221;), a codeunit (&#8221;Online Help Management&#8221;) and some programming, which has to be done with a C/AL license. You can supply a form or a report with an additional (individual) help button or replace the standard help button on new forms, by simply copy and paste the button from an already supplied form, e. g. - The individual help button may look like this:</p>
<p><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/08/pic4.jpg" alt="pic4.jpg" /></p>
<p>I prefer to use a special background color (cyan) in order to show the user, that there is an individual online help available.<br />
In the OnPush trigger of the button there is just one line of code:</p>
<p> <img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/08/pic5.jpg" alt="pic5.jpg" /></p>
<p>So the button can be easily copied from one form to another (or from one report request form to another report&#8217;s request form). For use with reports, of course, the line of code has to be modified to</p>
<p>OnlineHelpMgt.ShowDocument(Object.Type::Report,CurrReport.OBJECTID);</p>
<p>Important is, that the variables are defined as local variables, so they are copied by the copy and paste process even with a &#8220;normal&#8221; form designer license.</p>
<p>As one might have guessed already, the data structure of the table &#8220;Online Help Document&#8221; should at least be something like this:</p>
<p>1. Object Type - Option (only Form and Report makes sense)<br />
2. Object ID - Text (!), since CurrForm.OBJECTID gives a text<br />
3. Document - Blob (contains the help document to show, e.g. in PDF format)</p>
<p>The primary key should be Object Type + Object ID. May be you should provide some Lookup functionality for field 2. Some additional fields may be useful, for example &#8220;Original document&#8221; - Blob (may be in word format), &#8220;Description&#8221;, &#8220;Creation Date&#8221;, etc.</p>
<p>In codeunit &#8220;Online Document Management&#8221; you will have to implement some functions like ShowDocument, ImportDocument, ExportDocument, etc. - the latter two will be provided in the corresponding tabular form in a Function-MenuButton. Some code suggestions may be taken from table 5062 Attachment, where analogous functions exist.</p>
<p>Needless to say, that the whole tool can be purchased from our company.</p>
]]></content:encoded>
			<wfw:commentRss>http://mibuso.com/blogs/massivedynamicsnav/2009/08/29/creating-and-managing-individual-online-help/feed/</wfw:commentRss>
		</item>
		<item>
		<title>User rights management with negative permissions</title>
		<link>http://mibuso.com/blogs/massivedynamicsnav/2009/07/11/user-rights-management-with-negative-permissions/</link>
		<comments>http://mibuso.com/blogs/massivedynamicsnav/2009/07/11/user-rights-management-with-negative-permissions/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 17:59:03 +0000</pubDate>
		<dc:creator>gerdhuebner</dc:creator>
		
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://mibuso.com/blogs/massivedynamicsnav/2009/07/11/user-rights-management-with-negative-permissions/</guid>
		<description><![CDATA[As is well known, user rights in NAV are granted via user roles and their permissions. These permissions (Table 2000000005) can be set up for objects (Table, Form, Report, &#8230;) and for Table Data. The standard application comes along with predefined roles and permissions for various tasks. These predefined roles mainly contain permissions for Table Datas, except [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pic1.jpg" title="Standard execute permission grant for all forms."></a><a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pig2.jpg" title="No access grant for form “G/L Account Card”"></a>As is well known, user rights in NAV are granted via user roles and their permissions. These permissions (Table 2000000005) can be set up for objects (Table, Form, Report, &#8230;) and for Table Data. The standard application comes along with predefined roles and permissions for various tasks. These predefined roles mainly contain permissions for Table Datas, except for the special role &#8220;ALL&#8221; which grants Execute permission to all object types. This role &#8220;ALL&#8221; is intended to be granted to all users (except SUPER users). Indeed it would be too complex and painful to establish user rights on object level so in most installations user rights are only distinguished on Table Data level. But this leads to some problems in real environments. In my every day experience I&#8217;m often encountering requests from customers like this: &#8220;There is no problem, if anybody can read all table data, except general ledger.&#8221; - Ok, this is understandable, why should an official comprising sales offers have a deep look into the balances of G/L accounts? But sometimes it is necessary to enter a G/L account no. into a sales line in order to bill freight, e. g. - so, inevitably, the user must have read access to Table 15 (G/L Account), in order to do this. But with this read access he can call the &#8220;G/L Account List&#8221; from a sales line (via Lookup in No. field) and from there it&#8217;s easy to branch to the &#8220;G/L Account Card&#8221; where he can see the balance. So how can one put paid to this? On the one hand, the user needs (at most) indirect read access to the &#8220;G/L Entry&#8221; table, in order to post the invoice, on the other hand, if he&#8217;s got that right, he can easily spy out the balance on every &#8220;G/L Account&#8221;, which his boss wants to be prohibited&#8230;</p>
<p>There are several possible approaches to this problem:<br />
1.) The programmer might say: &#8220;Well, let&#8217;s remove the &#8220;dangerous&#8221; menu items from the &#8220;G/L Account List&#8221;. I would call this the &#8220;quick and dirty&#8221; solution. The main disadvantage is of course, that now nobody can branch from the list to the card, anymore, not even the users, who might want to do that. Another aspect is, that this approach would violate the fundamental policy &#8220;As much customizing as necessary and as less as possible.&#8221;</p>
<p>2.) The sophisticated programmer might say: &#8220;OK, let&#8217;s put a flag into the &#8220;User Setup&#8221; table to control which user may open the &#8220;G/L Account Card&#8221; and which user may not do that. Besides the fact that this approach would mean even more customizing, it is in some respect even dirtier (though not quicker) than approach 1, because one is forced to manage user rights once in the standard way (with roles and permissions for table data) and once again in the &#8220;User Setup&#8221; table with one (or more) flags for various objects (forms, report,..) - Remember that the &#8220;G/L Account Card&#8221; was only an example for an object, which should be disabled for certain users.</p>
<p>3.) The &#8220;setup manager&#8221; might say: &#8220;Well, NAV provides standard capabilities to handle the problem. You simply have to define in the respective roles, which forms the role should grant access permission and which form not.&#8221; - Unfortunately this approach turns out to become an outgrowth, mainly because of the fact that if you want to grant access to all forms, this can be done with one record in the permission table, containing zero in the field &#8220;Object ID&#8221;:<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pic1.jpg" title="Standard execute permission grant for all forms."><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pic1.thumbnail.jpg" alt="Standard execute permission grant for all forms." /></a><br />
But if you want to exclude only one form from access you have to list all other forms, which you want grant access to. In other words: there is nothing like &#8220;negative permissions&#8221; in standard NAV. The disadvantages are on the one hand, that the whole rights setup will become monstrous and intransparent, on the other hand, each time a new form (or other object) is appended to the application, it has to be added to the respective roles. -</p>
<p>Although things would be so easy, if one could set up an access denial (for form &#8220;G/L Account Card&#8221;, e. g.) by simply adding a permission line like this,<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pig2.jpg" title="No access grant for form “G/L Account Card”"><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pig2.thumbnail.jpg" alt="No access grant for form “G/L Account Card”" /></a><br />
unfortunately this line is ignored by the system, and access to form &#8220;G/L Account Card&#8221; is still granted with this additional line.</p>
<p>And here comes my proposal for the more or less short time until negative permissions will become standard in NAV (as they are already in Windows, e. g.). The idea is to have a general mechanism which prohibits the carrying out of an object (form, report, etc.) if a negative permission (as in the picture above) is active for a user&#8217;s role. With that mechanism working, the problem above can be easliy solved like this: Create a new user role named NO_GL, e. g. - Add a permission line with no execute right for form 17 to that new role (like in the picture above). Assign the new role to all users, who shall not be able to open the &#8220;G/L Account Card&#8221;. Later this role can be extended easily to prohibit access to other &#8220;dangerous&#8221; forms, which are accesible from the &#8220;G/L Account List&#8221; form, like &#8220;G/L Account Balance&#8221;, etc.</p>
<p>How would we implement this new mechanism in a straightforward and easy to use manner? Obviously there is no way off from putting some code into the OnOpenForm Trigger of the forms we want to protect. For reports, we would choose the OnInitReport trigger, instead. This code should be as short as possible (because we may need to supply many forms with it) and it should lead to an access deny error, which is ideally identical to the standard error, if a user has got no access rights to an object:<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pig3.jpg" title="Standard access denial error message for a specific form."><img src="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/pig3.thumbnail.jpg" alt="Standard access denial error message for a specific form." /></a></p>
<p>Now, here is a Codeunit &#8220;Permission Management&#8221; with a function CheckExecutePermission to be called as soon as possible, when running an object:<br />
<a href="http://mibuso.com/blogs/massivedynamicsnav/files/2009/07/codeunit71600.txt" title="Codeunit 71600 “Permission Management”">Codeunit 71600 “Permission Management”</a><br />
The text object file is to be imported into NAV 2009. A similar approach should be possible for earlier versions of NAV.<br />
To secure the form &#8220;G/L Account Card&#8221; against unauthorized opening, the following line of code has to be inserted into its OnOpenForm trigger:<br />
<em>PermissionMgt.CheckExecutePermission(2,17);<br />
</em>here 2 stands for object type Form and 17 is the ID of the form. <em>PermissionMgt</em> is a codeunit variable.<br />
In this manner every object can be protected by using corresponding permission lines with negative execute permissions.<br />
In order that every user can execute the code above one additional right has to be added to the user role ALL, namely Read permission for table 2000000009 (Session).</p>
]]></content:encoded>
			<wfw:commentRss>http://mibuso.com/blogs/massivedynamicsnav/2009/07/11/user-rights-management-with-negative-permissions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
