21 October 2009

Extend "Team Members" features in Team Explorer - Visual Studio 2008

If you need more Information about Team Members and their activitys in TFS check the Team Foundation Server Power Tools. They contain enhancements, tools and command-line utilities to get more out of the TFS. A very nice Feature ist the Team Members Node where you can see what your Team is doing and what they have checked in. Check this Post for a detailed information.

Visual Studio 2010 - Beta 2

Visual Studio 2010 and .NET Framework 4 Beta 2 is ready for download:

http://msdn.microsoft.com/de-de/vstudio/dd582936.aspx

09 October 2009

Create a new Numbersequence for an existing Module

Although there are some good post about this online I post another short instruction bout "How to create a NumberSequence" here:
  1. create an EDT - in this Example we call it MyNewNumberSeqId
  2. Edit the loadModule Method of the NumberSeqReference_... Class of your Module add this code
    numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(MyNewNumberSeqId));
    numRef.configurationKeyId      = configurationkeynum(ABCBasic);
    numRef.ReferenceHelp           = literalstr("@ABC123");
    numRef.WizardContinuous        = true;
    numRef.WizardManual            = NoYes::No;
    numRef.WizardAllowChangeDown   = NoYes::No;
    numRef.WizardAllowChangeUp     = NoYes::No;
    numRef.SortField               = 1;
    this.create(numRef);
  3. create a new method in the ParametersTable of the Module - For Example SalesParameters
    public client server static NumberSequenceReference numRefMyNewNumberSeqId()
    {
        ;
    
        return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(MyNewNumberSeqId)));
    }
  4. done
to use this NumberSequence create a numberSeq object and call its num method. I often call this method in the insert of the Datasource in which the NumberSequence is used:
public void insert()
{
    NumberSeq  numberSeq;
    ;
    if (this.MyNewNumberSeqId== "")
    {
        numberSeq = NumberSeq::newGetNum(SalesParameters::numRefMyNewNumberSeqId());
        this.MyNewNumberSeqId= numberSeq.num();
    }
    super();
}

Dynamics AX, BING & Language Translation from Arijit Basu

Found this interesting Post on Arijit Basus Blog:

Microsoft Dynamics AX: Dynamics AX, BING & Language Translation - Arijit Basu | Dynamics AX MVP

In this Post Arijit Basu describes how to interact with the BING Translation API to translate text in AX. Nice Idea :)

06 October 2009

View deleted Objects in Source Control Explorer of Team Foundation Server

If you need to undeleted an Item that has been deleted on TFS you need to enable the checkbox "Show deleted items in the Source Control Explorer" which can be found in the Options: Tools > Options > Source Control > Visual Studio Team Foundation.


Now you can see deleted Items in the Source Control Explorer. If you need to undelete one of them, just right click and selct undelete on this item. This change must be checked in than.

14 September 2009

AX - Windows Surface - Warehouse Commander

Just found this interesting demonstration of a Windows Surface application which provides the ability to analyse and manage a warehouse with easy fingertips and gestures. In combination with dynamics ax this would be a great tool for visual inteaction with the warehouse management:

http://silverlight.interknowlogy.com/Videos/WarehouseCommander/default.html

04 September 2009

Access - VBA Code - Easy log file craetion

If you need to create log files from VBA Code in Access you can use the following code to manage the logging.
Option Compare Database
Option Explicit

Public Function writeLog(text As String)
    'Logdatei leicht gemacht
    'by c0bRa
    'Variablendeklaration
    Dim fs As Object, f As Object
   
    Set fs = CreateObject("Scripting.FileSystemObject")
    On Error Resume Next
    'Pfad erstellen, falls nicht vorhanden
    MkDir Application.CurrentProject.Path & "\Log\"
    On Error GoTo writeLognummer1
    'Datei öffnen, wenn nicht vorhanden, erstellen
    Set f = fs.OpenTextFile(Application.CurrentProject.Path & "\Log\" & _
                            Format(Date, "yyyy-MM-dd") & ".log", 8, -2)
    GoTo writeLognummer2
 
writeLognummer1:
    On Error GoTo writeLognummer2
    Set f = fs.CreateTextFile(Application.CurrentProject.Path & "\Log\" & _
                              Format(Date, "yyyy-MM-dd") & ".log", True)
writeLognummer2:
    On Error GoTo 0
    If text = "" Then
        f.Write vbCrLf
      Else
        f.Write "«" & Time & "» " & text & vbCrLf
    End If
    f.Close
End Function
This code creates a Folder called Log if it doesn't exist and creates a log file for every day.
You can call the logging from within your code with this short command.
writeLog "Dies ist ein Testtext"
The code is from a guy called c0bRa - thanks for that :)

31 August 2009

Intel Graphic - Rotate / Flip Screen shortcut

