Showing posts with label Morphx editor. Show all posts
Showing posts with label Morphx editor. Show all posts

Tuesday, September 1, 2020

How to loop selected records on grid for form in dynamics ax?

To loop/iterate selected records from grid on form you can use following code, this can be done on clicked method of button control :

InventTable inventTableBuffer;

for (inventTableBuffer = getFirstSelection(InventTable_ds);
inventTableBuffer;
inventTableBuffer = InventTable_ds.getNext())
{
    // write logic here.
}



Tuesday, July 21, 2020

Get worker name from position with SQL Queries

select top 1 name from DIRPARTYTABLE
inner join HcmWorker ON HcmWorker.PERSON = DIRPARTYTABLE.RECID
AND HcmWorker.RECID = 
    (select top 1 worker from HCMPOSITIONWORKERASSIGNMENT  
    INNER JOIN HCMPOSITION ON HCMPOSITIONWORKERASSIGNMENT.POSITION =  HCMPOSITION.RECID
    AND HCMPOSITION.POSITIONID = 'PositionId'
    where GETDATE() between HCMPOSITIONWORKERASSIGNMENT.VALIDFROM 
    AND HCMPOSITIONWORKERASSIGNMENT.VALIDTO);

Wednesday, April 8, 2020

Find Company details in Dynamics AX

Company Address:
CompanyInfo companyInfo = CompanyInfo::find();
info(strFmt("%1",companyInfo.postalAddress().Address));
Currency details:
CompanyInfo::standardCurrency() 

	OR

Ledger::accountingCurrency(CompanyInfo::current());

How to loop selected records on grid for form in dynamics ax?

To loop/iterate selected records from grid on form you can use following code, this can be done on clicked method of button control : Invent...