- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-25-2018 07:38 AM
Hi all,
It appears I am having issues populating an image field based off of the changes on another field. I have a true/false field on my u_business_cards table called u_chairman. What I need to have happen is if u_chairman changes to true then autopopulate u_chairman with a specific image that I put on the db_image table.
I was able to do this with another application but I can't seem to replicate it. What I have done so far is create a Before Business Rule on insert or update. The filter says u_chairman -- is -- true.
The script that I have in there looks like this....
I know the business rule itself is working because u_ext shows "test" when I update the record.
"0b8b3e4d4fafd7007dc7ea7d0210c786" is the sys_id of the record on the db_image table.
I'm really not sure what could be missing here. If anyone has ideas, let me know!
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-25-2018 08:24 AM
Well... upon even further digging, looks like you may only be able to transfer the attachment to the image field if your image fields are called the same thing... which meant I had to make another image field on db_image table just called u_image and change my variable on my custom table to u_image. Then it worked fine. Just couldn't figure out how to use the original image variable from the db_image table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-25-2018 08:24 AM
Well... upon even further digging, looks like you may only be able to transfer the attachment to the image field if your image fields are called the same thing... which meant I had to make another image field on db_image table just called u_image and change my variable on my custom table to u_image. Then it worked fine. Just couldn't figure out how to use the original image variable from the db_image table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-12-2020 02:02 AM
Hi
Can you please provide the exact code?
Regards,
Alok sahu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-12-2020 05:51 AM
(function executeRule(current, previous /*null when async*/) {
// Add your code here
GlideSysAttachment.copy("ZZ_YYdb_image", "797f7532dbaf5b0c2df7499e0b961928", "ZZ_YYu_business_cards", current.sys_id);
})(current, previous);
This was my final code. But, like I said, I had to have a u_image field on my custom table and u_image field on the db_image table for it to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-13-2020 02:27 AM
Hi,
I added the custom field on both the tables (custom and db_image table) but still it is not working.
Do we need to do any configuration?
Regards,
Alok sahu