Monday, 29 December 2014

error: dynamic property of the field list of query data source 'MyTable' has not been set

if you ever encounter this kind of error:

"The dynamic property of the field list of query data source 'MyTable' has not been set"

try this: 
open query>DataSource>Field
Check property of filed it will have a property called "DYNAMIC PROPERTY" which is set to unspecified by default. Make it yes

Tuesday, 7 October 2014

Unable to preview SSRS reports from Visual Studio 2010

i have encountered this error when I try to edit SSRS report from my local VM. It seems not possible to work with SSRS report on these machines. 


they way i solve this is by installing the Business Intelligence Development Studio feature of Microsoft SQL Server.

by using the ISO file from > http://www.microsoft.com/en-us/download/details.aspx?id=36843

choose SQL Server Data Tools



Wednesday, 20 August 2014

Enable Debug

You must enable debugging for each component as follows:

1. In the Development Workspace, on the Tools menu, click Options > Development > Debug,
and then select When Breakpoint in the Debug mode list.




2. From the AOS, open the Microsoft Dynamics AX Server Configuration Utility under Start
> Administrative Tools > Microsoft Dynamics AX 2012 Server Configuration. Create a new
configuration, if necessary, and then select the check box Enable Breakpoints to debug X++
code running on this server.


3. For Enterprise Portal code that uses the BCPROXY context to run interpreted X++ code, in the
Microsoft Dynamics AX Server Configuration Utility, create a new configuration, if necessary, and select the check box Enable Global Breakpoints.


Tuesday, 19 August 2014

Set your date to first day of month

Code below is used when you want to set your date by default to 1st day of month, & the records are then filtered to only show invoices posted
after this date.

public void run()
{
    //to set the date to default
    FromDate.dateValue(systemDateGet() -dayofmth(systemDateGet()) + 1);
    super();
}

Monday, 18 August 2014

Sets

A Set is used for the storage and retrieval of data from a collection in which the
members are unique. The values of the members serve as the key according to
which the data is automatically ordered. Thus, it differs from a List collection
class where the members are placed into a specific position, and not ordered
automatically by their value.

Set members may be of any X++ type. All members in the set must have the
same type.

When a value that is already stored in the set is added again, it is ignored and
does not increase the number of members in the set.

static void Sets(Args _args)
{
    Set setOne;
    Set setTwo;
    SetEnumerator enumerator;
    Int value;

    //insert data into sets
    setOne = new Set(types::Integer);
    setOne.add(1);
    setOne.add(2);
    setOne.add(3);

    setTwo = new Set(Types::Integer);
    setTwo.add(3);
    setTwo.add(4);
    setTwo.add(5);

    enumerator = setOne.getEnumerator();

    while (enumerator.moveNext())
    {
        value = enumerator.current();
        //comparing setone & settwo
        if (setTwo.in(value))
        {
            //deleting same value as setone in settwo
            setTwo.remove(value);
        }
    }
   
   
    //print no of elements in sets
    info(strFmt('Set one element is : %1', setOne.elements()));
    info(strFmt('Set two element is : %1', setTwo.elements()));
   
   
    //print set one elements
    enumerator = setOne.getEnumerator();
   
    while (enumerator.moveNext())
    {
        setPrefix(strFmt('%1', 'Set one'));
        info(strFmt('%1', enumerator.current()));
    }
   
   
    //print set two elements
    enumerator = setTwo.getEnumerator();
   
    while (enumerator.moveNext())
    {
        setPrefix(strFmt('%1', 'Set two'));
        info(strFmt('%1', enumerator.current()));
    }


}

List

A List object contains members that are accessed sequentially. Lists are
structures that can contain members of any X++ type. All the members in the
same list must be of the same type.


static void List(Args _args)
{
    List integerList = new List(Types::String);
    ListEnumerator enumerator;
 
 
    // Add some elements to the list
    integerList.addEnd("a");
    integerList.addEnd("b");
    integerList.addStart("c");
     
 
    // Set the enumerator
    enumerator = integerList.getEnumerator();
 
 
    // Go to beginning of enumerator
    enumerator.reset();
 
 
    //Go to the first element in the List
    enumerator.moveNext();
 
 
    // Print contents of first and second elements
    info(strfmt("First element is %1", enumerator.current()));
    enumerator.moveNext();
    info(strfmt("Second element is %1", enumerator.current()));
 
 
    //Print no of elements in the List
    info(strFmt('No of element is %1',integerList.elements()));

 
    //Print type of elements
    info(strFmt('Type of element is %1',integerList.typeId()));
}

fast tab summary


FastTabs display fields in logical groups. You can collapse or expand them by
clicking the arrow to the left of the FastTab name. Alternatively, you can rightclick
and expand all, collapse all, or go directly to a tab.

Summary fields are displayed at the top of each FastTab. This lets you see the
more important data without having to expand the tab.

Summary fields can be specified by setting the Fast Tab Summary property on a control within the tab page, or ideally by adding a field to the AutoSummary on a table so that the field is made into a summary field when it is positioned in a Fast Tab page.

theres two way for  u want to control the fasttab:

1. using the personalize - u set either its auto/yes/no

2. delete the EDT that you want to delete on the selected field group.

Thursday, 14 August 2014

tab properties : fasttab

to make left side box looks like this:



set style on tab properties into fasttab.

resizeable window

set your height & width to column height & column width in the properties to make it more resizeable the way you want.

form splitter

go to formName > method > class declaration

write this on class declaration:

public class FormRun extends ObjectRun
{
    SysFormSplitter_X m_vSplitter;

}

go to formName > method > init

and write this on init class:

public void init()
{
    super();
    m_vSplitter = new SysFormSplitter_X(vSplitter, gridContainer, element);
}

this is how the splitter will look like. u can move the table freely, the way u want it to be.
p/s: make sure to put it in the form.

Wednesday, 13 August 2014

Updating Table

Exportfile for AOT version 1.0 or later
Formatversion: 1
 // author: Kim Seng Chong
***Element: JOB

; Microsoft Dynamics AX Job: updatingTable unloaded
; --------------------------------------------------------------------------------
  JOBVERSION 1

  SOURCE #updatingTable
    #static void updatingTable(Args _args)
    #{
    #    CustTable       custTable;
    #    boolean         check = CustTable::checkExist('1005');
    #    ;
    #    //1st uopdating
    #    /*
    #    if (check)
    #    custTable   = CustTable::find('1005', true);
    #
    #    custTable.Currency = 'MYR';
    #    custTable.update();
    #
    #    info(custTable.name());
    #    info(custTable.Currency);
    #    */
    #    //2nd updaing
    #    /*
    #    ttsBegin;
    #    select forUpdate custTable
    #        where custTable.AccountNum == '1005';
    #
    #    custTable.Currency = 'MYR';
    #    custTable.update();
    #    ttsCommit;
    #    */
    #    //3rd updating
    #    ttsBegin;
    #    while  select forUpdate custTable
    #        where custTable.CustGroup == 'For'
    #    {
    #        if (custTable.Currency == 'USD')
    #        {
    #            info(strFmt('%1 %2 %3', custTable.CustGroup, custTable.name(), custTable.Currency));
    #            custTable.Currency = 'MYR';
    #            custTable.update();
    #        }
    #    }
    #    ttsCommit;
    #}
  ENDSOURCE
  PROPERTIES
    Origin              #{36508A99-1929-49BE-99B3-ABA385CCB53D}
  ENDPROPERTIES


***Element: END