Archive

Archive for February, 2010

Add or remove fields from a pull-down list

February 25th, 2010 No comments

Every combobox in Syteline form has a pull-down list.  For example the item pull-down list may show item# and description.  You may want to add more fields to this pull-down list to show more information for your user.

Business Case:

The current Syteline customer ship-to pull-down list only show the ship-to seq and the customer name, let say you also want to show the city and state for each ship-to, so user can more easily identify the correct ship to customer.

Syteline Technical Component:

Component class, List Source

Solution:

The pull-down list is defined in List Source property.  In this case, the ship-to component is inheriting the property from component class “CustSeq”.  You will need to modify this component class.  Open this component class “CustSeq”

image

Then open the list source property:

image

You can see this list source is pulling from IDO SLCustomers, and the property (fields) it pulls are CustSeq, Name, CreditHold and such.  Insert City and State in front of CreditHold.  Then in the Column to Display, let it to display column 1 to 4.  This way, it will display CustSeq, Name, City and State.

Now the Ship-to customer pull-down will show the City and State, along side the seq and Name

image

Assigning field value in a Syteline Form, based on another field value entered. (1)

February 17th, 2010 No comments

In Syteline form, quite often, you would need to assign some field value, base on another field value entered.

Business case:

Let say in Customer Order, for certain payment terms, you would not allow partial shipment.  So in the CO header form, when user select certain payment term, you want the system automatically uncheck the “Ship Partial” check box.

Syteline Technical Components:

Inline Script, Event Handler

Solution

In Syteline 7 & 8, there is quite a few differ ways to accomplish this.  The first one we are going to discuss here is to use Inline Script.

1)      In Customer Order Form, for form component: TermCodeEdit, add a data change event: TermChange.  And the event handler will call an Inline Script

2)      The Inline Script:

Option Explicit On

Option Strict On

Imports System

Imports Microsoft.VisualBasic

Imports Mongoose.IDO.Protocol

Imports Mongoose.Scripting

Namespace SyteLine.GlobalScripts

Public Class EvHandler_TermChange_0

Inherits GlobalScript

Sub Main()

if ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty(“TermsCode”) = “128” then

ThisForm.PrimaryIDOCollection.SetCurrentObjectPropertyPlusModifyRefresh _

(“ShipPartial”, “0”)

end if

ReturnValue = “0”

End Sub

End Class

End Namespace

This script will assign the ShipPartial to 0, when user select TermsCode = 128.