on 09-20-2015 10:09 PM
Dear SAP experts,
I am trying to edit the matrix of a system form (Sales Order) through a bespoke Add-On.
I successfully managed to add and delete items, but for some reason, the totals are not recalculated. They still show the original totals before the update. I'd rather leave this to the system instead of doing it myself.
I tried to execute the Matrix's method 'FlushToDataSource()' but no luck (it gives me an error 'The item is not a user defined item 66000-8').
I also tried (naïvely) to refresh the form itself.
How can I achieve this and also to commit the changes to the database?
Using SAP B1 8.81 / C#
Regards.
Please post the method/procedure code in which you are trying to accomplish this. From what I've seen, usually when you get an error like that, it means that you're trying to reference a column/row by using a hard coded index value that's different from the column/row that you actually want to update. I do that all the time, and have started to use the IndexOf function instead of hard coding indices to avoid the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found a similar thread which describes exactly the same problems I have:
Hi Nicolas,
There is an workaround similar that suggest in thread that you find.
Try something like this:
1. Set focus to the line that you need delete
oMatrix.Columns.Item("select an id of some cell - preference the item code").Cells.Item(line).Click();
2. Call the menuItem DeleteRow
SBO_Application.ActivateMenuItem("1293");
For save your document, you can simulate the user click in add button, like this:
SBO_Application.Forms.ActiveForm.Items.Item("1").Click();
P.S: I suggest that you insert your sales order by DI API if is possible.
Hope it helps,
Diego
try with
oMatrix.Clear()
oColumn.DataBind.UnBind()
oColumn.DataBind('DATASOURCE','DATASOURCE-ALIAS')
oMATRIX.LoadFromDataSource()
regards
Helene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.