hi
I have a segmented entry field for ledger dimensions. In this field one of the segments is projectId. I want to retrieve all the other dimensions in to their places based on the entered projectId.
The ProjectId is number 3 in the row.
hi
I have a segmented entry field for ledger dimensions. In this field one of the segments is projectId. I want to retrieve all the other dimensions in to their places based on the entered projectId.
The ProjectId is number 3 in the row.
here is how I solved the problem.
public boolean leave() { str 100 projIdLocal; boolean ret; DimensionAttributeValueCombination ledgerdim; DimensionStorage dimStorage; DimensionAttributeValueCombination dimAttrValueComb; ProjTable projTableLocal; DimensionDefault dimensionDefault; ret = super(); if(ledgerJournalTable.JournalName == "HEN") { dimStorage = DimensionStorage::findById(LedgerJournalTrans.LedgerDimension); projIdLocal = element.getProjIdDimension(LedgerJournalTrans.LedgerDimension); projTableLocal = ProjTable::find(projIdLocal); if(projTableLocal.Name) { LedgerJournalTrans.Txt = "Hensat - " + projTableLocal.Name; } dimensionDefault = projTableLocal.DefaultDimension; if (dimensionDefault) { LedgerJournalTrans.LedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(LedgerJournalTrans.LedgerDimension, dimensionDefault); LedgerJournalTrans.OffsetLedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(LedgerJournalTrans.OffsetLedgerDimension, dimensionDefault); } } return ret; }
Update:
I have had a little progress in the process. Now I can get the entered ProjectID from the Segmented Entry. But My question is how I can select the default Dimensions of the project and insert them in the Segmented entry. Here is my code that I have placed in the Leave() of the AccountNum control on the LedgerJournalTransDaily form.
I can select the default dimensions for a project. But I dont know how to insert the values in the segmented entry field.
public boolean leave() { str 100 projIdLocal; boolean ret; DimensionAttributeValueCombination ledgerdim; DimensionStorage dimStorage; DimensionAttributeValueCombination dimAttrValueComb; ProjTable projTableLocal; ret = super(); if(ledgerJournalTable.JournalName == "HEN") { dimStorage = DimensionStorage::findById(LedgerJournalTrans.LedgerDimension); projIdLocal = element.getProjIdDimension(LedgerJournalTrans.LedgerDimension); select projTableLocal where projTableLocal.ProjId == projIdLocal; LedgerJournalTrans.Txt = "Hensat - " + projTableLocal.Name; while select * from projTable where ProjTable.ProjId == projIdLocal // Det skal være det indtastede projektId join RecId from dimensionattributeValueset where dimensionattributeValueset.RecId == projTable.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 { info(dimensionAttribute.Name+"----"+ dimensionAttributeValueSetItem.DisplayValue); //I guess it will be here that I must merge in to the Segmented Entry. } } return ret; }
Just to make sure that I have described my question well :)
In the below image I have entered a projectId in this segmented entry field. What I want is, when I leave the field, the rest of the default dimensions which are "Department" and so on, gets populated. I really dont know how to solve this :)
It could be the solution I want, but I cant see anywhere that he retrieves the default dimensions based on the ProjId. Its a little hard to see what he is doing.
ok something like this
dynamicsaxspace.com/.../set-financial-dimension-values-through-code-in-ax-2012
Hi Dick
thanks for your reply,
I want to insert values in the segments that are already in the fields, based on the projectId we enter :)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,263 Super User 2024 Season 2
Martin Dráb 228,112 Most Valuable Professional
nmaenpaa 101,148