Monday, March 26, 2018
Sunday, October 01, 2017
Thursday, November 05, 2015
Tuesday, September 14, 2010
SL802 - Dynamic change color on a row of grid, based on some cell value
Dynamic change color on a row of grid, based on some cell value
January 21st, 2010Leave a commentGo to comments
This is considered by some people as Holy Grail of Syteline Form Personalization.
Here is what we want to do. In "Time Phased Inventory" form, we want to change the color to yellow for those rows that is
First, we need to create a new form script method, called SetPOColor()
Sub SetPOColor()
Dim i as Integer
Dim j as Integer
Dim sReference As String
Dim sRef3 As String
Dim sRef4 As String
Dim oSupDem As IWSIDOCollection
oSupDem = ThisForm.PrimaryIDOCollection.GetSubCollection("SLSupDems", -1)
j = oSupDem.GetNumEntries
' MsgBox("j = " + CStr(j))
For i = 1 To j
sReference = ThisForm.Components("SLSupDemsGrid").GetGridValueByColumnName(i, "SLSupDemsReferenceSubGridCol")
sRef3 = Mid(sReference, 1, 3)
sRef4 = Mid(sReference, 1, 4)
If sRef3 = "
ThisForm.Components("SLSupDemsGrid").SetGridRowColColor(i, 0, "255,255,0″, "")
End If
Next i
ThisForm.Components("SLSupDemsGrid").ForceRepaint
End Sub
Secondly, we create a new event handler for event "StdObjectSelectCurrentCompleted", to call the above form script method SetPOColor().
Done. Now here we are:
SL802 Right Click Menu
Right Click Menu
Each component in Syteline form can have its own right click menu, and this right
click menu is customizable.
See the sample, the “Ship To” field has a standard right click menu, with “Add”, “Detail”, “Find” and “Help” menu items.
If you look into the component property of “Ship To” field, you can see the “Right Click Menu” property is blank. But this property is inheriting from the component class: CustSeq. In there, the right click menu defined to be StdDetailsAddFind.
There are list of the pre-exist right click menu you can use, such as “StdAddFind”, “StdHelp” and such.
You can also modify or create a new right click menu by go into the “Shortcut Menu Properties” dialog box.
Over there, you just need to define the “Menu Item/Caption” and the “Event to Generate” for each of this menu item.
SL802 - Assigning field value in a Syteline Form, based on another field value entered. (1)
Assigning field value in a Syteline Form, based on another field value entered. (1)
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
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.
Monday, September 13, 2010
SL8.02 Change the sorting in primary collection grid
Change the sorting in primary collection grid
Sep 13, 2010
The out of box Syteline missed some of the detail carelessly. For example, the Grid view for RMA is sorted by RMA date ascending. So it shows the oldest RMA up front and you are seeing those years old closed RMAs.
Syteline Application Case
Change the sorting of Grid view in RMA form, to show the latest RMA up front.
Syteline Technical Component
Form, Primary Collection, Collection Property
Customization Solution
This is pretty easy to change. Go to Edit mod, in the form collection property, change the Order by to “RmaNum Desc”. Done.