cancel
Showing results for 
Search instead for 
Did you mean: 

how to add multiple rows?

cynthia_tagger
Explorer
0 Kudos

Hi

I try the following code to add multiple rows but I'm getting error, it works only for adding single row

Hereby my code:

var PRService = company.getBusinessService('22');

var doc = company.createDIObject('Document');

doc.setCardCode("20100000");

doc.setDocDueDate("2014-12-28"); // ("YYYY-MM-DD");

var docLines = doc.getDocumentLines();

if (docLines == null) {

    docLines = company.createDIObject('DocumentLines');

}

var docLine = company.createDIObject('DocumentLine');

docLine.setItemCode("64300003");

docLine.setQuantity(65);

docLine.setPrice(23.7);

docLines.add(docLine);

// **** Second line doesn't 

docLine.setItemCode("64300003");

docLine.setQuantity(49);

docLine.setPrice(31);

docLines.add(docLine);

doc.setDocumentLines(docLines);

PRService.add(doc);

Please Advise

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Is this a workflow question?

cynthia_tagger
Explorer
0 Kudos

Hi Rick, yes this is a Sap Business One workflow question.

ronen_weisz
Active Contributor
0 Kudos

this is not the Sap Business One workflow - try

cynthia_tagger
Explorer
0 Kudos

Well, found the problem anyway, tnx.

Answers (0)