- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 05:02 AM
Hello All,
We have a UI action which creates a new Record by copying the content from existing record.
Below is the similar code:
var obj = current.insert();
{
//some code which does updates on the object 'obj'
}
action.setRedirectURL(current);
The 'current.insert()' is failing because of a before insert Business Rule failure on the table (of which the 'current' belongs to). ,The Business Rule check is working fine and even the UI action abort also working fine. The main issue is that after it redirect to the 'current', it has the values of the new record in the form instead of existing values.
Say suppose the 'Number' of the current is 'TASK0001', after redirection it shows the number of the 'current' as 'TASK0089' which is the next number in the counter sequence.
Can someone please explain which is this? Is something wrong in the code or the UI Action configuration?
Thanks and Regards,
Santhosh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 05:07 AM
Hi Santhosh,
That is the expected behavior. UI Action looks fine.
Thanks
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 05:07 AM
Hi Santhosh,
That is the expected behavior. UI Action looks fine.
Thanks
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 05:09 AM
Can you please paste all the UI action code here ?
You should use current.insert(); after mapping all the values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 06:20 AM
Hi Ravi,
Below is the exact script in the UI Action:
-----------------------------------------
current.u_initiator = '';
current.assigned_to = '';
current.u_requested_imp_date = '';
current.u_impl__date = '';
current.follow_up = '';
current.u_ambition = '';
current.u_line_items = '';
current.u_line_items_connected = '';
current.u_controlling_ambition = '';
var copypcc = current.insert();
if(current.u_split == true)
{
var pcc = new splitorcopyorcreatePCCSTRAIM();
pcc.createProblem(copypcc);
}
action.setRedirectURL(current);
---------------------------------------
Thanks and Regards,
Santhosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2016 06:20 AM
Hi Santosh,
Current is a global object OOB that refers to the record you're on, so that would be the existing record in your ui action. You would need to use GlideRecord to create an additional record. Could you post your ui action code?