a week ago
Dear Supporters,
I have a problem about Create Batches from Batch Number form.
Create button will open Batch form for one by one item => Batch created will save as Batches Difference temporary.
That seems to take quite a bit of time for the customer
So, i want to set auto create batch one by one item but Batches Difference matrix is a system form and i can not add row to this.
Share me how to add row to Batches Difference matrix and update Rows from Documents after add Batch success, please!
Thanks for your time!
Here is my code
Matrix mtx_RowsFromDocs = (Matrix)oForm.Items.Item("3").Specific;
List<BatchModel> batchModels = new List<BatchModel>();
if (mtx_RowsFromDocs != null)
{
BatchModel itemModel;
for (int i = 1; i <= mtx_RowsFromDocs.RowCount; i++)
{
itemModel = new BatchModel();
itemModel.ItemCode = ((SAPbouiCOM.EditText)mtx_RowsFromDocs.Columns.Item("1").Cells.Item(i).Specific).Value;
itemModel.CountByItem = batchModels.Count(b => b.ItemCode.Equals(itemModel.ItemCode)) + 1;
itemModel.WhsCode = ((SAPbouiCOM.EditText)mtx_RowsFromDocs.Columns.Item("3").Cells.Item(i).Specific).Value;
itemModel.TotalNeed = double.Parse(((SAPbouiCOM.EditText)mtx_RowsFromDocs.Columns.Item("55").Cells.Item(i).Specific).Value);
itemModel.Batch = string.Format("{0}.{1}", PostingDate.ToString("yyMMdd"), itemModel.BatchAttr1);
batchModels.Add(itemModel);
Matrix mtx_BatchesDiff = (Matrix)oForm.Items.Item("5").Specific;
int rcount = mtx_BatchesDiff.RowCount;
mtx_BatchesDiff.AddRow();
((SAPbouiCOM.EditText)mtx_BatchesDiff.Columns.Item("1").Cells.Item(rcount + 1).Specific).Value = itemModel.Batch;
((SAPbouiCOM.EditText)mtx_BatchesDiff.Columns.Item("29").Cells.Item(rcount + 1).Specific).Value = itemModel.TotalNeed.ToString();
((SAPbouiCOM.EditText)mtx_BatchesDiff.Columns.Item("52").Cells.Item(rcount + 1).Specific).Value = "-1";
mtx_RowsFromDocs.Item.Update();
}
}
But when i run to go to this code then error: form item is not editable
((SAPbouiCOM.EditText)mtx_BatchesDiff.Columns.Item("1").Cells.Item(rcount + 1).Specific).Value = itemModel.Batch;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
15 | |
10 | |
5 | |
4 | |
3 | |
3 | |
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.