8/29/2025 12:28:56 AM
|
|
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!
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.
|
|
|
|
thanks for previous advice - still can't get it to work
Posted: 28 May 09 11:13 AM
|
We wanted to change cost price as a default in the opp.products grid and a bright spark said we shoudl create our own grid brilliant idea and so i tried. the grid appears but no data. I know i am not alone with this problem. code below
option explicit
'This is needed because the WhenOpen event for a form does not fire 'when the form is used as a tab on the Opportunity Detail view. 'Do not remove. Sub txtDataBoundChange(Sender) Dim strSQL
strSQL ="SELECT OPPORTUNITY_PRODUCT.PRODUCTID as A2_PRODUCT_ID, PRODUCT.DESCRIPTION AS A3_DESCRIPTION, PRODUCT.FAMILY AS A3_FAMILY, PRODUCT.FIXEDCOST AS A3_FIXEDCOST," _ & "OPPORTUNITY_AVC.QTY_TO_ORDER AS A4_QTY_TO_ORDER" _ & "FROM OPPORTUNITY INNER JOIN" _ & "OPPORTUNITY_PRODUCT ON OPPORTUNITY.OPPORTUNITYID = OPPORTUNITY_PRODUCT.OPPORTUNITYID INNER JOIN" _ & "PRODUCT ON OPPORTUNITY_PRODUCT.PRODUCTID = PRODUCT.PRODUCTID INNER JOIN" _ & "OPPORTUNITY_AVC ON OPPORTUNITY.OPPORTUNITYID = OPPORTUNITY_AVC.OPPORTUNITYID WHERE opportunity.OPPORTUNITYID = OPPORTUNITY_PRODUCT.OPPORTUNITYID"
po.SQL = strSQL po.Refresh
End Sub
i apologise in advance for wasting anyones time with what is probably an obvious issue
many thanks in advise
grid display beautifully in enterprise manger |
|
|
|
Re: thanks for previous advice - still can't get it to work
Posted: 28 May 09 12:19 PM
|
First of all, the reason why the events are not firing is more than likely because there are no bound controls on the Form, so you may be able to either drop a hidden text field bound to any opportunity field, or bind the Grid to the OpportunityID (Suggested method, read below why).
Second, the SQL Statement is not filtering out for any specific opportunity, you should add a condition to filter only for the Current Opportuntiy: OPPORTUNITY.OPPORTUNITYID = 'XXXXX'. If your grid is bound, you could use OPPORTUNITY.OPPORTUNITYID = :bindid
Third, and this may depend on the version of SLX you are working on, use the following property: po.SQL.Text = strSQL
Fourth, have you added Columns to the Grid and bound them to the field names you defined on your statement? You could do so by defining the Grid SQL, laying out the Columns and then matching your statements to it.
Fifth, run the SLXProfiler to see if SLX is able to parse that statement.
And finally, yes the Product Grids under Opportunity is somewhat complex, but it can be modified. You just need a bit of patience to review all components involved and how your changes affect them. |
|
|
|
Re: thanks for previous advice - still can't get it to work
Posted: 29 May 09 3:24 AM
|
There are a whole bunch of forms that need to be modified (you've found one!) - look below for the rest.
========================================== "Simply" adding a new field to OppProduct: ==========================================
Form: Opportunity:Products -------------------------- Sub PopulateDataGrid : modify to include col in sql, and the grdProducts Sub CommitChanges : Modify to include col in sql, and the update rs
Form: System:Insert Opportunity ------------------------------ Sub SaveOpportunityProductInfo( )
Script: System:Insert Opportunity Common ---------------------------------------- Sub DefineProductsGrid(oppID) : modify to include new section detailing new column Function CreateProductsRSStructure : modify to include new column Function DoGridCalculations(Sender, FieldName, Value, OppID) : Modify to include within loop/case the new field If strCrntRecord = .Fields("KEYFIELDID").Value Then .Fields("yourfieldhere").Value = Value End If Sub SaveOpportunityProductInfo( ) Sub RemoveProducts( )
Form: System:Add Opportunity Product ------------------------------------ Sub AddProductToGrid(objRS, intQty) : Modify to include any defaults Sub UpdateCurrentProduct( ) Sub AddDeleteProductToDB( )
|
|
|
| |
|
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!
|
|
|
|
|
|
|
|