Friday, 17 May 2019
Thursday, 16 May 2019
Open posted Ledger Journals(Expense Journal) from listpage in ax 2012
Open posted Ledger Journals(Expense Journal) from listpage in ax 2012
void clicked()
{
#define.NewButton('NewButton')
#define.AllOpenPostedButton('AllOpenPostedField')
FormRun formRun;
FormDataSource formDataSource;
QueryBuildDataSource queryBuildDataSource;
FormControl formControlPosted, formControlNew;
super();
formRun = new MenuFunction(menuitemDisplayStr(LedgerJournalTable),MenuItemType::Display).create();
formdatasource = formrun.datasource();
querybuilddatasource = formdatasource.query().datasourcetable(tablenum(ledgerjournaltable));
querybuilddatasource.addrange(fieldnum(ledgerjournaltable, ale_projid)).value(projtable.projid);
querybuilddatasource.addrange(fieldnum(ledgerjournaltable, Posted)).value(SysQuery::value(1));
formControlPosted = formRun.design().controlName(#AllOpenPostedButton);
formControlPosted.visible(false);
formControlNew = formRun.design().controlName(#NewButton);
formControlNew.visible(false);
formRun.run();
}
Wednesday, 1 May 2019
create ledger Dimension for the new values(which are not available in DAVcombination table)
create ledger Dimension for the new values(which are not available in DAVcombination table)
if(ledgerDimensionvalueCombination.recid != 0)
{
ledgerJournalTrans.ledgerDimension = ledgerDimensionvalueCombination.recid;
}
else
{
recId = DimensionStorage::getDynamicAccount(_projForecastUnion.ProjId, 3, 129);
davc = DimensionAttributeValueCombination::find(recId);
ledgerJournalTrans.DefaultDimension = davc.RecId;
}
Ledger Offset Account Update in Expense journals.
MainAccount must.
ledgerJournalTrans.OffsetLedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension( projPosting.LedgerDimension,ledgerJournalTrans.DefaultDimension,defaultDimensionView.DefaultDimension,defaultDimension);
////////////////////////////////////////////////////////////////////////////
public static str Tri_WorkerPersonelNo(DimensionDefault _defaultDimension)
{
DimensionAttributeValueSet DimensionAttributeValueSet;
DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
DimensionAttributeValue DimensionAttributeValue;
DimensionAttribute DimensionAttribute;
Name dimvalue,worker,workername;
select DimensionAttributeValueSet
where DimensionAttributeValueSet.RecId == _defaultDimension
join RecId, DisplayValue from DimensionAttributeValueSetItem
where DimensionAttributeValueSetItem.DimensionAttributeValueSet == DimensionAttributeValueSet.RecId
join RecId from DimensionAttributeValue
where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
join RecId, Name from DimensionAttribute
where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute && DimensionAttribute.Name == "Worker";
worker = DimensionAttributeValueSetItem.DisplayValue;
//workername = HcmWorker::findByPersonnelNumber(worker).name();
return worker;
}
................................................................................................
if(ledgerDimensionvalueCombination.recid != 0)
{
ledgerJournalTrans.ledgerDimension = ledgerDimensionvalueCombination.recid;
}
else
{
recId = DimensionStorage::getDynamicAccount(_projForecastUnion.ProjId, 3, 129);
davc = DimensionAttributeValueCombination::find(recId);
ledgerJournalTrans.DefaultDimension = davc.RecId;
}
Ledger Offset Account Update in Expense journals.
MainAccount must.
ledgerJournalTrans.OffsetLedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension( projPosting.LedgerDimension,ledgerJournalTrans.DefaultDimension,defaultDimensionView.DefaultDimension,defaultDimension);
////////////////////////////////////////////////////////////////////////////
public static str Tri_WorkerPersonelNo(DimensionDefault _defaultDimension)
{
DimensionAttributeValueSet DimensionAttributeValueSet;
DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
DimensionAttributeValue DimensionAttributeValue;
DimensionAttribute DimensionAttribute;
Name dimvalue,worker,workername;
select DimensionAttributeValueSet
where DimensionAttributeValueSet.RecId == _defaultDimension
join RecId, DisplayValue from DimensionAttributeValueSetItem
where DimensionAttributeValueSetItem.DimensionAttributeValueSet == DimensionAttributeValueSet.RecId
join RecId from DimensionAttributeValue
where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
join RecId, Name from DimensionAttribute
where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute && DimensionAttribute.Name == "Worker";
worker = DimensionAttributeValueSetItem.DisplayValue;
//workername = HcmWorker::findByPersonnelNumber(worker).name();
return worker;
}
................................................................................................
Subscribe to:
Posts (Atom)