In the SalesLogix web application architect you can create a toolbar item that has an OnClickAction of the save business rule. With this business rule you can also specify a redirect response and a redirect page. These are all inherent properties that you can define and make creating something like an insert form quick and easy.
But what happens if you want to do something first before calling the Save business rule? For instance, what if you want to check a field is filled in or has a correct value? Well to do that you can change the OnClickEvent from a Business rule to a C# snippet. Then you can add some code, such as:
|
Sage.Entity.Interfaces.IAccount account = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount; |
| account.Save(); |
Every entity has an exposed method called Save which is the same thing as selecting the Save business rule property.
And the redirect line:
|
Response.Redirect(string.Format("account.aspx?entityid={0}", account.Id)); |
This line specifies the name of the page ("account.aspx") as well as the entityid parameter ("?entityid=") which in my code, I am passing in the Id property of my Account entity.
So that is all you need to do. Pretty simple. Replace two property settings for two lines of code. Plus, this allows you to add a lot more logic than using the standard business rule available in the architect.




I think this is a great post from an expert and thank you very much for sharing this valuable information with us.