I need to validate the location and offset account.
When both are same and user try to change offset account on a form then it should through an error/message.
I need to validate the location and offset account.
When both are same and user try to change offset account on a form then it should through an error/message.
//used validate write method on form
DEFAULTDIMENSIONVIEW ddv;
DimensionAttributeLevelValueAllView dalvav;
LedgerJournalName ledgerJournalName ;
SELECT DISPLAYVALUE
FROM ddv
join ledgerJournalName
WHERE ddv.DefaultDimension == ledgerJournalName .DefaultDimension
&& ddv.NAME == 'my req location name' && ledgerJournalName .JournalName == ledgerJournalTable.JournalName;
select DISPLAYVALUE
from dalvav
where dalvav.VALUECOMBINATIONRECID == ledgerJournalTrans.OFFSETLEDGERDIMENSION
&& dalvav.ValueOrdinal == 2;
if(ddv.DisplayValue != dalvav.DisplayValue)
{
isValid = checkFailed('Set correct offset account location');
}
No need to use class but by using view(DimensionAttributeLevelValueAllView) I validated it easily.
Than this is the question you should have asked. You can't build a wall if you don't have the bricks.
Do you understand the difference between default dimensions and ledger dimensions?
Let's start with default dimensions on journal name. You mean LedgerJournalName.DefaultDimension, right? You can use DimensionAttributeValueSetStorage class to work with it (look for examples either on internet or F&O codebase).
I don't know how to get dimension value.
All right, so what do you need from us. You don't know how to write any validation at all, you don't know how to get the dimension value, or what?
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,253 Most Valuable Professional
nmaenpaa 101,156