cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP B1 sdk addrow removes CFL content from previous row

kinyanjui_kamau
Participant
0 Kudos
349

I have a choose from that I created with screen painter that I use on a matrix. I have an issue when I add row for this specific column. The CFLs for Item code and name hold their values but the BP Catalog No. CFL value disappears when I add a new row.

How do I make the CFL not lose its value?

Below is a screenshot of the CFL and link button definition

Here is the code for setting the values:

#region For BP catalog no.<br>if (oDataTable.UniqueID == "CFL_BPCat")<br>{<br>    if (oDataTable != null)<br>    {<br>        SOEntities _db = new SOEntities();<br>        using (_db)<br>        {<br>            bpCatalog = System.Convert.ToString(oDataTable.GetValue(2, 0), null);<br><br>            itemCode = _db.OSCNs.Where(x => x.Substitute == bpCatalog).Select(y => y.ItemCode).FirstOrDefault();<br><br>            if (itemCode != null)<br>            {<br>                itemName = _db.OITMs.Where(x => x.ItemCode == itemCode).Select(y => y.ItemName).FirstOrDefault();<br><br>                _itemNo.ValueEx = itemCode;<br>                _itemDesc.ValueEx = itemName;<br>                _bpCatalog.ValueEx = bpCatalog;<br>            }<br><br>            oIMatrix.SetLineData(pVal.Row);<br>        }<br>    }
}

 private void ClearItemMatrix()<br>        {<br>            _itemNo.ValueEx = "";<br>            _itemDesc.ValueEx = "";<br>            _bpCatalog.ValueEx = "";<br>            _quantity.ValueEx = "0";<br>            ....<br>        }

How do I fix this problem? I clear fields with the method ClearItemMatrix() before add row even so as not to have values repeat on bottom row. Is this the way to do it?

_bpCatalog.ValueEx is a userdatasource

Any help appreciated,

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi kinyanjui.kamau,

Can you try to use the method GetLineData() as suggested in SAP Note 2408856 and share the result with us?

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

kinyanjui_kamau
Participant
0 Kudos

Thanks for the reply. I don't have an S-Number for SAP notes but will look into that method.

Answers (0)