Image stored in Dynamics Ax 2012 tables

by alirazazaidi on December 19, 2014

In dynamics Ax 2012, You can read image from physical path and stored in database as follow

BinData binData = new BinData();
str extention, path, nameOfFile;
container imageContainer;
str imageFilePathName;
imageFilePathName=”C:\\abc\\ali.jpg”;
// if ( WinAPI::fileExists(imageFilePathName))
{
binData.loadFile(imageFilePathName);
imageContainer = binData.getData();
table.Person = _Party.RecId;
table.Image = imageContainer;
table.insert();

}

This code runs both for server side and client side. At server side execution table use winserverapi::FileExists

{ 0 comments }

During one of my development i got following error, which occurs when I try to convert image into bits and stored in tables. I solved this by adding before the code

 

FileIoPermission _perm;
_perm = new FileIoPermission("c:\\File.txt",'r'); 
_perm.assert(); 






Reference: http://msdn.microsoft.com/en-us/library/fileiopermission.aspx

{ 0 comments }

In real world every person has unique identified number provided by Government of country or organization where he is working. For example if we talk about Pakistan every person either Applicant or worker has its unique CNIC (Computerized National Identity Card) or National Passport or NTN (National Tax Number).  And we have to store these in Human resource management implemented in organization.

For these implementation In Dynamics Ax 2012 provide a form for its set up. You can define these unique setup form and then links in Applicant or worker to step link

 

 

Human resource => Setup=> worker=> Identification types

 

Identification

 

When you click on button following form will open where you can set required Identification Types according to your country

Tyoes

 

 

Now you want to setup the values against these Values You can open Worker List page, select required worker and from top strip select Personal Information.

Worker SetUp From Top menu

 

Similar form open for selected worker.

National Identification Number setup form for worker

 

 

 

You can also set these Identification from detail form of work, Go on Personal Detail fast tab and click on “Government and Organizational Identifications”

Worker Setup

 

 

Similarly if you can select Identification for Applicant. Select the required Applicant form grid and click on personal Information from Top tab

12-17-2014 3-15-09 PM

 

 

Or open the detail from of applicant and from Personal Information fast tab you can enter its CNIC or Identification number.

 

12-17-2014 3-15-42 PM

{ 0 comments }