Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 29, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Administration Forums - Upgrades
Forum to discuss upgrading SalesLogix from version to version. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Upgrades | New ThreadView:  Search:  
 Author  Thread: Help: Insert Opportunity Products Not Saving!!!
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Help: Insert Opportunity Products Not Saving!!!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Feb 07 1:04 PM
fiogf49gjkf0d
We customized the Insert Opportunity form and it used to work in 6.2.1. We just upgraded to 7.0.1 and now when inserting a new opportunity it will not save the products. It works fine if you add the products from the opportunity detail screen.

I have compared the 6.2.1 and 7.0.1 versions and there isn't anything different from what I can find. I've tested releasing the 6.2.1 version and it works fine. This is the code that saves the products (at least this is what I think the code is..) Can anyone spot why the products would not be saved when inserting an opportunity???

Sub SaveOpportunityProductInfo
Dim objPrdRS, objRS
Dim i, strSQL

Set objPrdRS = objSLXDB.GetNewRecordSet
objPrdRS.Locktype = adLockBatchOptimistic
strSQL = "Select * From OPPORTUNITY_PRODUCT Where 1=2" 'DNL
objPrdRS.Open strSQL, objSLXDB.Connection

objPrdRS.ActiveConnection = Nothing
Set objRS = grdProducts.RecordSet

If objRS.RecordCount > 0 Then
objSLXDB.CloseConnection
objRS.MoveFirst
For i = 0 To objRS.RecordCount - 1
With objPrdRS
.AddNew
.Fields("OPPPRODUCTID").Value = Application.BasicFunctions.GetIDFor("Opportunity_Product") 'DNL
.Fields("OPPORTUNITYID").Value = strOpportunityID 'DNL
.Fields("PRODUCTID").Value = objRS.Fields.Item("PRODUCTID").Value 'DNL
.Fields("QUANTITY").Value = cDbl(CheckForNull(objRS.Fields.Item("QUANTITY").Value)) 'DNL
.Fields("DISCOUNT").Value = cDbl(CheckForNull(objRS.Fields.Item("DISCOUNT").Value)) 'DNL
.Fields("PRICE").Value = cDbl(CheckForNull(objRS.Fields.Item("PRICE").Value)) 'DNL
.Fields("EXTENDEDPRICE").Value = cDbl(CheckForNull(objRS.Fields.Item("EXTENDED").Value)) 'DNL
.Fields("CALCPRICE").Value = cDbl(CheckForNull(objRS.Fields.Item("ADJPRICE").Value)) 'DNL
.Fields("PROGRAM").Value = CheckForNull(objRS.Fields.Item("PRICELEVEL").Value) 'DNL
.Fields("PRICEEFFDATE").Value = Now 'DNL
.Fields("SORT").Value = CheckForNull(objRS.Fields.Item("SORT").Value) 'DNL
End With
objRS.MoveNext
Next

objSLXDB.OpenConnection
Set objPrdRS.ActiveConnection = objSLXDB.Connection
objPrdRS.UpdateBatch
End If

' CTS 2006-12-06 4061 Create new recordset object for C_SIN_OPPPRODUCT update
Set objPrdRS = Nothing
Set objPrdRS = objSLXDB.GetNewRecordSet
objPrdRS.Locktype = adLockBatchOptimistic
strSQL = "Select * From C_SIN_OPPPRODUCT Where 1=2"
objPrdRS.Open strSQL, objSLXDB.Connection

' CTS 2006-12-06 4061 Get values from grid for update
objPrdRS.ActiveConnection = Nothing
Set objRS = grdProducts.RecordSet
If objRS.RecordCount > 0 Then
objSLXDB.CloseConnection
objRS.MoveFirst
For i = 0 To objRS.RecordCount - 1
With objPrdRS
.AddNew
.Fields("OPPPRODUCTID").Value = Application.BasicFunctions.GetIDFor("Opportunity_Product")
.Fields("PROFIT_MARGIN").Value = cDbl(CheckForNull(objRS.Fields.Item("PROFITMARGIN").Value)) 'DNL
.Fields("PROFIT_AMOUNT").Value = cDbl(CheckForNull(objRS.Fields.Item("PROFITAMOUNT").Value)) 'DNL
End With
objRS.MoveNext
Next
objSLXDB.OpenConnection
Set objPrdRS.ActiveConnection = objSLXDB.Connection
objPrdRS.UpdateBatch
End If

objPrdRS.Close
Set objPrdRS = Nothing
Set objRS = Nothing
End Sub


Thanks,
John G.
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Help: Insert Opportunity Products Not Saving!!!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Feb 07 12:21 AM
fiogf49gjkf0d
If the scripts are the same, check the controls and their properties.

c
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/29/2024 8:56:45 AM