Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

Purchase Order Customization in AX 2009

$
0
0

Hi All,

I am customizing Purchase Order Report in AX 2009. I need to print the particular name on PO according to Input from user. I have used a Dialog box for taking input from user. The data which is entered by user is stored in UsrName variable, now while comparing this input entered by user using switch case i found that there is no value in UsrName i.e Switch(UsrName).
and bcoz of this it is unable to compare it with the cases and it is printing the data which is written in Default: stmt of Switch-case.

So, i have a query why this UsrName is blank...?? It is not retriving/fetching the value entered in textbox(of dialog box/field) by the user.

the code written is as follows:

Class Declaration :-
DialogField boxUsrName;
String100 UsrName;


Dialog method :-

public Object dialog(Object _dialog)
{
DialogRunbase dialog = _dialog;
;
dialog.addGroup("Name on Purchase Order");
boxUsrName = dialog.addField(typeid(String100), "Enter the Name:");
boxUsrName.value(UsrName);
return dialog;
}

getFromDialog() :-

boolean getFromDialog()
{;
UsrName = boxUsrName.value();
return true;
}

Display method :-


display Description dispName1()
{
    Description tmpDesc;
    ;
    info(UsrName);        ------ // this stmt outputs as Blank in infolog.
    switch(UsrName)
    {

    case "ABC":tmpDesc = 'A';
    break;

    case 'PQR':tmpDesc = 'P';
    break;

    Default:tmpDesc = 'XYZ';

    }
      return tmpDesc;
 }

Is their anything that is missed out,Please suggest.

Thanks in Advance.


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>