
One of the cool things about the SalesLogix web client is that you can re-use the same form for inserting a new record or updating a record. While you could do this with Data forms in the SalesLogix LAN client, if you wanted to use the same form for, say inserting an account, as working with an existing one you needed to write code around what to do based on the mode. With the SalesLogix web forms the system automatically does all of the insert/update logic for you based on if it is a new record or not. You just need to call the Entity.Save() method that is standard on every entity and it will do the logic for you.
With that being said how can you tell if your shared form is in insert mode or not? Maybe you have a field you want to show on the insert view but not the edit view, or vice versa. Well here is the answer:
Sage.Platform.WebPortal.EntityPage page = Page as Sage.Platform.WebPortal.EntityPage;
if (page.ModeId.ToUpper() == "INSERT")
{
//Do some stuff for only the insert mode
}
else
{
//Do some stuff for just the edit mode
}
I try to include this code in a SLX 7.5.2 OnLoad Event, but it’s not working.
I think that the issue is in this line:
Sage.Platform.WebPortal.EntityPage page = Page as Sage.Platform.WebPortal.EntityPage;