A user chooses some products from a catalog, then clicks a “Create order” button, and the ordered products are written to a new order document. All orders are required to have standard delivery costs as a product, so this is added to the user’s selection. Users get the “Could not create field: ProductPrice” error when the ProductPrice field is created with the code:
Set itOrderProductPrice = New NotesItem(docOrder,“ProductPrice”,Prices)
Prices is an array that contains prices of selected products. There were no problems with the code until I added the standard delivery costs as a product. I do that by defining the first member of the array as standard delivery costs:
Prices(0) = 1500
'Then I start a counter at 1:
iCount = 1
'Then I loop through all the selected products:
Redim Preserve Prices(iCount)
Prices(iCount) = docProduct.CTPrice(0)
iCount = iCount + 1
Why can’t I define the first member of the array directly, and then define the rest in a loop later?