Thursday, October 22, 2009

Dynamics Ax Enterprise Portal - Ny WebPart

Kopier filer til katalog \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\ep

Friday, July 31, 2009

Dynamics Ax write data to file

void clicked()
{
DataArea dataArea;
Table1 tab1;
System.IO.StreamWriter file;
;
while select dataArea where dataArea.isVirtual == false
{
changeCompany(dataArea.Id)
{
tab1 = null;
file = new System.IO.StreamWriter("c:\\temp\\1\\" + dataArea.Id + ".txt");
while select tab1
{
file.WriteLine(tab1.Code + ";" + tab1.Name);
}
file.Close();
file.Dispose();
}
}
super();
}

Dynamics Ax read data from file

void clicked()
{
DataArea dataArea;
Table1 tab1;
Table2 tab2;
System.IO.StreamReader file;
System.String lineS;
str line;
str code, description;
int pos;
str path;
;
while select dataArea where dataArea.isVirtual == false
{
changeCompany(dataArea.Id)
{
tab1 = null;
tab2 = null;
select firstonly tab1;
select firstonly tab2;
path = "c:\\temp\\1\\" + dataArea.Id + ".txt";
Info::messageWinAddLine(dataArea.Id + path);
if(System.IO.File::Exists(path))
{
file = new System.IO.StreamReader(path);
lineS = file.ReadLine();
while(lineS)
{
line = lineS;
pos = strfind(line,";",strlen(line),-strlen(line));
code = substr(line,1,pos-1);
description = substr(line,pos+1,strlen(line));
tab1.Code = code;
tab1.Description = description;
tab2.Code = code;
tab2.Text = description;
Info::messageWinAddLine(code + description);
tab1.insert();
tab2.insert();
lineS = file.ReadLine();
}
file.Close();
file.Dispose();
}
}
}
super();
}

Tuesday, March 10, 2009

Web service call to fetch orders from Commerce Server 2007

Here is an exmaple of a web service call to search for orders in Commerce Server:


System.Xml.XmlDocument searchClause = new System.Xml.XmlDocument();
searchClause.LoadXml(@"<CLAUSE OPER=""equal"" xmlns=""http://schemas.microsoft.com/CommerceServer/2004/02/Expressions"">
<PROPERTY ID=""PurchaseOrder.Status"" MULTIVAL=""false"" TYPE=""String"" />
<IMMED-VAL TYPE=""String"">
<VALUE>NewOrder</VALUE>
</IMMED-VAL>
</CLAUSE>");
SearchOptions searchOptions = null;
OrderService os = new OrderService();
os.Credentials = new System.Net.NetworkCredential("User", "Password", "domain");
DataSet ds = os.GetAllowedStatus();
ds = os.SearchPurchaseOrders((System.Xml.XmlElement)searchClause.FirstChild, searchOptions);

Sunday, September 21, 2008

BBS ePay Netterminal

Registry setting AllowedAccounts: add NetworkService. (Identity for application pool)
Dersom feilmelding BBSePayException None, sjekk at BBSePay.dll er installert i System32 og er registrert.
Legg evt. til Registry settings manuelt. Sjekk typelib og clsid.
Kompiler for x86

Monday, July 28, 2008

Granting permissions to certificates

How to grant permission to NETWORK SERVICE to a certificate:

C:\Program Files\Windows Resource Kits\Tools>winhttpcertcfg.exe -g -c LOCAL_MACHINE\My -s subjectstring -a NetworkService
Microsoft (R) WinHTTP Certificate Configuration ToolCopyright (C) Microsoft Corporation 2001.
Matching certificate:
CN=
OU=
O=
L=
C=
Granting private key access for account: NT AUTHORITY\NETWORK SERVICE