- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 08:24 AM - edited 07-25-2024 08:32 AM
Can someone help me fix this BR so it shows the attachment file ext.
Currently its creating (required) prefix by picking up the value from a field, and creating a new file name as prefix + hyphen + file name. But for some reason not picking up the file extension.
Requirement : The total name character limit is 100 i.e prefix + filename.ext
Business Rule:
(function executeRule(current, previous /*null when async*/ ) {
var auditGR = new GlideRecord(current.table_name);
auditGR.get(current.table_sys_id);
if (auditGR.u_pbc_id) {
current.file_name = auditGR.u_pbc_id + " - " + current.file_name;
}
})(current, previous);
This is what it shows currently in the activity, its missing the file ext.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 12:42 PM
@Snow Angel
try this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:09 AM - edited 07-25-2024 09:21 AM
Hello Satish,
I really appreciate your prompt help. I've made the suggested changes, the ext. shows but now its missing the required prefix i.e the value from the "u_pbc_id" field followed by a hyphen.
What can we do here so the prefix also shows up along with file name and its extension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:33 AM - edited 07-25-2024 09:35 AM
Hi @Snow Angel
can you please share me your latest code. also what is the field type of your prefix field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:34 AM
Below is the latest code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:42 AM
@Snow Angel what is the field type of your prefix field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 09:47 AM
its a string filed, manually entered, the format is xxx-xxx for eg OIG-001-Filename.ext