fiogf49gjkf0d Hy everyone, I'm a new user of this board.
I have a problem with a costumization in Saleslogix v 7.2.2 and I hope that someone can help me 
Thats my problem:
The main goal of this costumization is add two fields in Add Opportunity Product view. The values of this two fields should be appear in the product grid when I click on Add button.
I followed this step:
1) I created two fields in table Opportunity_Product: ACCOUNTMANAGERID2 (varchar) and OPPORTUNITYSTATUS (varchar)
2) I edited the script Insert Oppotunity Comon in this way:
Set col = grdProducts.Columns.Add(0) col.FieldName = "ACCOUNTMANAGER2" col.Caption = "Commerciale" col.Width = 40 Set col = grdProducts.Columns.Add(0) col.FieldName = "STATUS" col.Caption = "Stato" col.Width = 40
---------
.Fields.Append "ACCOUNTMANAGER2", adVarChar, 64 .Fields.Append "STATUS", adVarChar, 12
3) Edited the Opportunity:Products view in this way:
In the sub PopulateDataGrid I changed the query:
strSQL = "Select op.OPPPRODUCTID, op.PRODUCTID, op.PRICE, op.DISCOUNT, op.QUANTITY, " & _ "op.CALCPRICE, op.EXTENDEDPRICE, op.SORT, op.PROGRAM, op.ACCOUNTMANAGER2, op.OPPORTUNITYSTATUS, " & _ "p.NAME, p.FAMILY " & _ "From OPPORTUNITY_PRODUCT op " & _ "Inner Join PRODUCT p " & _ "On (op.PRODUCTID = p.PRODUCTID) " & _ "Where OPPORTUNITYID = '" & strOpportunityID & "' " & _ "Order By op.SORT"
and I add this two lines to the grdProducts.recordset definition:
objPrdRS.Fields("ACCOUNTMANAGER2").Value = "" & .Fields("ACCOUNTMANAGER2").Value objPrdRS.Fields("STATUS").Value = "" & .Fields("OPPORTUNITYSTATUS").Value
4) Always in Add Product Opportunity I edited the sub AddProductToGrid(objRS, intQty):
.Fields("ACCOUNTMANAGER2").Value = comm .Fields("STATUS").Value = st
where comm and st are two variables that contain the values of the two fields that I added in Add Opportunity Product view.
Now the problem is:
If I add a product from the Opportunity:Products's grid making a right click of the mouse everithing works fine. The Add Opportunity Product is open and I have no problem.
However the problem occour when I cal Add Opportunity Product view from Insert New Opportunity form. In this case the Add opportunity Product View opened correctly but when I click "Add>" I got this error:
"Item cannot be found in the collection corresponding to the requested name or ordinal" in the script Add Opportunity Product line 538 char 10 that correspond at this two lines:
.Fields("ACCOUNTMANAGER2").Value = comm .Fields("STATUS").Value = st
It seems that the grdProducts.recordset doesn't have this two field?? How could be possible? Whats I'm wrong?
Thank you, I hope that someone help me because I'm desperate... 
Sorry for my English...
|