Hi Eddy,
You can't add the CFL to the EditText for 2 reasons:
- First it's a system item and you can't modify it as you discovered,
- Second because it's already here
First thing to do is to export the form to see how it is contruct which gives the following xml excerpt:
<itemuid="5"type="16"left="139"tab_order="35"width="81"top="7"height="14"visible="1"enabled="1"from_pane="0"to_pane="0"disp_desc="0"right_just="0"description=""linkto=""forecolor="-1"backcolor="-1"text_style="0"font_size="-1"supp_zeros="0"AffectsFormMode="1">
<AutoManagedAttribute>
<Attributeid="2"description="editable"modeOk="0"/>
</AutoManagedAttribute>
<specificTabOrder="35"ChooseFromListUID="-1"ChooseFromListAlias="CardCode"IsPassword="0">
<databinddatabound="1"table="OCRD"alias="CardCode"/>
</specific>
</item>
</action>
</items>
<ChooseFromListCollection>
<actiontype="add">
<ChooseFromListUniqueID="-1"ObjectType="2"MultiSelection="0"IsSystem="1"/>
Then the code:
void application_ChoosFromListChoosing(object sender, UI.Interfaces.IChooseFromListEventArgs eventArgs)
{
if ("134" == eventArgs.Form.TypeEx)
{
var form = eventArgs.Form;
var cfl = form.ChooseFromLists.Item("-1");
var conditions = cfl.GetConditions();
if (0 == conditions.Count)
{
var cond = conditions.Add();
cond.BracketOpenNum = 1;
cond.Alias = "CardCode";
cond.Operation = BoConditionOperation.co_START;
cond.CondVal = "C";
cond.BracketCloseNum = 1;
cfl.SetConditions(conditions);
}
}
}
And by usage:
The only "drawback" is that the navigation buttons don't filter data thru the CFL, so you'll have to do the filtering by your own in the FormDataLoad event..
Regards,
Eric