web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How can I throw an error when user try to change offset account when location on (Journal Name form) and offset account on (General journal > Lines) are same.

(0) ShareShare
ReportReport
Posted on by 75

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.

pastedimage1674137587699v1.pngpastedimage1674137676659v2.png

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    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?

  • Ashraf_ahk Profile Picture
    75 on at

    I don't know how to get dimension value.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    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).

  • Ashraf_ahk Profile Picture
    75 on at

    No need to use class but by using view(DimensionAttributeLevelValueAllView) I validated it easily.

  • Ashraf_ahk Profile Picture
    75 on at

    //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');
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans