In Purchase order there is a generate confirmation which brings up a form, and there is a Confirm button under the Action group which just confirm and doesn't bring up the PurchEditLines form.
SalesOrder doesn't have this feature. So I have created a confirmation that doesn't bring up the SalesEditLines form. However, when I run this confirm first and then the generate confirmation, I have to clear my usage data before the Generate confirmation brings up the SalesEditLines form again.
I can call the below logic, but it clears all usage data for the current user:
SysLastValue lastValue;
userId userId = curUserId();
ttsbegin;
delete_from lastValue
where lastValue.UserId == userId;
ttscommit;
I don't see the "SysLastValue" table in the AOT in Visual Studio to see if it has other fields to use in the criteria.
Purchase Order must do it somewhere because I can flip between the action confirm and the Generate Confirmation with Generate Confirmation always showing the form. I cannot see where it is doing it though because it also runs purchformLetter.forceSaleLast(), same as SalesFormLetter.
Does anyone know what I'm missing? Thanks.
Martin I've run a query against SysLastValue and both the generate confirmation button and my new confirmation button creates the sysLastValue record with elementName = 'Salesformletter_confirm' and Designname = 'SalesTable'. Thus the reason why when my action confirm button is run first and then the generate confirm button, the dialog isn't shown for the generate.
Now Purchase Order pass in the enum PurchOrder for the action Confirm and ConfirmationRequest for the generate confirmation. So I assume that is the reason why the one's lastValue doesn't influence the other one.
However PurchFormLetter is a lot easier than SalesFormLetter in the way the latter was changed for D365. To do the same I have to add a new EnumValue to the baseEnum, then I have to figure out where all the places are I need to change to talk to this new enumValue. So I'm using Confirmation as the Enum parameter for my new class.
My new class derives from SalesformLetter, same as SalesformLetter_Confirm derives from SalesformLetter. However when I add the construct to my class and let it instantiate my new class, it gives me an error that it cannot cast salesformletter_confirm to my new class. Looking at SalesformLeeter_Confirm.Newconfirm , which is now obsolete according to the comment just above the method, it casted salesformLetter back as salesformLetter_Confirm. I don't have time in my deadline to figure out with the new changes to SalesformLetter in D365 where to add the new enum parameter if I add it to the base enum.
So for now I'm deleting SysLastValue where the userID is the current user and elementname = "salesformletter_confirm" and designName = "Salestable".
The fact that you must delete something from SysLastValue every time is highly suspicious. Isn't it merely hiding a bug that should be fixed?
That was what I was thinking but because I couldn't find SysLastValue in the AOT to get the fields, I wasn't sure it was the way to go. Don't want to mess with an internal table
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156