I just found the following shortcuts to flip or rotate the screen.

Just press
STRG + ALT + Arrow Keys:
  • UP : rotate 0° (normal position)
  • RIGHT: rotate 270°
  • DOWN: rotate 180°
  • LEFT: rotate 90°
These shortcuts should work with many of the newer Intel Graphic Chipsets when the original drivers are installed.

11 August 2009

Dynamics AX Search

Dynamics AX Suche

10 August 2009

numberSeqFormHandler

if you need to use a numberSequence in a form you can use the numberSeqFormHandler. Therefor you have to add a new method to the form an overwrite some methods of the datasource, as mentioned below. 1. Add in ClassDeclaration
NumberSeqFormHandler numberSequence; 
2. Add a new method for the numberSeqFormHandler on the form
NumberSeqFormHandler numberSeqFormHandler()
{
    if (!numberSequence)
    {
        numberSequence = numberSeqFormHandler::newForm(
            NumberSequenceReference::find(
                typeId2extendedTypeId(typeID(__EDT_NumSeqId__))).NumberSequence,
            element, __Table_DS,
            fieldNum(__Table__, __NumSeqId__));
    }
    
    return numberSequence;
}
3. Override the datasource method create() / delete() / write() / validateWrite()
public void create(boolean _append = false)
{
    super(_append);
    element.numberSeqFormHandler().formMethodDataSourceCreate();
}

public void write()
{
    ttsbegin;
    super();
    element.numberSeqFormHandler().formMethodDataSourceWrite();
    ttscommit;
}

public boolean validateWrite()
{
    boolean ret;
    ;
    ret = super();
    ret = ret && element.numberSeqFormHandler().formMethodDataSourceValidateWrite();
    return ret;
}

public void delete()
{
    ttsbegin;
    element.numberSeq().formMethodDataSourceDelete();
    super();
    ttscommit;
}

public void linkActive()
{
    element.numberSeqFormHandler().formMethodDataSourceLinkActive();
    super();
}
And remeber that continuous number sequences can only be used in transactions (between ttsbegin; and ttscommit;)

05 August 2009

AX: View the executed query - SQL Statement

Back from Holiday :) If you need to find out which query will be executed just past this this code after the super in the executeQuery Method.
super();
...
info(this.query().dataSourceNo(1).toString()); 

or 

info(this.query().dataSourceName("inventTrans").toString()); 

16 July 2009

First post via mail about Dynamics AX

If you need a special Dimension from the Dimensions Table a very easy
way to get it would be a new EDT as shown in the screenshot which has
a normal relation to Dimensions.Num and a fixed value for the
Dimensions.DimensionCode. This will give you all Values for a special
dimension.

15 July 2009

Transfer Files to remote desktop (mstsc)

The remote desktop feature of windows (>= xp) allows to control remote pcs. If you're in the need to transfer files to this machine a real easy way would be to mount a local drive into the remote machine.
  1. Run mstsc
  2. Enter IP or name of the computer you want to connect to
  3. Click Options and select the Local Resources tab
  4. Select the Disk Drives ou need
  5. connect/logon
  6. Open the Explorer on the remote machine and there you have the drive from your local machine

HttpWebRequest mit C#

If you want to send data to a website or a webservice the following code should help. If you're using a webservice don't forget the security.
using System.Net;
using System.IO;
 
...
...
 
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("URL");
 
request.Method = "POST";
 
string parameter = "title=" + title.Text + "&" + "text=" + text.Text;
 
byte[] byteArray = Encoding.UTF8.GetBytes(parameter);
 
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
 
try
{
 HttpWebResponse response = (HttpWebResponse)request.GetResponse();
 
 if (response.StatusCode == HttpStatusCode.OK)
 {
  dataStream = response.GetResponseStream();
  StreamReader reader = new StreamReader(dataStream);
  status.Text += reader.ReadToEnd();
  response.Close();
 }
 else
 {
  status.Text = "Error";
 }  
}
catch (Exception ex)
{
 status.Text = ex.Message;
}

Syntax Highlighting

First and very important step for posting code is to get a good highlighting. So let's try SyntaxHighlighte
  1. Download SyntaxHighlighter and unpack it
  2. Upload to a webspace somewhere in the worldwideweb
    Styles/SyntaxHighlighter.css
    Scripts/shCore.js
    Scripts/shBrush....js
  3. Include the css and the js code into yout site
    If you are using Blogger go to Layout -> Edit HTML

in the head of the page

at the end of the page


Thats it! To try if everything is working as expected just post something like

code code code

My first Post

Yes I got a new blogger Blog. Real easy to create. Don't know what to write - Maybe i should start posting interessting stuff with real content?

Maybe a piece of code:

thisDate = DateTimeUtil::date(project.DateTimeTo);