Search This Blog

April 30, 2012

System Table as a Temp Table

How to use a system table as a Temporary Table 

We can use a system table as a temp table in our coding just try the following code....

static void CopyPersistedTableToTemp(Args _args)
{
    CustTable custTable;
    CustTable custTmpLedger;
    ;
    custTmpLedger.setTmp();
    custTable.recordLevelSecurity(true);

    while select custTable where custTable.City == 'Toronto'
    {
        custTmpLedger.data(custTable.data());
        custTmpLedger.doInsert();
     }
}



By using this code you can use a system table as a temp table and the good thing in this , this didnt disturb your main table configuration and data in that table. it just create a object of a table and use this object as a temporary.

April 24, 2012

SSRS Tutorial Video

Hi Friends,

Today I am sharing a Video for SSRS reporting Services, to batter understanding just try to do at your end also you have following s/w for this,

1. Visual Studio with reporting extensions
2. SQL server 2008/2005

3. Dynamics AX

video

April 23, 2012

LookUp On forms

hi guys,
Here i am sharing a method to how to use a lookup In FROM Control....
so just try the following method in your code..


public void lookup()
{

    Query                   query = new Query();
    QueryBuildDataSource    qbds,qbds1;  
    QuerybuildRange         QuerybuildRange,QuerybuildRange1,QuerybuildRange2;
    QuerybuildLink          QuerybuildLink;
    SysTableLookup          sysTableLookup;

    ;

    sysTableLookup = SysTableLookup::newParameters(tablenum(UB_ResourceRequest1), this);

    sysTableLookup.addLookupfield(fieldnum(ResourceRequest1,ResourceRequestNo), true);
    sysTableLookup.addLookupfield(fieldnum(ResourceRequest1,RRStatus), true);
    sysTableLookup.addLookupfield(fieldnum(ResourceRequest1,ApprovedNumber),true);
    sysTableLookup.addLookupfield(fieldnum(ResourceRequest1,AllocatedNumber),true);
    sysTableLookup.addLookupfield(fieldnum(ResourceRequest1,DateOfRequirement),true);
    sysTableLookup.addLookupfield(fieldnum(ResourceRequest1,ApprovalStatus),true);

    qbds = query.addDataSource(tablenum(ResourceRequest1));

    QuerybuildRange = qbds.addRange(fieldnum(ResourceRequest1,RRStatus));
    QuerybuildRange1 = qbds.addRange(fieldnum(ResourceRequest1,RRStatus));
    QuerybuildRange2 = qbds.addRange(fieldnum(ResourceRequest1,ApprovalStatus));

    QuerybuildRange.value(enum2str(RRStatus::Open));
    QuerybuildRange1.value(enum2str(RRStatus::Partial));
    QuerybuildRange2.value(enum2str(RRWFApprovalStatus::Approved));

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();

    super();
}

-Harry

April 21, 2012

RunBase frameWork In X++

RunBase framework

Whenever you write a class that typically asks a user for input and then starts a process based on that input you use the RunBase framework as most of the typical methods needed for such a Job is already implemented in the RunBase class. This means that using the RunBase framework is done by extending RunBase either by directly extending RunBase or by extending a class that extends RunBase.
Some of the features implemented in the RunBase framework are the following:

• Run: The main flow of the operation
• Dialog: Prompting the user for input and storing that input
• Batch execution: Schedule the Job for later execution
• Query: Used to select data
• Progress bar: Shows the progress of a task
• Pack/unpack with versioning: Remember variable values until the next time
the task is executed







-Harry

April 16, 2012

Mehods in AX


Hi guys,

Here i  want to share a link for all basic methods which we can use i n our Form s and reports Customization....
here u find all predefined methods for axapta 2009 as well as 2012
Click here For Methods in AX

-Harry

April 14, 2012

How To Create Forms in Enterprise Portal

ABSTRACT:- This article demonstrates how to create basic forms in Enterprise Portal. Create a DataSet

1. Open Microsoft Dynamics AX.
2. Open the AOT.
3. Right-click on the Data Sets node and choose New Data Set.
4. Right-click on the newly added data set and choose Properties.
5. In the property sheet rename the new Data Set to SampleCustomers.
6. Expand SampleCustomers.
7. Right-click the Data Sources node and choose New Data Source.
8. Right-click the new Data Source and choose Properties.
9. In the property sheet set the Table property to CustTable.
10. In the property sheet set the Name property to CustTable.
11. In the property sheet set the InsertIfEmpty property to No.

  • Create a Web Project
