Hi, I want to set a form field value after doing a modification on another field in the same form. I've created a modify method to fill the second field automatically and I tried too many functions but the field is not filled when modifying the first one.
I want to know how to refer to fields from the same form using x++ code?
The value I want to set is a real value and I want it to be changed before creating the line int the table, because some fields can't be modified after the
*This post is locked for comments
Ok
For Control1
example
public boolean modified()
{
boolean ret;
real value;
ret = super();
switch (Control1.selection())
{
case AccountingEventType::Cancel:
value = 100;
break;
case AccountingEventType::Finalize:
value = 1000;
break;
default:
value = Control1.selection();
}
Control2.realValue(value);
element.redraw();
return ret;
}
Hi Grigory,
I don't need to assign a value to the combo box, but to the next field after modifying the combo box . I'll try to explain more:
I have two controls in my form (control 1 and control 2).
control 1 is a combo box that has two enums: enum1 and enum2, and the second control is a realEdit field.
if i choose enum 1 in the combo box, control 2 displays realValue1 automatically, if not, control 2 displays realValue2.
Hi!
for example
public boolean modified()
{
boolean ret;
ret = super();
ComboBox.selection(1);
element.redraw();
return ret;
}
Hi Crispin,
Yes that's what i'm doing. I tried to test with an info message and the table field is getting the right value but i'm having troubles with displaying it in the form instantly. What I need is quite simple: a function that allows me to assign a real value to a realEdit form control just after modifying the previous field (which is a combo box)
Hi Ievgen, I'm just trying to modify the value of the second field automatically after modifying the first field on the form, I added a code to the modify method of the first field but it doesn't work
Hey Ameni Omrani,
Could you please share your code ? It's hard to say what is wrong without seeing actual code.
Meanwhile you can check this blog post ajstudi0.blogspot.co.nz/.../microsoft-dynamics-ax-table-method.html
section about modifiedField method.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156