Solved

Lobby Element with Site Parameter not Working


Userlevel 4
Badge +10
  • Sidekick (Customer)
  • 119 replies

We have a lobby that works with the default Site# of W. When we try to run it for other Sites, the first execution throws an error, but then if we run it again it works.

Am I formatting the parameter correctly as where contract LIKE NVL('$SITE$','%')?

 

icon

Best answer by paul harland 6 October 2020, 15:55

View original

14 replies

Userlevel 4
Badge +10

...fyi, here’s the details of the error message:

Ifs.Fnd.FndSystemException: Explorer: An Unhandled Exception has occurred ---> System.Reflection.TargetParameterCountException: Parameter count mismatch.
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Ifs.Fnd.CompositePageRenderer.Misc.DataGridColumnHeaderReleaseMouseCaptureBehavior.OnMouseLeave(Object sender, MouseEventArgs args)
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState, Action`2 originChangedAction)
at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, IList`1 otherOrigins, DeferredElementTreeState& oldTreeState, Action`2 originChangedAction)
at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
--- End of inner exception stack trace ---

 

Userlevel 7
Badge +19

are you adding the condition directly in column field? Can’t you add it to the condition field? 

 

 

Userlevel 7
Badge +24

hi @DevBob 

Can you show the full SQL content of your column for our review?

What’s the reason for using DUAL rather than the IAL?  It appears like it should work; just not clear what the benefit of doing it like that would be.

 

Userlevel 4
Badge +10

Here’s the code, of which is over 2 IALs.

((select count(*) from ifsinfo.RW_ORDERS_SHIPPED_TODAY2 where contract LIKE NVL('$SITE$','%') and not_ontime = 0)/(select count(*) from ifsinfo.RW_ORDERS_SHIPPED_TODAY2 where contract LIKE NVL('$SITE$','%')) * 100 )

In addition to this error I also get the ‘divide by zero’ SQL error because there’s no data for some of our Site. 

 

Userlevel 4
Badge +10

I used DUAL because all of the code is in the column. Not exactly sure of the rules of when you need the boxes entered vs. just SQL code in the column.

Userlevel 4
Badge +10

yes; I’m adding the condition directly in just the column. Not sure if I can do it in the entry boxes/controls due to my lack of DataSource Designer experience.

Userlevel 7
Badge +24

General tip, to avoid the divide by zero error;

Rather than doing A/B, instead do A / nullif(B,0)

You will get null instead of an error.

Userlevel 7
Badge +24

I would put ifsinfo.RW_ORDERS_SHIPPED_TODAY2 into the Source view

where contract LIKE NVL('$SITE$','%') into the condition

Into the Column:

100* (sum(case when not_ontime = 0 then 1 else 0 end) / nullif (count(*),0)) 

Userlevel 4
Badge +10

Paul, awesome tip- thx. That’s exactly what I need is this scenario!

re: your 2nd reply, I’ll try that. thanks!

Userlevel 4
Badge +10

Hmm, I’m getting an error trying to wrap the divisor in nullif():

 

 

Userlevel 4
Badge +10

I was able to put the nullif() in the IAL- then an SQL runs ok for a Site w/o data- S96, but the Lobby gauge widget still fails:

 

 

 

Userlevel 4
Badge +10

If I try this in the Lobby Element, I get the following error:

((select count(*) from ifsinfo.RW_ORDERS_SHIPPED_TODAY3 where contract LIKE NVL('$SITE$','%') and not_ontime = 0)/( NULLIF( select count(*) from ifsinfo.RW_ORDERS_SHIPPED_TODAY3 where contract LIKE NVL('$SITE$','%')),0) * 100 )

 

Userlevel 4
Badge +10

Paul, i tried your 2nd solution, and I don’t get the error, however it returns zero instead of 25%:

 

 

 

Userlevel 4
Badge +10

disregard my last post; I made those changes and it appears to be working; will confirm with other Sites..

Thx again for your assistance! Very much appreciated!

Reply