a month ago
I've created my own User-defined table and use it in my editable matrix sending data back and forth to DBDataSource with LoadFromDataSource() and FlushToDataSource()
The question is, to store data, including insert, update and delete, back to UDT, do I need to manually loop over rows in the matrix, then run .Update(), .Add() or .Remove() myself or is there a way to manage it automatically?
I'm stuck at FlushToDataSource() after clicked on a Update button and ChatGPT taught me to manually set the data back, but I don't think it's an efficient way and tried to find other ways in UI and DI manual but not found anything.
Here is my code
if (pVal.ItemUID == "1" && pVal.FormMode == (int)SAPbouiCOM.BoFormMode.fm_UPDATE_MODE && pVal.EventType == SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED && pVal.BeforeAction == true)
{
SAPbouiCOM.Form oForm = oApp.Forms.Item(pVal.FormUID);
SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item("matrix").Specific;
oMatrix.FlushToDataSource();
SAPbouiCOM.DBDataSource oDBDataSource = oForm.DataSources.DBDataSources.Item("@myUDT");
...here is where I'm stuck.
}
Request clarification before answering.
Hi Peach14,
You can register the User Defined Object (UDO) for your user form.
After that system automatically handles Add, Update, Remove operations.
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.