cancel
Showing results for 
Search instead for 
Did you mean: 

Line from a Sales Blanket Agreement

Former Member
0 Kudos

If a Sales Blanket Agreement get copied to a document, I cant find a way to get the AgrLnNum when the document is not added to the databse.

The ArgNo I get with this simple line of code:


string AgrNo = ((EditText)oMatrix.Columns.Item("1980002193").Cells.Item(i).Specific).Value;

But there is no ArgLnNum in the Matrix and I can only read it from the database, when the documend is added to the databse.

If the document is "copyed from" the Line order can change therefor I need the correct Linenumber to copy UDFs from the Sales Blanket Agreement to UDFs in the document.

Is there any way to get the AgrLnNum or a better way to Link the Lines between them?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try to get it using the DBDataSource instead of the Matrix object.

for example:


string AgrNo = oForm.DataSources.DBDataSources.Item("POR1").GetValue("ArgLnNum", 0);

Beni.

Former Member
0 Kudos

I get A "Collection - Out of boundaries  [66000-34]" Error is I use your Code.

Former Member
0 Kudos

Hi,

Which document you're using. POR1 is for Purchase Orders Lines. If you're in another document, change to the appropriate table name.

Beni.

Former Member
0 Kudos

Hi,

I changed to QUT1, because I use a Quotation and I fixed ArgLnNum to AgrLnNum.

string AgrNo = oForm.DataSources.DBDataSources.Item("QUT1").GetValue("AgrLnNum", 0);

But now I get a empty string.

Former Member
0 Kudos

Hi,

Line's DBdatasource object is filled/refreshed only before saving the file. You should catch the Add or Update events and then run the above code.

Beni.

Former Member
0 Kudos

Hi,

this is interessting, but not helpfull to the problem I'm facing.

The Customer needs the UDFs before he add's them to the database.

Former Member
0 Kudos

Hi,

You may also use your original code. The column uid for agreement line is 1250002131.

Beni.

Former Member
0 Kudos

Yes this seams to work !

Thank you Beni !

Answers (0)