- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 09:11 PM
Table = u_test_table
Fields = field1, field2
var cartId = GlideGuid.generate(null); var cart = new Cart(cartId); var item = cart.addItem('e2132865c0a8016500108d9cee411699'); var rc = cart.placeOrder();
var number = rc.number
//i want to set rc.number in field1 (BR on table u_test_table)
current.setValue(field1,number) ---- this is not working neither
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 11:45 PM
Hi Neha,
your BR has different field name
current.setValue('u_field1',number);
current.update();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 09:40 PM
Hi Neha,
what type of field is this? where is this script written?
you should give the field name there
current.setValue('field1',number);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 09:49 PM
its not working. i want to copy rc.number in field and want to show field in response of api but its not getting copied.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 09:51 PM
Hi Neha,
are you getting the rc.number in logs? what type of business rule is this? Is this before BR?
Is the field name 'field1' correct?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2020 10:45 PM
yeah I am getting rc.number in logs and info message it just i am not able to set it in fiedl1 its passing empty value