Skip to main content

Script Example: New Customer Pre Save - Knowledgebase / SalesPad / System - Cavallo Technical Support

Script Example: New Customer Pre Save

Authors list

The New Customer screen in SalesPad has a security property where C# script can be used to evaluate the customer before creation.

The script can validate the data, return a message, or modify the data before it is saved to the database.

Here is an example that demonstrates a number of possible uses:

string message = "";
if (customer.val_Customer_Name == "")
{
e.Cancel = true;
message += "Enter a Customer Name\n";
}
if (customer.val_Short_Name =="")
{
e.Cancel = true;
message += "Enter an Short Name\n";
}
customer.val_Customer_Name = customer.val_Customer_Name.ToUpper();

return message;

Important Reminders and Suggestions:

  • This script is considered "as is" and any changes/modifications that might be needed would require a signed quote.
  • If you are required to change a Security Option or Setting, your users will need to restart SalesPad before the changes take effect.
  • Try out new scripts against a test database before using it on your live system.
  • You should always make sure you have a database backup prior to installing new software.
  • Database Triggers, after final delivery, are the responsibility of the dealer/customer. Cavallo will not be responsible for maintaining copies of custom database objects
Helpful Unhelpful