Hello all,
I was wondering if it was possible to change the field values of Allow Posting From and Allow Posting To to the date of the following business day automatically at 11pm every evening.
Currently we are manually changing this date in those fields every evening in the General Ledger Setup form.
If anyone has any ideas they would be greatly appreciated.
Thank you and have a great day. gad1
0
Comments
we change our date range monthly ie.7/1/2008 to 7/31/2008
you run a tight ship over there.
The simple code of
if "Posting Date" <> WORKDATE then "Posting Date" := Workdate;
on most of our posting fields. We have noticed a dramatic descrease (if any) posting date errors.
http://www.BiloBeauty.com
http://www.autismspeaks.org
One clarification please...where do I insert that line of code. I'm looking forward to putting this in place and testing.
Have a great day - gad1
You can setup the job scheduler to do so.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
http://www.mibuso.com/forum/viewtopic.php?t=25021
post 6 - add code to CU1
post 12 - add code to form
Post 13 - create a report & use job scheduler
http://www.BiloBeauty.com
http://www.autismspeaks.org
For the short term I'd like to implement Harry's suggestion in test. Do you happen to know the optimal location to place the code?
Thanks! gad1
http://www.BiloBeauty.com
http://www.autismspeaks.org
prior to sending my last post.
I'd like to change those dates only from the General Ledger Setup form because that's where it's being manually changed now.
so...
Say someone changed there computer date to 3/12/2005 and they are the last one to log in then the date will be changed to that!
I like having a month range and having the field update when I enter the form. This way it's user specific.
If you wanted to go the CU1 route you could
first add a field to GlSetup table called Auto Update Posting Range.
Add it to the gl setup form. CHeck it! you can uncheck it to TURN IT OFF!
Then Add to LogInStart() around the lines
LogInDate := TODAY;
LogInTime := TIME;
**Caveat emptor!!** - Greg Brady
http://www.BiloBeauty.com
http://www.autismspeaks.org
Regards
http://www.BiloBeauty.com
http://www.autismspeaks.org
If I use this code (so without creating and using the extra field in the GLSetup table) in a report, I loose all other settings in the GL Setup table exept the "Allow posting From" and "Allow posting To" values.
Does anyone have an idea why?
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Should this make the difference?
Yes it will. Since GLSetup is blank.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
anyway try this.
add a variable to your report called GLSetup
type= Record
Subtype= General Ledger Setup
add a GLSETUP.GET; to the beginning of the code.
http://www.BiloBeauty.com
http://www.autismspeaks.org
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Thanks, it works perfectly know.
Unless there are any objections I'll put 'SOLVED' in the title.
Have a great day - Chris
Ps. We're getting Job Scheduler after all!
Altough It has been solved by recommendations here, I would like to tell a different approach.
Add two fields in User setup table:Allow Posting From Formula,Allow Posting To Formula.
Add this function In User Setup table.
Change codeunits (which check allowed posting dates). here are two example:
cu 11 Gen. Jnl.-Check Line :
cu 21 Item Jnl.-Check Line:
in this way, you needn't job scheduler etc. Allowed posting dates are calculated on the fly by user based calculation formula..
hope this helps.
Even if we have allowed posting range set in user setup table and current posting date is well within that range, NAV sometime doesn't allow it to post. I have seen this in some occasions where the NAV try to go back and forth in transaction table and tries to adjust the remaining quantities of lines with date beyond the filter set (a erroneous date of invoice in a future date).
I will try to simulate one and try my best post the scenario here soon.