Hi Friends,
You might be thinking of new code for Tax calculation for GST in INDIA. Here is the sample code snippet for printing Tax info on Reports and Forms.
ITaxableDocument taxableDocument;
ITaxDocument taxDocumentObject;
ITaxDocumentMeasurevalue totalTaxMeasureValue;
ITaxDocumentComponentLineEnumerator componentme;
ITaxDocumentComponentLine componentLine;
ITaxDocumentMeasureEnumerator measureenum;
ITaxDocumentComponentLineMetaData meta;
ITaxDocumentLineEnumerator sublines,sublines1;
ITaxDocumentLine line,line1;
Amount gstTotal ;
;
taxableDocument = TaxableDocumentObject::construct(TaxableDocumentDescriptorFactory::getTaxableDocumentDescriptor(PurchTable::find(526987556)));
taxDocumentObject = TaxBusinessService::calculateTax(taxableDocument);
if (taxDocumentObject)
{
totalTaxMeasureValue = taxDocumentObject.getTotalTax();
gstTotal = totalTaxMeasureValue.amountTransactionCurrency();
sublines = taxDocumentObject.subLines();
while(sublines.moveNext())
{
line = sublines.current();
sublines1 = line.lines();
while(sublines1.moveNext())
{
line1 = sublines1.current();
componentme =line1.componentLines();
while(componentme.moveNext())
{
componentLine= componentme.current();
meta = componentLine.metaData();
info(meta.taxComponent());
info(strfmt("%1",componentLine.getMeasure("Base Amount").value().value()));
info(strfmt("%1",componentLine.getMeasure("Rate").value().value()));
}
}
}
}
Vivek Chirumamilla
Showing posts with label Ax2012. Show all posts
Showing posts with label Ax2012. Show all posts
Wednesday, 7 June 2017
Friday, 22 March 2013
Passing Information from to another based on Selection in Ax 2012
Hi Friends,
In my previous posts I had shown how to open a form in runtime , but opening the form in runtime is one aspect and passing the information to the base form based on user selections is another hurdle.
Today we are going to pass the customer from one form to another.
We have a customer field in a form and this customer has to be searched from another form where the list of customers are shown. User places the cursor on the serach and press use customer this selected customer must be returned to the cutomer field

To return the customer which we have selected , write doen the following code in the clicked method of the use customer.
void clicked()
{
;
element.args().parm(CustTable.AccountNum);
Element.close();
super();
}
While in the first form write the follwing code to open the form for selection and taking the value for the which has been returned.
void clicked()
{
FormRun formRun;
Args args;
AccountNum retValue;
;
args = new Args();
args.name(Formstr(McsCustomerSearch));
args.caller(element);
formRun = classFactory.formRunClass(args);
formRun.Init();
formRun.run();
formRun.wait();
if (args.parm())
{
retValue = args.parm();
CustomerId.text(retValue);
CustomerId.modified();
}
}
By this whatever value we have selected in the second form not only passes to the first form but also the value is diplayed in the current field.
Happy Daxing
Vivek Chirumamilla
Thursday, 22 November 2012
How to open a form in runtime in Ax 2012
Hi Friends,
Today we are going to open a form in runtime in Ax 2012.
There are two ways of opening a form in runtime in Ax 2012.
Below given codes are for just example.
The first type of opening a form is given below
client static Object OpenToolBar()
{
Object toolBarForm = null;
Args args = new Args();
;
args.name(formStr(formName));
toolBarForm = classFactory.formRunClass(args);
toolBarForm.init();
toolBarForm.run();
toolBarForm.detach();
return toolBarForm;
}
The second type is given below
client static Object getToolBarObject()
{
ObjectIdent objIdent = infolog.globalCache().get(formStr(formname),null,null);
Object toolBarForm = objIdent ? objIdent.object() : null;
;
if(!toolBarForm)
{
toolBarForm = S3SecurityToolBarOpen::OpenToolBar();
}
else
toolBarForm.setActive();
return toolBarForm;
}
Vivek Chirumamilla
Today we are going to open a form in runtime in Ax 2012.
There are two ways of opening a form in runtime in Ax 2012.
Below given codes are for just example.
The first type of opening a form is given below
client static Object OpenToolBar()
{
Object toolBarForm = null;
Args args = new Args();
;
args.name(formStr(formName));
toolBarForm = classFactory.formRunClass(args);
toolBarForm.init();
toolBarForm.run();
toolBarForm.detach();
return toolBarForm;
}
The second type is given below
client static Object getToolBarObject()
{
ObjectIdent objIdent = infolog.globalCache().get(formStr(formname),null,null);
Object toolBarForm = objIdent ? objIdent.object() : null;
;
if(!toolBarForm)
{
toolBarForm = S3SecurityToolBarOpen::OpenToolBar();
}
else
toolBarForm.setActive();
return toolBarForm;
}
Vivek Chirumamilla
Subscribe to:
Posts (Atom)