How can I iterate through form controls

That all looks fine, are you doing anything to these combos in code?

Try this customization because of the version I’m in you probably won’t be able to import it directly

Cost Adjustment Entry I updated it to work with your UD Code

App.CostAdjustmentEntry.CostAdjustmentForm_Customization_TEST_CustomExport.xml (30.7 KB)

If you can’t try this trick

Open the screen in Customization Mode

Go to Tools-> Custom XML Editor
image
image

Under XML View Paste this XML

<CustomizationDS xmlns="http://tempuri.org/XMLSchema.xsd">
  <Controls>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <ParentControlKey>e296caea-0272-4f99-8a82-90a528448a7f</ParentControlKey>
    <ControlType>Ice.Lib.Framework.EpiCombo</ControlType>
    <Company />
    <Plant />
    <DcdUserId />
    <GroupID />
    <ControlsID />
  </Controls>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>grpFifo</ControlName>
    <Key>e296caea-0272-4f99-8a82-90a528448a7f</Key>
    <PropertyName>ChildIndex</PropertyName>
    <PropertyValue>0</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>grpFifo</ControlName>
    <Key>e296caea-0272-4f99-8a82-90a528448a7f</Key>
    <PropertyName>Anchor</PropertyName>
    <PropertyValue>Top, Left</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>grpFifo</ControlName>
    <Key>e296caea-0272-4f99-8a82-90a528448a7f</Key>
    <PropertyName>AnchorTop</PropertyName>
    <PropertyValue>134</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>grpFifo</ControlName>
    <Key>e296caea-0272-4f99-8a82-90a528448a7f</Key>
    <PropertyName>AnchorLeft</PropertyName>
    <PropertyValue>6</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>grpFifo</ControlName>
    <Key>e296caea-0272-4f99-8a82-90a528448a7f</Key>
    <PropertyName>AnchorWidth</PropertyName>
    <PropertyValue>741</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>grpFifo</ControlName>
    <Key>e296caea-0272-4f99-8a82-90a528448a7f</Key>
    <PropertyName>AnchorHeight</PropertyName>
    <PropertyValue>60</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>ChildIndex</PropertyName>
    <PropertyValue>0</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>Parent</PropertyName>
    <PropertyValue>e296caea-0272-4f99-8a82-90a528448a7f</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>Width</PropertyName>
    <PropertyValue>115</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>AnchorWidth</PropertyName>
    <PropertyValue>115</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>Left</PropertyName>
    <PropertyValue>582</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>Top</PropertyName>
    <PropertyValue>16</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>AnchorLeft</PropertyName>
    <PropertyValue>582</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>AnchorTop</PropertyName>
    <PropertyValue>16</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>Height</PropertyName>
    <PropertyValue>20</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiBinding</PropertyName>
    <PropertyValue>Cost.Reference</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>AutoWidth</PropertyName>
    <PropertyValue>False</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>AutoWidthOption</PropertyName>
    <PropertyValue>ControlWidth</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>DisplayMember</PropertyName>
    <PropertyValue>CodeDesc</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiBOName</PropertyName>
    <PropertyValue>Ice:BO:UserCodes</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiSort</PropertyName>
    <PropertyValue>CodeID</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiTableName</PropertyName>
    <PropertyValue>UDCodes</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>ValueMember</PropertyName>
    <PropertyValue>CodeID</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiAltSearchMethod</PropertyName>
    <PropertyValue />
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiColumns</PropertyName>
    <PropertyValue>CodeDesc*CreatedDate</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>Customization</ControlName>
    <Key>2dcd1674-5e34-4d98-b493-c75747027376</Key>
    <PropertyName>Script</PropertyName>
    <PropertyValue>// **************************************************
// Custom code for CostAdjustmentForm
// Created: 3/10/2022 1:36:35 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;

