Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 17, 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!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Execute C# snippet from a grids column
Ken Poggensee
Posts: 71
 
Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 08 5:42 PM
I have a data grid where I want to put a link in that is going to execute a C# snippet that will create a new record in another table based on some of the values in the selected row.

Basically it’s 2-grids side by side. One has list of all kinds of stuff that can be added to the other grid. I want to simply be able to press a link or something in the first grid and go create the record for the other grid in a little C# snippet. Where is the best place to stuff this puppy?

I saw that there is a ‘Row Selection Column’ that highlights the whole row for me, but I don’t see where I can tack on a script.

I tried to use a ‘Link Column’ but it seems like I can only link to another page\entity.

There is a ‘Custom Format Column’ where it looks I can put some code in there, but anytime I try to do something in there I get the following (or similar) error.
Invalid token '=' in class, struct, or interface member declaration

--Ken-
[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Dec 08 5:44 PM
Oh... and I would like to keep it AA rather than creating a custom smart part for it.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 08 1:41 AM
You'll want to use a custom column. I have an article on how to use those here: http://customerfx.com/pages/crmdeveloper/2008/09/11/Custom-Format-Columns-in-SalesLogix-Web-and-Linking-to-External-Sites-in-a-DataGrid.aspx (but of course your custom column can execute whatever C# code you'd like, even calling business rules instead of just linking to some other site)

-Ryan
[Reply][Quote]
Alberto Chiesa
Posts: 49
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 08 2:44 AM
That is a real life saver tip! I used it so many times.

The problem for me is that I am not able to execute the C# snippet when the user presses the link.

The snippet gets executed when the column is filled, so I can't find a way to link a callback to a link/button whatever.

Probably I am missing something really basic, here. Any suggestions?

[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 08 4:24 PM
That what I was looking for thanks.
[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 08 4:45 PM
Opps... just saw your post there Alberto and went back to put mine to the test.

Indeed it does fire on the creation of the datagrid and for each row that is in the grid. This is not going to work for me either. I need a way for it just to fire from a link or a button.

In my situation I want to create a record in another table and display the selected items in another grid sitting next to it. So what I get now is every record added to the 2nd grid as soon as I open the form. And then it duplicates the entry every time I F5 the page.

So... Where can I stuff this code where it will only happen when the link is clicked?

Maybe imbed the id in an href kind of like Ryans example and then launch a separate page that does nothing but create the record for that passed id.

Hummm... or could I call a business rule imbedded in the href? It cant be right in the custom format code because we will be right where we are at now with it firing for every row.

I know I'm close because I can see the light at the end of the tunnel (That not train lights I see is it?)

--Ken--
[Reply][Quote]
Alberto Chiesa
Posts: 49
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Feb 09 7:46 AM
Bumping an old post.

In 7.5 you can use the row selection column and the new Row Selection Action to accomplish this.

Basically, you setup a Row Selection Column with the message you want ("Add", "Move", "Whatever"...) and in the Row Selection Action you setup a Snippet. You can use the standard ASP.NET methods (SelectedIndex property) to retrieve the selected row.

Hope it helps.
[Reply][Quote]
Ken Poggensee
Posts: 71
 
Re: Execute C# snippet from a grids columnYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 5:01 PM
Thank you for sharing. I just implemented this and it worked flawlessly.
This is what I was looking for...
[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): 8/17/2025 3:16:53 PM