Overview
On Load User Fields Scripts allow users to control the layout of one or more User Field tabs. Upon loading the tab, an assigned C# script can make changes to the default layout by showing or hiding certain user fields. On Load User Fields Scripts can currently be used on the Customer Card or Sales Document entry screen.
The Customer On Load User Field Script can access the following variables: customer, userFieldsControl1, ufControls
The Sales Document On Load User Field Script can access to the following variables: sd, userFieldsControl1, ufControls
Security
In the Security Editor, enter the script into the On Load User Fields Script security sub-setting under either Customer User Fields or Sales Document User Fields, depending on which user field tab should be edited.
On Load User Field Script Example
This script will hide the "xNewestTest" user field when the User Field tab is loaded:
System.Collections.Hashtable hash = userFieldsControl1.FieldControls; System.Collections.IDictionaryEnumerator ienum =
hash.GetEnumerator();
while (ienum.MoveNext())
{
if (ienum.Key.ToString() == "xNewestTest")//UDF name
{
DevExpress.XtraLayout.LayoutControlItem lci = (DevExpress.XtraLayout.LayoutControlItem)ienum.Value;
}
return "";
lci.ContentVisible = false; lci.TextVisible = false;
}
(For more documentation, see: User Defined Fields; Customer Card, Sales Document Entry; Inventory Lookup; Inventory Analysis)
Important Reminders and Suggestions:
- Scripts are 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.
- Please install this on a test machine and run it 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. SalesPad will not be responsible for maintaining copies of custom database objects.
- C# scripts, after final delivery, are the responsibility of the dealer/customer.