public class Script
{
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **

	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
	}
}
</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>Customization</ControlName>
    <Key>2dcd1674-5e34-4d98-b493-c75747027376</Key>
    <PropertyName>Language</PropertyName>
    <PropertyValue>CSharp</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>SearchFilter</PropertyName>
    <PropertyValue>CodeTypeID='VTEC2_Vehi'</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiDataSetMode</PropertyName>
    <PropertyValue>RowsDataSet</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblDate</ControlName>
    <Key>5f13a608-7cef-437e-89b8-e648b804d51a</Key>
    <PropertyName>ChildIndex</PropertyName>
    <PropertyValue>1</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>dtDate</ControlName>
    <Key>18fd0b64-8a0f-418e-bbd4-e27a7e23cdfb</Key>
    <PropertyName>ChildIndex</PropertyName>
    <PropertyValue>0</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblDate</ControlName>
    <Key>5f13a608-7cef-437e-89b8-e648b804d51a</Key>
    <PropertyName>Top</PropertyName>
    <PropertyValue>16</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblDate</ControlName>
    <Key>5f13a608-7cef-437e-89b8-e648b804d51a</Key>
    <PropertyName>Left</PropertyName>
    <PropertyValue>68</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblDate</ControlName>
    <Key>5f13a608-7cef-437e-89b8-e648b804d51a</Key>
    <PropertyName>Width</PropertyName>
    <PropertyValue>104</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblDate</ControlName>
    <Key>5f13a608-7cef-437e-89b8-e648b804d51a</Key>
    <PropertyName>Height</PropertyName>
    <PropertyValue>20</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>epiComboC1</ControlName>
    <Key>31940294-44dd-4f5b-b96a-1d277bc73ac2</Key>
    <PropertyName>EpiFiltersAppend</PropertyName>
    <PropertyValue>CreateDate&lt;='?[TransDate,'']'</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblRef</ControlName>
    <Key>2f898d86-1261-49d3-af44-f07041d088d8</Key>
    <PropertyName>ChildIndex</PropertyName>
    <PropertyValue>1</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>txtRef</ControlName>
    <Key>577436d2-2bab-4b56-b5e0-5bf99614fddd</Key>
    <PropertyName>ChildIndex</PropertyName>
    <PropertyValue>0</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblRef</ControlName>
    <Key>2f898d86-1261-49d3-af44-f07041d088d8</Key>
    <PropertyName>Top</PropertyName>
    <PropertyValue>33</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblRef</ControlName>
    <Key>2f898d86-1261-49d3-af44-f07041d088d8</Key>
    <PropertyName>Left</PropertyName>
    <PropertyValue>18</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblRef</ControlName>
    <Key>2f898d86-1261-49d3-af44-f07041d088d8</Key>
    <PropertyName>Width</PropertyName>
    <PropertyValue>266</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
  <Properties>
    <FormsID>CostAdjustmentForm</FormsID>
    <ControlName>lblRef</ControlName>
    <Key>2f898d86-1261-49d3-af44-f07041d088d8</Key>
    <PropertyName>Height</PropertyName>
    <PropertyValue>20</PropertyValue>
    <Company />
    <Plant />
    <DcdUserID />
    <GroupID />
    <PropertiesID />
  </Properties>
</CustomizationDS>

Click Okay, Save the Customization, Exit out and Open it back up. See if that works like I show on the Gif

Unfortunately, it does not work like the GIF. Same problem as my original form.
image

No_CAN and Parker_Motor_PTO both have a create date of 3/9/2022.
image

Here’s a trace that does show the where clause … but it doesn’t seem to work.

<tracePacket>
  <businessObject>Ice.Proxy.Lib.BOReaderImpl</businessObject>
  <methodName>GetRows</methodName>
  <appServerUri>ourserver</appServerUri>
  <returnType>System.Data.DataSet</returnType>
  <localTime>3/10/2022 14:22:38:7733581 PM</localTime>
  <threadID>1</threadID>
  <executionTime total="68" roundTrip="67" channel="0" bpm="0" other="1" />
  <retries>0</retries>
  <parameters>
    <parameter name="serviceNamespace" type="System.String"><![CDATA[Ice:BO:UserCodes]]></parameter>
    <parameter name="whereClause" type="System.String"><![CDATA[(CodeTypeID='VTEC2_Vehi') AND (CreateDate<='3/10/2022 12:00:00 AM')]]></parameter>
    <parameter name="columnList" type="System.String"><![CDATA[]]></parameter>
  </parameters>
</tracePacket>

<tracePacket>
  <businessObject>Ice.Proxy.Lib.BOReaderImpl</businessObject>
  <methodName>GetRows</methodName>
  <appServerUri>ourserver</appServerUri>
  <returnType>System.Data.DataSet</returnType>
  <localTime>3/10/2022 14:22:46:5465107 PM</localTime>
  <threadID>1</threadID>
  <executionTime total="34" roundTrip="33" channel="0" bpm="0" other="1" />
  <retries>0</retries>
  <parameters>
    <parameter name="serviceNamespace" type="System.String"><![CDATA[Ice:BO:UserCodes]]></parameter>
    <parameter name="whereClause" type="System.String"><![CDATA[(CodeTypeID='VTEC2_Vehi') AND (CreateDate<='3/7/2022 12:00:00 AM')]]></parameter>
    <parameter name="columnList" type="System.String"><![CDATA[]]></parameter>
  </parameters>
</tracePacket>

I mean 3/9 is less than 3/10 :yum: its passing in the 3/10 date in the filter. That is odd, try changing the date in the date filter and hitting the dropdown again, does that change anything?

1 Like

well the second packet was from after I changed the date to 3/7/2022… and those values remain in the list.

1 Like

I notice an inconsistency on this. In your where clause, it says CreatedDate, instead of CreateDate. Is that why it didn’t return any results?

The first screenshot I had mispelled it, but then I fixed it and it worked fine

1 Like

Looks like it’s back to intercepting the list during beforedropdown event and pulling out the ones that shouldn’t be there. :face_exhaling:

2 Likes

I would suggest you replace it with a BAQ Combo and use BAQ Markup to filter. haha but I think re-creating all the combos may be more painful than your original issue.

1 Like

This is the point where I would usually walk away for the day @dr_dan

1 Like

You nailed it. I’m outta here! Thanks @josecgomez for all your efforts on this. I’ll assume when we upgrade I can make use of this seemingly simple feature. I’ll add it to the list of things waiting on the upgrade lol.

2 Likes