RSS

Monthly Archives: February 2009

Tip: Copy pasting error screens

Something simple but some people don’t know this is possible.

When you get an error message in NAV (or any error screen in Windows) you can just simply press Ctrl+C to place the text of this error screen in the clipboard.
Something worth mentioning to customers so they don’t have to make screenshots every time and send them to your Customer Support.

Say the customer gets an error in NAV when posting an order.

They would usually send the error screen to the CS like this:

Location Code mandatory
What the user could have done was just press Ctrl+C when focusing on the error screen and just paste it in a mail.
The result would be:
—————————
Microsoft Business Solutions-Navision
—————————
You must specify Location Code in Sales Line Document Type=’Order’,Document No.=’VO704282′,Line No.=’10000′.
—————————
OK  
—————————
Could save you some diskspace ;-)
 
Leave a comment

Posted by on February 13, 2009 in NAV

 

Tags: ,

CRM 4.0 Merge tool

A new tool has been released for merging CRM customizations.

Worth the download if you ask me!

Read all about it in this post.

 
Leave a comment

Posted by on February 13, 2009 in CRM 4

 

Tags:

Get the current assembly path in ASP.NET

The get the current assembly’s path you could execute this code to get the current path:

Assembly.GetExecutingAssembly().Location

 

This code will return the directory where the assembly is curently located. For an ASP.NET application this will be “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”.

To get the path of the assembly as it is installed (ex. c:\inetpub\wwwroot\<myapp>\bin) execute this code:

 

Path.GetDirectoryName(Assembly.GetAssembly(typeof(<myclass>)).CodeBase)

 

 
Leave a comment

Posted by on February 5, 2009 in .NET

 

Tags:

Wow6432 Registry key on x64 machine

When you look at the registy of a x64 System you will notice that there are some keys in there called Wow6432Node. These keys are there for 32-bit applications.
Basically if you have a 32-bit application that is reading from the registry in the key “HKEY_LOCAL_MACHINE\SOFTWARE\<company>\<product>”
it is actually reading from “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\<company>\<product>”.

You can turn of this behaviour in your code by using dllimport and so on. pretty complicated.  Read all about it here.
A simple work arround ofcourse is to store you registry settings in the Wow6432Node.

 
3 Comments

Posted by on February 5, 2009 in .NET

 

Tags:

ASPX extension is missing in IIS

Before you can use ASPX pages in an IIS website you need to enable this Webservice Extension in IIS.
If you install IIS after the .NET framework was installed, it is likely that the ASPX extension is not registered in IIS.

To register it manually run the aspnet_regiis.exe application in the .NET framework folder.

Replace the <framework version> with the correct verion.

c:\Microsoft.NET\FRAMEWORK\<framework version>\aspnet_regiis.exe -i

NOTE: If you are running a x64 OS you will need to configure IIS so that is will run 32-bit applications. If not, the apsnet_regiis application will not work. An error message stating “The error indicates that IIS is in 64 bit mode, while this application is a 32 bit application and thus not compatible.”

To enable to run 32-bit applications on 64-bit Windows

1. Open a command prompt and navigate to the C:\Inetpub\AdminScripts directory.
2. Type the following command:

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true

3. Press ENTER.
 
Leave a comment

Posted by on February 5, 2009 in .NET

 

Tags:

Custom ASPX assemblies

Custom ASPX assemblies can now be placed in the ISV/<yourapp>/bin folder due to Update Rollup 2.

Read more about it in this post

 
Leave a comment

Posted by on February 5, 2009 in CRM 4

 

Tags: ,

Refreshing a parent window when crmForm.IsDirty

When you try to refresh the parent window from an ISV page and the crmForm was
modified but not saved, you will get a confirmation dialog from CRM asking you
to continue or cancel the action.

To disable this behaviour you can Save the CRM form before the refresh action.

This seems to be standard CRM behaviour. You can try this when modifying an
account and then deactivating it. The new values will be saved automatically and
the account will be deactivated.

Put the following code in the OnInit of the aspx page:

protected override void OnInit(EventArgs e)
{
// Check if the crmForm was modified.
Response.Write(“<script>” + “\n”);
Response.Write(“if (window.dialogArguments.document.crmForm.IsDirty == true)” + “\n”);
Response.Write(“{“ + “\n”);

Response.Write( window.dialogArguments.crmForm.Save();” + “\n”);
Response.Write(“}” + “\n”);
Response.Write(“</script>;”);

base.OnInit(e);
}

Regards,

Kenny

 
1 Comment

Posted by on February 3, 2009 in CRM 4

 

Tags: , ,

Hidden buttons reappear when resizing a crmForm

In a previous post  I described how to hide custom buttons in a toolbar.
When a CRM form is resized by the user it appear that these hidden buttons will show up again.

To avoid this behaviour you should put your code into a global function and attach this function to the resize event of the window.

Example:

This code should be placed in the onload of the form.

HideButton = function()
{
var ULListItems = document.getElementById(“mnuBar1″).rows[0].cells[0].getElementsByTagName(“UL”)[0].getElementsByTagName(“LI”);
for(var i=0; i -1)
{
ULListItems[i].style.display = “none”;
}
}
}

// Execute the function when loading the form
HideButton();

// Execute the function when the form is resized.
window.onresize = HideButton;

 
1 Comment

Posted by on February 3, 2009 in CRM 4

 

Tags: ,

Read-Only fields don’t get saved in the database.

A short one today!! 

When changing the value of a read-only field with JavaScript the new value will not be saved into the database.
To save the newvalue set the ForceSubmit property of the field to true.

crmForm.all.new_customfield.ForceSubmit = true;

Now the new value will also be saved into the database.

 
2 Comments

Posted by on February 3, 2009 in CRM 4

 

Tags:

Navision Application Server does not start: The Breakpoints already exists.

Sometimes a NAS tends to hang when there are breakpoints present in the database.

The following message will be displayed in the event viewer:

The Breakpoints already exists. 

Identification fields and values:
Object ID=’50001′,Object Type=’Form’,Trigger Line=’4′,Code No=’7′

To avoid this message you can simply delete all the breakpoints in NAV before running the NAS.

You can do this in either the object that is run by the specific NAS or in the NASHandler trigger of codeunit 1.

Simply add a line like “recBreakpoint.DELETEALL” where recBreakpoint points to a Record variable of the virtual Breakpoint table.

 
Leave a comment

Posted by on February 3, 2009 in NAV

 

Tags: , ,

 
Follow

Get every new post delivered to your Inbox.