Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, July 5, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Adding ACTUALID to Add Opportunity Product breaks in Opportunity Wizard
Zaurusman
Posts: 44
 
Adding ACTUALID to Add Opportunity Product breaks in Opportunity WizardYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Dec 10 4:35 PM
fiogf49gjkf0d

Hey guys,


This is regarding 7.2.5.  I've added the ACTUALID field to all opportunity product grids and am experiencing an odd problem:  The changes I've made work when calling Add Opportunity Product from Opportunity Products, but when Add Opportunity Product is called from Insert Opportunity it fails in AddProductsToGrid (i.e. when clicking "add" to add a product to the products grid from the tree), essentially saying that the product grid's field "ACTUALID" can't be found.  


It's right there.  On the screen.  Looking at me.  Winking, almost.  And is built from the same sub in Insert Opportunity Common no matter what it's called from.


Any ideas where to look?  I've tried adding a second column of the same name just to see what happened and it didn't change anything.  Confirmed that both GetSelectedProductInfo and GetSelectedPackageInfo are indeed including that field in their result set just in case I was mis-reading the code and the problem was there.


Here's the code adding the column:



    Set col = grdProducts.Columns.Add(0)
    col.FieldName = "ACTUALID" 'DNL
    col.Caption = Application.Translator.Localize("Actual ID")
    col.Width = 80
    col.ReadOnly = True
    col.DisableEditor = True



And in AddProductToGrid, with grdProducts.Recordset:


.Fields("ACTUALID").Value = objRS.Fields("ACTUALID").Value


Here's the error message:


"Item cannot be found in the collection corresponding to the requested name or ordinal."  


Surely I'm just missing something simple...?

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Adding ACTUALID to Add Opportunity Product breaks in Opportunity WizardYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Dec 10 10:34 AM
fiogf49gjkf0d

you are missing something not so simple.
When you INSERT a record into a grid, you don't want to be going after any parent\related tables.
There is no Product.ActualID field in the Opportunity Product table. PERIOD. There is no Product.ProductID field in the Opportunity Product table either.
It's Opportunity_Product.ProductID linked to the Product table.

If you have an ADO recordset with parent table values in it and then do an
rs.AddNew for the 'base' tableADO will automagically create the new Parent(s) record(s) as well (which you don't want to do, correct?!).


Also, the field objRS.Fields("ACTUALID").Value probably doesn't exist in your recordset. It's most likely Aliased in the grid to A2_ACTUALID, for example.


On the MouseDown event for the grid (DON'T USE ONSELECT!) :
MsgBox " ActualID: " & gridname.GetCurrentField("ACTUALID")   '  is always a good one for testing.


 


 


 


 

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Adding ACTUALID to Add Opportunity Product breaks in Opportunity WizardYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Dec 10 11:42 AM
fiogf49gjkf0d

Quote:
Originally posted by Zaurusman
And in AddProductToGrid, with grdProducts.Recordset:


 .Fields("ACTUALID").Value = objRS.Fields("ACTUALID").Value


Here's the error message:


 "Item cannot be found in the collection corresponding to the requested name or ordinal."  


Surely I'm just missing something simple...?



I believe that you don't need to add this line of Code.


First of all, you are not adding a record to the Grid, you are adding a Record to the Opportunity_Product table.


As per RJ's response, there is no ACTUALID column on the OPPORTUNITY_PRODUCT table.


 


All you need to do is let the product be added as it was (remove this row), and the ACTUALID should populate on its own (depending on how the Grids are loaded, you may have to refresh the Recordsets) as it is just a linked field from the PRODUCT table that is displayed based on the Join from the OPPORTUNITY_PRODUCT to the PRODUCT table.


 

[Reply][Quote]
Zaurusman
Posts: 44
 
Re: Adding ACTUALID to Add Opportunity Product breaks in Opportunity WizardYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 10 4:11 PM
fiogf49gjkf0d

Thanks, guys; I didn't realize this was impacting the table directly.  Dropping that line of code does leave the field in the grid blank, however, and that then carries back to the Opportunity Product's grid.  When I navigate to another opportunity and back it's refreshed, so figured adding


grdProducts.Refresh 


would do take care of it, but it's not actually refreshing it.  Is there a better command to use to get it to reload the data?

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Adding ACTUALID to Add Opportunity Product breaks in Opportunity WizardYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 10 8:41 AM
fiogf49gjkf0d

grid.Refresh reruns your SQL statement from the .SQL property of the grid. May be modified by BINDID and 'autojoin' property of the grid (the field you've specified in the first tab of the SQL property.


Also look at the Columns property for the grid and make sure this Actual ID column is set up correctly. Again, a 2nd+ table 'name' is RARELY the field name itself. it would be more like A3_ACTUALID. See your SQL property for comparison.


We often (preferred method for us) get a recordset and then set the grid recordset = to our recordset to refresh grid data.


Set Grid.RecordSet = MyRS


ALSO! Which version of SLX is your SLXControls.OCX and Architect.exe for the development environment and which version of SLX is your SLXControls.OCX and SalesLogix.exe for your runtime environmentSSSSS. And in 7.2.2. it makes a BIG difference.

[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 © 2025 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): 7/5/2025 9:06:17 PM