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

  • Ashraf_ahk Profile Picture
    75 on at
    RE: 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.

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

  • Ashraf_ahk Profile Picture
    75 on at
    RE: 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.

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

  • Martin Dráb Profile Picture
    231,758 Most Valuable Professional on at
    RE: 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.

    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
    RE: 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.

    I don't know how to get dimension value.

  • Martin Dráb Profile Picture
    231,758 Most Valuable Professional on at
    RE: 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.

    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?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,758 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans