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