cancel
Showing results for 
Search instead for 
Did you mean: 

How to: Matrix and DataSource

Former Member
0 Kudos

Hi experts!

So, i'm starting in UI Development and i have some doubts.

First, i develop my first application catching Events and using Matrix, EditText and Cell objects, but the addon was very slow. I found in this forum to freeze the form before to perform de actions and unfreeze after completion. Ok, it improved performance slightly, but still slow.

I read here quiet a lot about datasources but still cannot understant the concept and how to use it for my situation.

Can you help me???

Thanks in advance.

Regards,

Eduardo.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Eduardo,

Welcome you post on the forum.

What is your goal for the add-on? Datasource relates tables in the database. Which tables do you need?

Thanks,

Gordon

Former Member
0 Kudos

Well... Thanks for the answer...

I'm working with the lines of Purchase Order. So, POR1.

In each row, i need to catch some values after an Lost Focus event, calculate and fill the result in a user field which is also located on the row.

I hope i have succeeded explain myself.

Thanks again.

Regards,

Eduardo.

Former Member
0 Kudos

Unfortunately when working with a system form, you are more limited in what you can do.

But there are some things:

1 - are you filtering events? Check the sample C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\CSharp\08.EventsFilter to see if you are using it correctly.

2 - If the PO has already been added,you can access the lines by using the datasource

form.DataSources.DbDataSource.Item("POR1").GetValue("ItemCode", i) 
// Where i is the matrix row number - 1)

But if the document is still in add mode, this does not work and you have to access through the matrix object.

3 - if you are using a new version of B1, there is a method SetCellWithoutValidation on the matrix object, that does at it says - it allows you to set a cell with no validation and this is much faster.

event filtering will speed things up, and setcellwithoutvalidation also does. In combination with freezing the form, and optimising your routine as much as possible, this is the best you can do if in ADD mode.

Former Member
0 Kudos

Hi.

Yes, i'm filtering the events Lost Focus and Combo Select with the help of B1DE.

My B1 is 8.8 PL 16 and i'm using VS2008 to develop the addon.

And yes, unfortunately, i will treat the two situations, on add and on update.

About the method SetCellWithoutValidation, I do not know. I'll take a look. Thank you.