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!
|
|
Re: What's the customization language for web-based Saleslogix? 
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"]; |
|
|
|
Re: What's the customization language for web-based Saleslogix? 
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)); |
|
|
| |
|
Re: What's the customization language for web-based Saleslogix? 
Posted: 26 Jun 14 2:00 PM
|
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;
|
|
|
| |
| |
|
Re: What's the customization language for web-based Saleslogix? 
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? |
|
|
|
Re: What's the customization language for web-based Saleslogix? 
Posted: 27 Jun 14 8:19 PM
|
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();
|
|
|
| |
|
Re: What's the customization language for web-based Saleslogix? 
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? |
|
|
| |
| |
| |
|
Re: What's the customization language for web-based Saleslogix? 
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? |
|
|
|
Re: What's the customization language for web-based Saleslogix? 
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? |
|
|
|
Re: What's the customization language for web-based Saleslogix? 
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? |
|
|
|
Re: What's the customization language for web-based Saleslogix? 
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 |
|
|
| |
|