Skip to main content
Post a question

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to add a field with xSysLastValue to salesEditLines (for invoice posting)

Like (1) ShareShare
ReportReport
Posted on 13 Aug 2024 14:11:16 by 15
Hi All,
 
I have added a field on the salesEditLines form for invoice posting purposes. Using https://www.linkedin.com/pulse/storing-last-form-values-m-imran-qasmi-xme0c I managed to save/retrieve the last values. So far so good.
 
Next I created two batch jobs for automatic invoice posting; One for invoices in USD and one for invoices in CAD. What happens ? When I set my new field to Yes on the USA invoice job, it will automatically set it to Yes on the CAD invoice job as well. And vice versa:
 
I open the invoice job USD, go to parameters, change my new field to Yes and click OK.
I open the invoice job CAD, go to parameters and notice that my new field is set to Yes here as well. I set my new field to No and click OK
I open the invoice job USD, go to parameters and notice that my new field is set to No here as well
Etc.
 
If I understand the modifications from https://www.linkedin.com/pulse/storing-last-form-values-m-imran-qasmi-xme0c correctly, this might be caused by the fact that these modifications look at dataAreaId, curUserId, MenuItem and name are the unique combination. And when these modifications are called from the Batch jobs, they are the same and therefore changing one will automatically change the other.
So, this might not be the correct approach for this, but I cannot find any examples on google on how to achieve this in the correct way.
 
What I need is a field on the salesEditLines form which value will be remembered when it is changed in the parameters of an invoice Batch job.
 
Would you point me in the right direction ?
 
Thanks,
Gerard Verbruggen
 
 
 
  • Martin Dráb Profile Picture
    Martin Dráb 230,476 Most Valuable Professional on 14 Aug 2024 at 08:08:15
    How to add a field with xSysLastValue to salesEditLines (for invoice posting)
    Note that storing last used parameters in SysLastValue is a standard feature of batch frameworks (both RunBase and SysOperation).
  • CU13081248-0 Profile Picture
    CU13081248-0 15 on 14 Aug 2024 at 06:11:36
    How to add a field with xSysLastValue to salesEditLines (for invoice posting)
    Thanks  Martin for you reply. So indeed the wrong approach.
     
    I'm going for a different approach where we store the required values in a parameter table and retrieve the values in the DP class. Makes live easier.
     
    Cheers,
    Gerard
     
     
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,476 Most Valuable Professional on 13 Aug 2024 at 17:47:32
    How to add a field with xSysLastValue to salesEditLines (for invoice posting)
    The behaviour you see it's what you implemented, but you apparently want something else and therefore your change is wrong. You store the last value you selected in the form, e.g. if you used No, you'll see No when you open the form again.
     
    But what you seem to want is actually storing the value as a parameter of your batch, not just the form (shared by batches). Please realize that the posting processes is backed by FormLetter and batch frameworks; ignoring them doesn't sound like a good idea.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans
Loading complete