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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

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

(1) ShareShare
ReportReport
Posted on by 177
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
 
 
 
  • Verified answer
    Martin Dráb Profile Picture
    240,744 Most Valuable Professional on at
    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.
  • Gerard Verbruggen Profile Picture
    177 on at
    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
     
     
  • Martin Dráb Profile Picture
    240,744 Most Valuable Professional on at
    Note that storing last used parameters in SysLastValue is a standard feature of batch frameworks (both RunBase and SysOperation).

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 366

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 360 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans