Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 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!
 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: Re: What's the customization language for web-based Saleslogix?
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Jun 14 2:28 PM

How to get the current ID value in SalesLogix Web


If in a Code Snippet Action:


// Get a reference to the EntityContextServce
// and call GetEntity()
IMyParentEntity myparent = form.WorkItem.Services.Get<Sage.Platform.Application.IEntityContextService>().GetEntity() as IMyParentEntity;

If in a C# Snippet Action:


Sage.Entity.Interfaces.IMyParentEntity myparent = this.GetParentEntity() as Sage.Entity.Interfaces.IMyParentEntity;

If in client-side Javascript:


var contextSvc = Sage.Services.getService('ClientEntityContext'); 
var context = contextSvc.getContext(); 
var strEntityId = context.EntityId; 
window.open('somepage.ascx?entityid=' + strEntityId, 'NewTarget;'); 

Or, since the current ID is in the URL, you can get the param using just standard ASP.NET stuff:


string id = Request.QueryString["entityId"];
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Jun 14 2:33 PM

How to create a table ID value in SalesLogix Web


First off, there is very little need to create a table ID value in SalesLogix Web. If you're relying on creating table ID values for records up front, you might want to rethink what you're doing. Table ID values are create by the framework automatically and is really something you can forget all about because it just happens when needed.


But, if you do need to create one, you can do this:


// First instantiate the service/object
Sage.SalesLogix.SalesLogixEntityKeyGenerator keygenerator = new Sage.SalesLogix.SalesLogixEntityKeyGenerator();