1. Open Microsoft Visual Studio 2008.
2. Under the File menu choose New and then Web Site.
3. Choose Visual C# as the Language – note that only C# is supported.
4. Choose Dynamics AX Web Project as the template.
5. Enter SampleBasicForm as the project name.
6. Click OK when finished.
  • Create a User Control and Add it to the AOT
1. In Visual Studio add a new File under File then New File.
2. Choose Visual C# as the language.
3. Choose Dynamics AX User Control under the My Templates Section.
4. Enter SampleBasicForm.ascx as the name.
5. Click Add when finished.
6. In the Solution Explorer, right-click on the new user control, SampleBasicForm.ascx, and select Add to AOT.

  • Add a Form to Your User Control
Forms in Enterprise Portal are used to display and edit record information. They consist of three different controls, an AxDataSource, an AxForm, and an AxGroup. The AxDataSource is used to interact with data. The AxForm is a container for the form entity. The AxGroup will reference and display fields
from the data. The specific record information to display is retrieved from the external context (information passed through the URL).

1. In Visual Studio in the Solution Explorer, right-click the user control and select View Designer.
2. Locate the Microsoft Visual Studio 2008 Toolbox under View then Toolbox.
3. Find and expand the Dynamics AX section.
4. Drag-and-drop an AxDataSource onto the design.
5. Click on the arrow in the upper right-hand corner of the AxDataSource and set the DataSet Name    property to SampleCustomers. This can also be done through the properties pane.
6. Right-click on the AxDataSource and choose Properties.
7. Rename the new AxDataSource to Customers_DS by changing the (ID) property to Customers_DS.
8. Find the AxForm control in the toolbox under View and then Toolbox.
9. Drag-and-drop the AxForm onto the design.
10. Right-click on the AxForm and choose Properties.
11. Rename the AxForm’s ID to SampleCustomers by changing the (ID) property.
12. Set the DataSourceID property to Customers_DS.
13. Set the DataMember property to CustTable_Current.
14. Find the AxGroup control in the toolbox under View and then Toolbox.
15. Drag-and-drop the AxGroup onto the AxForm.
16. Right-click on the AxGroup and choose Properties.
17. In the Fields property for the AxGroup, click the … icon.
18. Add AccountNum, Name and Address from Available Fields by double-clicking or selecting each item and clicking Add Field.
19. Press OK to save.
20. Click the Save icon on the Visual Studio toolbar to save your project.

  • Testing Your User Control To Test Through Microsoft SharePoint Services
1. Navigate to your Microsoft Dynamics AX Enterprise Portal web site.
2. Click on Site Actions and select Create.
3. Click on the Web Part Page link.
4. Choose a Name, Template, and the Document Library Enterprise Portal.
5. Click the Create button.
6. If the page is not in Edit Mode, click Site Actions and select Edit.
7. In one of the web page’s sections click the Add a Web Part bar.
8. Check Dynamics User Control Web Part and select Add.
9. On the new web part, click edit and select Modify Shared Web Part.
10. Set the Managed content item property to your user control, SampleBasicForm.
11. Click OK.
12. Under the Site Actions menu click the link Exit Edit Mode.
13. Minimize the web browser.
14. Locate and open the web.config file for the SharePoint site. (ex: C:\Inetpub\wwwroot\wss\VirtualDirectories\80)
15. Locate the compilation section and set the debug property to true


16. Open your Microsoft Visual Studio 2008 SampleBasicForm project.
17. From the menu choose Debug and select Attach to Process.
18. Select the w3wp.exe process for the SharePoint site and click Attach.
19. In Visual Studio’s Solution Explorer right-click your control and choose View Code.
20. Add breakpoints to the code where needed.
21. Maximize the open web browser and refresh the SharePoint site.
22. When finished debugging, set the debug attribute in the web.config file back to false.

  • To Test Through Microsoft Visual Studio 2008
1. In Visual Studio in the Solution Explorer, right-click the project node and select Import Style Sheets.
2. In the Solution Explorer, right-click the AxWebPartPage.aspx page and select View Designer.
3. In the design under Body, locate dynamics:AxUserControlWebPart1. It is the second box containing Untitled under the Body.
4. Right-click dynamics:AxUserControlWebPart1 and choose Properties.
5. Set the Dynamics AX Managed Web Content Item property to your user control, SampleBasicForm.
6. Save your control.
7. In the Solution Explorer right-click your SampleBasicForm control and choose View Code.
8. Add breakpoints to the code where needed.
9. In the Solution Explorer, click on the AxWebPartPage.aspx so it is selected.
10. Click the green arrow on the toolbar to build and run the solution.


-Harry