
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 11:30 AM
Hi guys
I have a strange behaviour and after more than half a day of googling and reading alot i cannot find a way out.
Here is my scenario:
- I have a scoped application with a table in it
- I have a table in the global scope (not inherited)
- This table has among others a choice field
- for example a u_state field with four choices (requested (value: 1), etc)
- I have a ui action on the form of this table
- This ui action should create a new record on a table in the global scope
My problem:
- When the UI action (see code in attachment 1) runs it does not end up in back to the record (as the redirect code should do it, so anything goes wrong in the post actions) and the record created has blue values (in list view) on the state field. The state field has a value of "1.0" (which is not on the choice list) (see attachment 2). It seems it couldnt find the choices.
I checked the application access settings on the table. Same procedure called in a business rule within the global action works without problem.
Does anyone have any idea what could be wrong?
Any help is much appreciated, thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 11:42 AM
Try record.setValue('u_state','1'); in line 6.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 11:42 AM
Try record.setValue('u_state','1'); in line 6.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 11:47 AM
Hi there Sanjiv
Thank you very much, this was the trick. I am a person that really likes to know why things are like they are.
Do you have an explain for this? Should i generally use the setValue function instead of "="? Or just for choice fields?
Thanks so much, you rescued my weekend!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 11:59 AM
since u_state is a string field, when you assign an integer, it was converting it to 1.0.
You can also try record.u_state = '1';
But you will always need quotes while assigning a value to a string field.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 12:03 PM
Thank you for all the quick answers, i really appreciate that.
Have a good day/nigth whatever timezone your in 🙂