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!
|
|
How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 13 Apr 07 4:41 PM
|
fiogf49gjkf0d Try this in a SalesLogix eval environment: Add a PRODUCT2 table (1:1 relationship to PRODUCT) with one custom column called "More Data" (string), then insert some lines in that table with Product IDs corresponding to a few rows in the PRODUCT table and some data in the "More Data" column. Then modify the "System:Manage Product" form by adding the "More Data" column to the grdProduct datagrid. You also need to modify the "BuildSQLQuery" subroutine to include the new column as this sets the SQL property of the datagrid dynamically.
I have a bundle that does all of this that I will happily share.
The issue is that when the client is run, although the new custom column shows up in the datagrid there is never any data in it. The SQL getting passed to the database in the SLX profiler is correct (returns results with data in that column when run in Query Analyzer or even in the Administrator "Execute SQL") but it doesn't display any data in the grid in the client.
I have an open support ticket with Sage (3807153) on this issue because their SDK support couldn't figure it out either, and I haven't been able to find anything on this anywhere on the slxdeveloper.com forum or article search. I can't believe I'm the first guy to ever want to add a custom column to the Manage Product grid???
I am at mmazzitello@vitalimages.com and 952-487-9597 if anyone has any ideas or wants my bundle that does all of the above steps. Any help at all would be appreciated, this is holding up a development project involving our 500+ products.
Thanks! |
|
|
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 13 Apr 07 6:14 PM
|
Hi Mark,
Believe me, you're not the first person to want to modify that, and definitely not the first to run into problems. No one likes working with that area of SLX. No fun and a real pain to work with
I have modified that area before, but I can't recall off top of my head what the tricks were. I'll dig around and see if I can remember (or maybe someone else will chime in with what they've found). |
|
|
| |
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 14 Apr 07 10:51 AM
|
Originally posted by Bob (RJ)Ledger
FYI: This is the kind of stuff "we" make our income off and typically do not post to public forums or give away. |
|
Then you're in the wrong place IMO That's what these forum are about, not making money, but helping the community.
I actually am Mark's BP. I encourage my customers to come to places like these forums. I think it is great that we actually have a "community" that we call can be a part of and share our experiences with others in the same boat, working with the beast we call SalesLogix
Mark, I'll dig the answers out for you on Monday and post them back here. |
|
|
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 15 Apr 07 4:30 AM
|
fiogf49gjkf0d This is the area you need to review and alter - good luck !!
========================================== "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( ) |
|
|
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 16 Apr 07 9:39 AM
|
Thanks Ryan.
I did get a reply from Mike Spragg that I'm going to try, but it doesn't seem to make much sence because all of the modifications in his list have to do with Opportunity products and are for forms & scripts not even called by the program until a product change is made (and thus should not affect the initial display of the Manage Product form & grid), but I have faith and I'm going to give it a try. If you come up with anything else please let me know.
I also want to thank you for running this forum, and I agree completely with your philosophy on it. As a "certified" SLXD & SLXE myself I appreciate a place to go to research & share tips, tricks, etc. with other developers. RJ's point is well taken, and if I was looking for someone to actually do the modifications & customizing to my SLX implementation I certainly would not expect someone on the forum to do it for me for free - this is where I would pay a business partner to do the work - but as a resoruce to share and research these odd & undocumented & quirky things about SLX this forum is incredibly helpful.
Thanks again,
Mark
|
|
|
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 16 Apr 07 11:11 AM
|
========================================== "Simply" adding a new field to OppProduct: ==========================================
Hi Mike. I just want to double check here before I go trying to modify all of this code, it is not "Opportunity Products" that I want to modify, it is "Manage Products" (as in 'Tools < Manage < Products'). All of the code & plugin names in your list above (including the title itself) refer to Opportunity Product and not Manage Product.
I just want to make sure before I start changing stuff.
Thanks,
Mark
|
|
|
| |
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 16 Apr 07 4:31 PM
|
fiogf49gjkf0d Hi Mark - I have just read this post and think that you may be getting the wrong advice.
The Tools / Manage / Product form is not shared with all the Opportunity Product stuff and I think that you are having problems because you have created an additional 1:1 Product table.
When you save your new record, the data that you have added that is in the new table will not be saved ... because it is in a new table and the datagrid control doesn't have the intelligence to go away and create the new record for you.
IMO, the easiest way around this is to throw away your new table and extend the PRODUCT table itself, then everything becomes simpler. If the PRODUCT table is locked (ie you can't add new fields), you'll need to unlock it, add the new field(s) and then lock it again. If you need to know how to do this, post again and I will tell you how.
Ryan, as your BP, will no doubt jump in if he thinks that you should not adopt this approach |
|
|
| |
|
Re: How to add a column to the Manage Products datagrid (and have it actually work)?
Posted: 16 Apr 07 5:48 PM
|
I'm afraid that I disagree again
There is another entry point to the form - Insert Opportunity / Add Product and then click on the 'Manage Products' button - this just displays the same form as Tools / Manage / Products.
But the grids are not shared. Perhaps you are confusing this with the Opportunity / Products tab and the Insert Opportunity / Add Product grid, which are shared? |
|
|
| |
|
Re: How to add a column to the Manage Products datagrid - Solution found!!!!
Posted: 16 Apr 07 6:28 PM
|
Well I found the problem (and the fix), it's really simple, and I feel stupid for taking 3 damn days to figure it out...
OK - here goes:
When you add the custom column to the grdproducts grid on the Manage Product form by going into the "SQL" property of the grid itself and dragging the column onto the layout in the query builder, the system adds a prefix to the column name. This is only shown if you go into the "Columns" property of the datagrid, right click on the new column, go to the "properties" of that column, and look at the "Field:" property. Mine ended up having the column name "A2_MOREDATA" instead of the actual column name "MOREDATA" - this property is also grayed out so it cannot be changed. Whenever the grid is refreshed, the "BuildSQLQuery" subroutine in the script behind the form dynamically replaces the actual SQL property of the datragrid, and that's where the problem comes in. Even after modifying the strSQL text to include my custom column (which did return correct results when captured by SLX Profiler and pasted into Query Analyzer), it would not fill in any data in the custom column BECAUSE THE F**ING COLUMN NAMES DON'T MATCH!!! No error messages, no indications whatsoever that anything was amiss, just no data in the column. All I had to do was to add a "as" clause into the strSQL for my custom column so it would go into the record set as "A2_MOREDATA" instead of "MOREDATA" - it was that simple.
Mike S is right, in that the Opportunity Products and other places that products are shown would need to be modified to have this custom column in the correct grids, etc. but luckily all I needed was for it to show in the Manage Product form.
Thanks for all of the advice & help suggestions from everyone. I certainly appreciate this forum and all who organize & participate in it. Hopefully my pain in figuring out this little item will help others.
I'd be happy to demonstrate this to Ryan or Mike or anyone else, and I can even talk you through it over the phone with an Eval (6.2.x) database in about 2 minutes. My contact info is mmazzitello@vitalimages.com
Mark
|
|
|
|
Re: How to add a column to the Manage Products datagrid - Solution found!!!!
Posted: 16 Apr 07 6:37 PM
|
Mark, Glad to see that you got it... only 3 days.. that was fast  Seriously.. it took a while for us to figure it out as well.. I took a "bath" on it the first time.. had only quoted 4 hrs.... took a lot longer....
The alias/rename is all over the place but it's especially messy in the area you were working in.
rjl |
|
|
|
Re: How to add a column to the Manage Products datagrid - Solution found!!!!
Posted: 17 Apr 07 10:51 AM
|
Glad to hear it is solved! This is one of the most troublesome areas to customize in SLX. I hate working in places like this.
Anyway, best part is that this thread will serve as a great place for others who are attempting the same type of customization. Anyone feel up to a quick write-up to make this into a full article for the site?
-Ryan |
|
|
|
Re: How to add a column to the Manage Products datagrid - Solution found!!!!
Posted: 17 Apr 07 10:56 AM
|
Hi Ryan.
I will certainly do a write up for an article if it can wait until this weekend. Do you have a template or form to follow, or should I just write a few paragraphs and send them directly to you to post?
Let me know, I'm happy to finally have something worth contributing to the forum!
Mark |
|
|
| |
| |
|