- 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 06:23 AM
Hi Brad,
Thanks for the reply.
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:38 AM
Could you describe a bit more about that this is supposed to do? It looks like you changing most of the field values on the current record to null and then running a current.insert(). What table are you trying to create a new record on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2016 12:07 AM
Hello Brad,
We are trying to create a record an a table that extends the Task table. It has more than 100 fields in it and we are emptying few fields before running the current.insert().
Only the fields that we don't want in the new record are being emptied, rest will be same as the 'current'.
Thanks and Regards,
Santhosh