'undefined' value is populating on string fields when are copied from other record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2020 07:44 PM
'undefined' value is populating on string fields when they are copied from other records.
When the record producer related to purchase request catalog item is submitted from the portal, the 'undefined' is not seen.
But when the record is submitted from the application, the 'undefined' field is seen as below.
When the 'New' button is clicked under the funding code the new record copies fields from the first record.
This is code that copies the field values on the Funding code from first inserted record to the second inserted record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2020 08:22 PM
Hi In this script, you are loading the scratch pad variable. There will be a OnLoad client script for the Funding Code table where you will be assigning the scratchpad value to the forms field like object, unit and department etc. Check that script and see, if by mistake, activity, program and the other field with undefined value is getting getting set. Then that could be the cause for this issue. You may need to check for the valid value (!=undefined) before setting it.
** Mark this response as accepted answer and helpful, based on impact:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2020 09:53 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2020 11:10 AM
defining only g_scratchpad variable in if block will not work.
comment the line number 4 if block, and then try.
another question , why are you using another if block in line number 4 ? try to comment that as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2020 04:32 PM
Hi, for the 3 fields that you get undefined, comment the line 12, 13 & 14.
OR alternatively, you can do a if check and then have each of those line
like
if(g_scratchpad.program){
g_form.setvalue('u_program_code', g_scratchpad.program);
}
Repeat this code for other 2 fields.
**Mark this response as accepted answer and helpful, based on impact.
If my answer helped you, kindly mark it as correct and helpful.