// Now grab a list of ID values (or a single one, the last param indicates how many to create)
List<string> keys = new List<string>(keygenerator.GenerateIds(typeof(ITicket), 1));
[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Jun 14 9:18 AM

The current UserID is not in any entities, how can I get it?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Jun 14 2:00 PM

Quote:
Originally posted by Jordan
The current UserID is not in any entities, how can I get it?


There are a couple of different ways to determine the current user. First, you can use the MySlx API like this:


// Use the MySlx API to get the current user 
IUser user = Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser;

Or you can also use the UserService like this:


Sage.Platform.Security.IUserService userService = 
Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>();

IUser user = userService.GetUser();
// Or
string userid = userService.UserId;


[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Jun 14 2:00 PM

Quote:
Originally posted by Jordan
The current UserID is not in any entities, how can I get it?


This might help http://customerfx.com/pages/crmdeveloper/2014/02/04/programatically-looking-up-users-in-saleslogix-web.aspx


Plus a few other user related articles:


Determining if a User is a Part of a Team http://customerfx.com/pages/crmdeveloper/2009/02/04/determining-if-a-user-is-a-member-of-a-team-in-saleslogix-web.aspx


Determining the Current User's License Type http://customerfx.com/pages/integrationblog/2010/07/19/saleslogix-7-5-2-web-determining-the-current-user-s-license-type.aspx

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 14 5:03 PM

WOW! It seems that Sage.Platform.Application... and Sage.SalesLogix.API.MySlx... are just the substitutions of Lan Application object and common Scripts that I have been looking for. Many thanks.  

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 14 5:08 PM

Sometimes, I need to add a record to another SLX table besides using entity to add a record in a SLX table automatically. So, I need the ID of another table.


// First instantiate the service/object
Sage.SalesLogix.SalesLogixEntityKeyGenerator keygenerator = new Sage.SalesLogix.SalesLogixEntityKeyGenerator();
// Now grab a list of ID values (or a single one, the last param indicates how many to create)
List<string> keys = new List<string>(keygenerator.GenerateIds(typeof(ITicket), 1)); 


For those, why isn't there a parameter related to a concrete table?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 14 8:19 PM

Quote:
Originally posted by Jordan
...For those, why isn't there a parameter related to a concrete table?


You don't pass a string table name, instead you use the interface for the entity you want the key for. In the the sample I provided, there is:


typeof(ITicket)

 


This says to create an ID value for the TICKET table, by way of it's interface. To create an ID for the ACCOUNT table you'd use:


typeof(IAccount)

 


Make sense?


However, just to point out, the scenario you mentioned "Sometimes, I need to add a record to another SLX table besides using entity to add a record in a SLX table automatically" you still don't really need to create the ID value. You can just do something like this:


var account = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IAccount>();
account.AccountName = "Test";
account.Type = "Some Type";
// continue setting properties as needed
// then save it to the database
account.Save();

 

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 14 8:20 PM

More on adding records using the entity model here: http://customerfx.com/pages/crmdeveloper/2009/01/29/programatically-adding-a-new-record-in-saleslogix-web.aspx

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jun 14 11:37 AM

var account = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IAccount>();
account.AccountName = "Test";
account.Type = "Some Type";
account.Save();


------------------


Wonderful sample using entity instead of ADO.net/SQL statement to add a new account. 


Are there samples for updating/deleting an existed account? 

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jun 14 12:19 PM

In Lan version, the Application.GlobalInfo can be used to set/get session-level variables. In Web version, use ASP.NET Session object directly? 

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jun 14 12:34 PM

Updating an existing account


If you have the ID of the record you want to edit, you can do this:


IAccount account = Sage.Platform.EntityFactory.GetById<IAccount>(accountId) as IAccount;
account.Type = "New Type";
account.Save();

You can read more here: http://customerfx.com/pages/integrationblog/2009/05/22/using-the-entityfactory-to-retrieve-entity-objects-in-saleslogix-7-5.aspx

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jun 14 12:39 PM

Quote:
Originally posted by Jordan
In Lan version, the Application.GlobalInfo can be used to set/get session-level variables. In Web version, use ASP.NET Session object directly? 


There's several ways to do this, some built in to the SLX DLLs, but an easy way is to just use the ASP.NET session. See http://customerfx.com/pages/integrationblog/2009/10/09/using-page-session-to-store-values-in-the-saleslogix-web-client.aspx

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jul 14 10:09 AM

For lan version, I have a form in which there is a required validation on ebPwd field in the event handler AXFormValidate: 


Function AXFormValidate(Sender)


    AXFormValidate = True


    If (trim(ebPwd.Text) = "") Then


        AXFormValidate = false
        MsgBox "Password is required"
        ebPwd.SetFocus
        Exit Function
   
    End If


    ......


End Function


For Web version, what's the simpliest/best approach to do the same thing?

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Jul 14 10:11 AM

For Lan version, on the Account Detail view, as soon as the current account is deleted by cliecking menu Edit > Delete Account, something else needs to be done.


In Main View "Account Details", there is an event handler. I added some code there.


Function OnFunctionAfterExecute_EditDeleteItem(MainView, FunctionNumber, FunctionName) 


    'Do something else


End Function


For Web version, what's the simpliest/best approach to do the same thing?

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Jul 14 5:29 PM

The structure of our existing Lan version is:


SLX Network Slient (RDS on an independent Machine) -> SalesLogix Server (Addministrative Workstation on an independent Machine) -> SalesLogix DB (SQL Server on an independent Machine).


 


The structure of our oncoming Web version will be:


Web Host and SLX Web Client (Web Srevre on an independent Machine) -> SalesLogix Server (Addministrative Workstation on an independent Machine) -> SalesLogix DB (SQL Server on an independent Machine). Is it possible? For the SLX Web version, the SalesLogix Server will be still needed, right? 

[Reply][Quote]
Chris Grant
Posts: 10
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jul 14 4:44 AM

Even though some of you client may we using the main web server client, you may also have Remote Web Client or even some user still using Lan.


 


Hence yes you do need the SalesLogix Server. NB I can be on the same server or a seperate server. Obviously in a web farm scenario you have 1 SLX Server and multiple Web Server.


 


Enjoy


 


Chris

[Reply][Quote]
Jordan
Posts: 61
 
Re: What's the customization language for web-based Saleslogix? Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jul 14 10:11 AM

Thanks Chris!

[Reply][Quote]
 Page 2 of 2<< < Previous 
  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): 6/5/2025 2:39:09 AM