# different value for Checbox uncheck in Amend order

**URL:** <https://forum.fixtrading.org/t/different-value-for-checbox-uncheck-in-amend-order/16070>\
**Category:** General Q&A\
**Tags:** general-qa, help-wanted\
**Created:** [August 2, 2021, 7:10pm UTC](https://forum.fixtrading.org/t/different-value-for-checbox-uncheck-in-amend-order/16070 "2021-08-02T19:10:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishalgawai](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vishalgawai](https://forum.fixtrading.org/u/vishalgawai)\
**Post date:** [August 2, 2021, 7:10pm UTC](https://forum.fixtrading.org/t/different-value-for-checbox-uncheck-in-amend-order/16070/1 "2021-08-02T19:10:10Z")

</div>

I want to support below checkbox control in ATDL file.

A checkbox control with valid values:  
D = Off (no FIX tag required)  
N = Off (should only be sent on amends where the control is being switched from On to Off)  
Y = On

i.e.  
In new order message:

- if checkbox is unchecked, the Fixtag value should be D or empty.
- if Checkbox is checked, the Fixtag value should be Y

In replace message:

- if Checkbox is unchecked from checked, the Fixtag value should be N.
- if checkbox ix checked, the FixTag value should be Y.

Can you please let me know how to achieve this?

---

<div class="post-metadata">

**Author:** ![scott.atwell](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@scott.atwell](https://forum.fixtrading.org/u/scott.atwell)\
**Post date:** [August 2, 2021, 7:41pm UTC](https://forum.fixtrading.org/t/different-value-for-checbox-uncheck-in-amend-order/16070/2 "2021-08-02T19:41:56Z")

</div>

Provided that the FIXatdl implementation supports it, FIXatdl defined the ability to feed-in/check some standard FIX fields and their values. Thus, you could write a StateRule that uses \< Edit field=FIX\_MsgType operator=“EQ” value=“G” \> to test for FIX Order Cancel/Replace Request (“G”) vs. FIX New Order Single (“D”).

_(from the FIXatdl spec’s Attribute Definition section)_  
|Edit/@field|  
Field name for comparison.  
When the edit is used within a stateRule, this field must refer to the ID of a Control. When the edit is used within a strategyEdit, this field must refer to either the name of a parameter or a standard FIX field name. When referring to a standard FIX tag then the name must be pre-pended with the string “FIX\_”, e.g. “FIX\_OrderQty”.

---

<div class="post-metadata">

**Author:** ![vishalgawai](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vishalgawai](https://forum.fixtrading.org/u/vishalgawai)\
**Post date:** [August 3, 2021, 9:05am UTC](https://forum.fixtrading.org/t/different-value-for-checbox-uncheck-in-amend-order/16070/3 "2021-08-03T09:05:17Z")

</div>

Thank you for the reply.

When I try to use Fix\_MsgType in StateRule I get error in ATDL4Net renderer. (As per spec we cannot use FIX\_ in stateRule)

* * *

An exception was thrown in a DependencyProperty event handler; details:

No parameter with name or control with Id ‘FIX\_MsgType’ was found for EditRef Field value in strategy unknown.

* * *

Also to set the value to N when amend order I tried below code which does not work. Can you please let me know how can I conditionally set value on checkbox?

```
<lay:Control xsi:type="CheckBox_t" ID="c_Check1" label="Check1" parameterRef="Check1" checkedEnumRef="e_Checked" uncheckedEnumRef="e_UnChecked">
				<flow:StateRule value="e_UnCheckedAmend">
					<val:Edit logicalOperator="AND">
						<val:Edit field="FIX_MsgType" operator="EQ" value="G" />
						<val:Edit field="c_Check1" operator="EQ" value="false" />
					</val:Edit>
				</flow:StateRule>
			</lay:Control>
```

---

<div class="post-metadata">

**Author:** ![vishalgawai](https://avatars.discourse-cdn.com/v4/letter/v/b782af/32.png) [@vishalgawai](https://forum.fixtrading.org/u/vishalgawai)\
**Post date:** [August 4, 2021, 7:57am UTC](https://forum.fixtrading.org/t/different-value-for-checbox-uncheck-in-amend-order/16070/4 "2021-08-04T07:57:49Z")

</div>

Hi

Does ATDL support this kind of behavior? Or is there any way to implement this?
