I have different user 'types'
New field in the Gen. Journal Batch table (232) "User Type"
User Setup new field "User Type".
When the user opens the Payment Journal, I can filter on the batch table if they look it up.
Problem:
If the last used batch was for BANK which is not within the filter, that batch opens up with whatever lines are in that journal.
I need to prevent the 'last used' and force a selection from the allowed list of batches.
I cannot find the insertion point for my filter code.
Any suggestions please.
Experience is what you get when you hoped to get money
0
Comments
E.g. if you want to customize page 39, take a look at OnOpenPage trigger. You can see there GenJnlManagement.OpenJnl function which one is your key.
CurrentJnlBatchName := 'LEGALTEAM';
GenJnlManagement.OpenJnl(CurrentJnlBatchName,Rec);
Did not work, just ignored that and opened up the GENERAL batch.
Don't change the Page 39, try this instead:
GenJnlLn."Journal Batch Name" := 'LEGALTEAM'; ... is needed in case your journal is empty - in such case SetupNewLine uses the value passed in the actual field to create new journal line
GenJnlLn.SETRANGE("Journal Batch Name"... is needed for OpenJnl function called in OnOpenPage as it tries to get the requested batch name from the filter
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
It's just the way I prefer doing things. I prefer the model where the calling/parent object decides what called object is supposed to do/display. And I'm always trying to minimize the amount of code/changes on pages/reports.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
However, I am able to add it to a new menu as stand alone and your concept works very well.
Many thanks.
I am getting a different view of the Payment Journal when Run from the Codeunit.
Some of the Actions do not appear but are all there if using the standard menu.
Pity, otherwise it works really well.
Journal specific pages are configured in Gen.Journal Template table. You may want to add something similar to your code to pick the right one:
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
However, the boss now wants multiple list pages and not the direct open approach.
So, the problem is not solved, just not in need of a solution.
Will just have to pack that one away for some other time.
Thanks so much for your responses.