Value of dropdown

Microsoft Axapta Development, Management, Functional and Technical Support Discussions.

Value of dropdown

Post by usenet » Tue Jun 30, 2009 8:25 pm

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
More available at Technology Forums
usenet
 
Posts: 80094
Joined: Wed Jun 24, 2009 8:14 am

RE: Value of dropdown

Post by usenet » Thu Jul 02, 2009 3:40 pm

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

"Kashperuk Ivan (Vanya)" wrote:

> 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
>
>
> "Jeff" wrote:
>[color=green]
> > 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
[/color]
More available at Technology Forums
usenet
 
Posts: 80094
Joined: Wed Jun 24, 2009 8:14 am

RE: Value of dropdown

Post by usenet » Thu Jul 02, 2009 4:45 pm

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



"Kashperuk Ivan (Vanya)" wrote:

> 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
>
>
> "Jeff" wrote:
>[color=green]
> > 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
[/color]
More available at Technology Forums
usenet
 
Posts: 80094
Joined: Wed Jun 24, 2009 8:14 am

RE: Value of dropdown

Post by usenet » Fri Jul 03, 2009 4:06 pm

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.


"Kashperuk Ivan (Vanya)" wrote:

> 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
>
>
> "Jeff" wrote:
>[color=green]
> > 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
> >
> >
> >
> > "Kashperuk Ivan (Vanya)" wrote:
> >[color=darkred]
> > > 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
> > >
> > >
> > > "Jeff" wrote:
> > >
> > > > 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
[/color][/color]
More available at Technology Forums
usenet
 
Posts: 80094
Joined: Wed Jun 24, 2009 8:14 am

RE: Value of dropdown

Post by usenet » Fri Jul 03, 2009 4:43 pm

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


"Jeff" wrote:

> 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.
>
>
> "Kashperuk Ivan (Vanya)" wrote:
>[color=green]
> > 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
> >
> >
> > "Jeff" wrote:
> >[color=darkred]
> > > 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
> > >
> > >
> > >
> > > "Kashperuk Ivan (Vanya)" wrote:
> > >
> > > > 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
> > > >
> > > >
> > > > "Jeff" wrote:
> > > >
> > > > > 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
[/color][/color]
More available at Technology Forums
usenet
 
Posts: 80094
Joined: Wed Jun 24, 2009 8:14 am


Return to Axapta



Who is online

Users browsing this forum: No registered users and 2 guests