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;
}