Creating batch job – Sysoperation framework AX 2012

Tags

, , , ,

HI Guys,

To create a batch with the help of sysoperation is explained very good at the below URL’s.

http://www.artofcreation.be/2011/08/22/ax2012-sysoperation-part-1-data-contracts-and-service-operations/

http://www.artofcreation.be/2011/08/23/ax2012-sysoperation-part-2-sysoperationservicecontroller/

But with little change in the controller class.

Edit the controller class (KlForCustTesterServiceController ) as follows.

Decorate the controller class with [SysOperationJournaledParametersAttribute(true)]

————-

 

[SysOperationJournaledParametersAttribute(true)]

class KlForCustTesterServiceController extends SysOperationServiceController
{
}

————-

public static void main(Args _args)
{
KlForCustTesterServiceController klForCustTesterServiceController;
;
klForCustTesterServiceController = KlForCustTesterServiceController::newFromArgs (_args);

klForCustTesterServiceController .parmExecutionMode(SysOperationExecutionMode::ReliableAsynchronous);
klForCustTesterServiceController.startOperation();
}

————–

Now override the New method.

public void new()

{

super();

this.parmClassName(ClassStr(KlForCustTesterDataService));

this.parmMethodName(MethodStr(KlForCustTesterDataService, testCustomer));

}

Basically, to create any batch job with sysoperation

  1. controller class must be decorated with [SysOperationJournaledParametersAttribute(true)]
  2. Main method should have  – – – – – –  klForCustTesterServiceController .parmExecutionMode(SysOperationExecutionMode::ReliableAsynchronous);
  3. New method should be overridden –  – – – After super(), pass the class name and method of the service class.

These three things are very important and explained very good at the below URL.

https://msdax.wordpress.com/2016/06/03/sys-operation-framework-adding-class-to-batch-taskmaking-journalized/

Would like to thanks Martin Drab and Amir Nazim for this valuable information.

Thanks.

 

 

Advertisements

Display all AOT classes in lookup

static void lookupAOTClasses(FormStringControl _ctrl)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(UtilidElements), _ctrl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange nameQBR, typeQBR;
;
sysTableLookup.addLookupfield(fieldnum(UtilidElements, Name));
sysTableLookup.addLookupfield(fieldnum(UtilidElements, Id));

queryBuildDataSource = query.addDataSource(tablenum(UtilidElements));

typeQBR = queryBuildDataSource.addRange(fieldnum(UtilidElements, recordType));
typeQBR.value(SysQuery::value(UtilElementType::Class));

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

Display all AOT Table in lookup

static void lookupAOTTables(FormStringControl _ctrl)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(UtilidElements), _ctrl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange nameQBR, typeQBR;
;
sysTableLookup.addLookupfield(fieldnum(UtilidElements, Id));
sysTableLookup.addLookupfield(fieldnum(UtilidElements, Name));

queryBuildDataSource = query.addDataSource(tablenum(UtilidElements));

typeQBR = queryBuildDataSource.addRange(fieldnum(UtilidElements, recordType));
typeQBR.value(SysQuery::value(UtilElementType::Table));

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

hcmworker lookup

Query query = new Query();
QueryBuildDataSource qbds, qbdsJoin;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
QueryBuildLink qblink1;
;
sysTableLookup = SysTableLookup::newParameters(tablenum(View1),this);

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

sysTableLookup.addLookupfield(fieldnum(View1,PersonnelNumber));
sysTableLookup.addLookupfield(fieldnum(View1,Name), true);

sysTableLookup.performFormLookup();
//super();

AX 2012 Override method of ActionTab buttons for ListPage Forms like CustTableListPage

AX 2012 Override method of ActionTab buttons for ListPage Forms like CustTableListPage

On the form button

void clicked()
{
MenuFunction mf;
args args = new Args();
;
args.record(ProdTable);
mf = new menufunction(identifierstr(test), MenuItemType::Action);
mf.run(args);
}

Create a class Test

class Test
{
ProdTable prTable;
}

public static void main(Args args)
{
Test t;

Common record;
FormDataSource recordDataSource;
;

record = args.record();

recordDataSource = record.dataSource();
t = new Test();
t.prodTable(record);

}

private void prodTable(ProdTable _prodTable)
{
FormDataSource recordDataSource;
;
recordDataSource = _prodTable.dataSource();

_prodTable = recordDataSource.getFirst(1);
while (_prodTable)
{

info(strFmt(‘%1’, _prodTable.RecId));
_prodTable = recordDataSource.getNext();
}
}

Asif Huddani's Blog

Hello Friends,

Recently I am working on AX 2012 customization and find new feature which sometimes little confuse.

I am able to customize form by going inside Developer workspace.

Issue is i am able to add and modify and write new contol override method for my customization inside any child form. But if my form is list page form like CustTableListPage, or VendTableListPage then i am able to add buttom but i dont able to override method… so i am lookin on this and finally get answer.. Look at Below…

If you want to use that List Page button only in AX 2012 Client but not in Enterprise Portal then just change button Property “DisplayTarget” and change to “Client”. Now you can override method for that button…

Such a Cool Feature….

Method Override option not available in CustTableListPage

Override Method in CustTable Form

DisplayTarget to client and Override Methods

Check this My post in AX Community.https://community.dynamics.com/product/ax/f/33/p/65449/119002.aspx

View original post

SSRS AX 2012 font size…

Tags

,

HI All,

In  my environment somebody  developed some SSRS report. Now the customer wanted the font size to be bigger than the earlier one.

I was searching if there is any possible way to increase the size of the font at once ?

Solution :  

On the design section in VS. search for the font you have. Suppose your font size is 8pt.

Then replace all the font size of 8pt with 14pt.

Save it. Deploy it and there you go 🙂

 

Please leave your comment if you have any doubt.

Numbers could not be generated because a number sequence reference is missing. Ensure that all necessary number sequences are set up.

Tags

, ,

Hi All,

I  was getting below error when I was tyring to post sales invoice.

“Numbers could not be generated because a number sequence reference is missing.  Ensure that all necessary number sequences are set up.”

I have checked with number sequence

-Customer invoice

-Customer invoice voucher

Created new number sequence and attached to them, but the error was still coming.

Solution : I went to Number sequence form in Organisation administration and Generate the Number sequence from the Wizard for Account receivable.

As I generated the number sequence for the whole module and tried to post the sales invoice again, the issue got resolved.