PdcApplication.ActiveObjectPickFilter: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
ActiveObjectPickFilter as | ActiveObjectPickFilter as String | ||
== Description == | == Description == | ||
Sets an active object | Sets an active object string | ||
== Notes == | == Notes == | ||
Especially useful to set a filter expression in script. This expression is used in the picklist. | Especially useful to set a filter expression in script. This expression is used in the picklist. | ||
== Code example == | == Code example == | ||
In userexit SCR_BEFORECHOOSEDELIVERYLINE check for the | In userexit SCR_BEFORECHOOSEDELIVERYLINE check for the external order number in the first line of an active delivery note. | ||
Give the | Give the external order number as result to the picklist. | ||
<source lang="vb"> | <source lang="vb"> | ||
dim | dim Activewindow | ||
dim Activegrid | |||
dim | |||
dim strFilter | dim strFilter | ||
dim strCalcNo | dim strCalcNo | ||
dim | dim strOrderNo | ||
set ActiveWindow = pdc.Windows.ActiveWindow | set ActiveWindow = pdc.Windows.ActiveWindow | ||
Line 28: | Line 25: | ||
if Activegrid.Recordcount > 0 then | if Activegrid.Recordcount > 0 then | ||
if strFilter = "" then | if strFilter = "" then | ||
strOrderNo = Activegrid.GetField("PR_EORDN") | |||
if | if strOrderNo<> "" then | ||
strFilter = "(UPPER(DO_EORDN)=UPPER('" & strOrderNo& "'))" | |||
strFilter = "(UPPER( | |||
PDC.ActiveObjectPickFilter = strFilter | PDC.ActiveObjectPickFilter = strFilter | ||
end if | end if | ||
Line 37: | Line 33: | ||
end if | end if | ||
end if | end if | ||
set | set Activegrid = nothing | ||
end if | end if | ||
set ActiveWindow = nothing | set ActiveWindow = nothing | ||
Line 44: | Line 40: | ||
== Availability == | == Availability == | ||
Available since | Available since September 2014 (From version 5.0 upwards). |
Latest revision as of 10:49, 2 October 2014
Declaration
ActiveObjectPickFilter as String
Description
Sets an active object string
Notes
Especially useful to set a filter expression in script. This expression is used in the picklist.
Code example
In userexit SCR_BEFORECHOOSEDELIVERYLINE check for the external order number in the first line of an active delivery note. Give the external order number as result to the picklist.
dim Activewindow
dim Activegrid
dim strFilter
dim strCalcNo
dim strOrderNo
set ActiveWindow = pdc.Windows.ActiveWindow
if ActiveWindow.WindowKey = "PB" then 'active delivery note
set Activegrid = pdc.Windows.ActiveWindow.Datagrids.GetGridByName("PDCGrid1", "PR_POS")
if IsValid(Activegrid) then
if Activegrid.Recordcount > 0 then
if strFilter = "" then
strOrderNo = Activegrid.GetField("PR_EORDN")
if strOrderNo<> "" then
strFilter = "(UPPER(DO_EORDN)=UPPER('" & strOrderNo& "'))"
PDC.ActiveObjectPickFilter = strFilter
end if
end if
end if
end if
set Activegrid = nothing
end if
set ActiveWindow = nothing
Availability
Available since September 2014 (From version 5.0 upwards).