Discussion:
Value of dropdown
(too old to reply)
Jeff
2009-06-30 20:25:01 UTC
Permalink
Hello,
I am new to AX and have run into a problem that I bet is really easy...
I have a dropdown and in the modified of that field I am trying to get the
newly selected value. All I seem to get is the original value of the
dropdown. As it is still a string field I assumed that I could use
this.text(); to get the newly selected value but it appears that I am wrong

Can someone let me know what I am missing?

Thanks
Jeff
2009-07-02 15:40:04 UTC
Permalink
Thanks for the reply,

But i do not have a ".selection()" I think that it is because the item is a
StringEdit field not a combobox. I did however move my code to after the
Super() and it now allows me to use the this.text(); to get the value.

Thanks again
Use "this.selection()" instead. It returns the enum value, as an actual value
instead of a string
And make sure you call this after super()
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jeff
Hello,
I am new to AX and have run into a problem that I bet is really easy...
I have a dropdown and in the modified of that field I am trying to get the
newly selected value. All I seem to get is the original value of the
dropdown. As it is still a string field I assumed that I could use
this.text(); to get the newly selected value but it appears that I am wrong
Can someone let me know what I am missing?
Thanks
Jeff
2009-07-02 16:45:01 UTC
Permalink
Hello,

To continue this it seeems to have worked for 6 of the 8 dropdowns. The last
2 dropdowns always have an empty string value for the .text(), the
.selected() still does not exist for these controls. It has an empty string
value both before and after the super(). The ProjTable.orig().Salesman does
return the original value but because the new selected value always = "" it
gets updated to an empty string.

Anyone have ideas for what I can look at?

Thanks again
Use "this.selection()" instead. It returns the enum value, as an actual value
instead of a string
And make sure you call this after super()
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jeff
Hello,
I am new to AX and have run into a problem that I bet is really easy...
I have a dropdown and in the modified of that field I am trying to get the
newly selected value. All I seem to get is the original value of the
dropdown. As it is still a string field I assumed that I could use
this.text(); to get the newly selected value but it appears that I am wrong
Can someone let me know what I am missing?
Thanks
Jeff
2009-07-03 16:06:02 UTC
Permalink
Thanks again,

I still seem to have a problem with the 2 dropdowns. I think (a guess) it
may be in the relationships...
If i open the data source in the table browser and try to change the same
value I get the dropdown with the correct data displayed but no matter what
record i select it updates it to an empty string.
Oh, stringEdits.
The drop-down for this type of control is called Lookup.
Try using method valueStr() instead of text() for these.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jeff
Hello,
To continue this it seeems to have worked for 6 of the 8 dropdowns. The last
2 dropdowns always have an empty string value for the .text(), the
.selected() still does not exist for these controls. It has an empty string
value both before and after the super(). The ProjTable.orig().Salesman does
return the original value but because the new selected value always = "" it
gets updated to an empty string.
Anyone have ideas for what I can look at?
Thanks again
Use "this.selection()" instead. It returns the enum value, as an actual value
instead of a string
And make sure you call this after super()
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jeff
Hello,
I am new to AX and have run into a problem that I bet is really easy...
I have a dropdown and in the modified of that field I am trying to get the
newly selected value. All I seem to get is the original value of the
dropdown. As it is still a string field I assumed that I could use
this.text(); to get the newly selected value but it appears that I am wrong
Can someone let me know what I am missing?
Thanks
Jeff
2009-07-03 16:43:02 UTC
Permalink
I think I got it... and thanks for taking the time to help me out Kashperuk.
Turns out in the extended data type the relationship was (it looks to me)
not set right, there was no field after the table so it was: Person == table.
I changed it to Person == EmplTable.Del_Name and it works!!

Thanks again
Post by Jeff
Thanks again,
I still seem to have a problem with the 2 dropdowns. I think (a guess) it
may be in the relationships...
If i open the data source in the table browser and try to change the same
value I get the dropdown with the correct data displayed but no matter what
record i select it updates it to an empty string.
Oh, stringEdits.
The drop-down for this type of control is called Lookup.
Try using method valueStr() instead of text() for these.
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jeff
Hello,
To continue this it seeems to have worked for 6 of the 8 dropdowns. The last
2 dropdowns always have an empty string value for the .text(), the
.selected() still does not exist for these controls. It has an empty string
value both before and after the super(). The ProjTable.orig().Salesman does
return the original value but because the new selected value always = "" it
gets updated to an empty string.
Anyone have ideas for what I can look at?
Thanks again
Use "this.selection()" instead. It returns the enum value, as an actual value
instead of a string
And make sure you call this after super()
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Jeff
Hello,
I am new to AX and have run into a problem that I bet is really easy...
I have a dropdown and in the modified of that field I am trying to get the
newly selected value. All I seem to get is the original value of the
dropdown. As it is still a string field I assumed that I could use
this.text(); to get the newly selected value but it appears that I am wrong
Can someone let me know what I am missing?
Thanks
jagadeesh kadubur
2011-03-28 12:46:39 UTC
Permalink
hi,

i am running in the similar problem,where I get the dropdown with the correct data displayed but no matter what record i select it updates it to an empty string.

Can you please tell me how to save data selected from drop down
Post by Jeff
Hello,
I am new to AX and have run into a problem that I bet is really easy...
I have a dropdown and in the modified of that field I am trying to get the
newly selected value. All I seem to get is the original value of the
dropdown. As it is still a string field I assumed that I could use
this.text(); to get the newly selected value but it appears that I am wrong
Can someone let me know what I am missing?
Thanks
Post by Jeff
Thanks for the reply,
But i do not have a ".selection()" I think that it is because the item is a
StringEdit field not a combobox. I did however move my code to after the
Super() and it now allows me to use the this.text(); to get the value.
Thanks again
Post by Jeff
Hello,
To continue this it seeems to have worked for 6 of the 8 dropdowns. The last
2 dropdowns always have an empty string value for the .text(), the
.selected() still does not exist for these controls. It has an empty string
value both before and after the super(). The ProjTable.orig().Salesman does
return the original value but because the new selected value always = "" it
gets updated to an empty string.
Anyone have ideas for what I can look at?
Thanks again
Post by Jeff
Thanks again,
I still seem to have a problem with the 2 dropdowns. I think (a guess) it
may be in the relationships...
If i open the data source in the table browser and try to change the same
value I get the dropdown with the correct data displayed but no matter what
record i select it updates it to an empty string.
Post by Jeff
I think I got it... and thanks for taking the time to help me out Kashperuk.
Turns out in the extended data type the relationship was (it looks to me)
not set right, there was no field after the table so it was: Person == table.
I changed it to Person == EmplTable.Del_Name and it works!!
Thanks again
Loading...