- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2021 02:42 AM
Hi All,
I am creating a new Document Record, when a custom table record gets closed. But I also want to create Document revision record associated to respective Document created. For this I used flow designer that triggers when a document record is created. This is creating new Document revision record, but is not showing any relation with Document record. How to create a document revision record associated to respective document record created.
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2021 05:13 AM
Are you attaching attachment on those fields after record creation.
You can write after update business rule on custom table, condition you can include
"field changes"
and then use that script to copy the attachment from custom table to revision table.
In business rule you have to get the revision record sys_id by glide record , i am assuming in your custom table you are storing "Document Revision" record , or storing custom table record in "Document Revision" form ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2021 04:30 AM
Hi
Could any of you please help me on this. This Managed Doc is really confusing, I need your help here.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2021 01:41 PM
You have to add Document record sys id on document revision column "Document", this way your document revision will link to the document record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2021 01:09 AM
Hi
Thank you so much, that is working. I have one more requirement, like copying attachment stored in a field of custom table to this document revision record.
1. I have written before insert/update business rule to create document record when the custom table record gets closed.
2. I have created a custom string field "Created from" on Document table, which is update by BR written like "Record Created from script".
3. I have created Flow designer, which triggers when Document record is created and with if condition, Created from is "Record Created from script". So with all these steps I am successfully able to create Document record and Revision record associated to respective Document Record. Now I want to copy the attachment on a field of custom table to this Document Revision Record. Could you please help me on this, as I am not able to find much information on this specific document application.
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2021 05:15 AM
You can use GlideSysAttachment copy() method to copy it from custom table to "Document revision" record.
Script Example:
GlideSysAttachment.copy('sourcetable','sys_id','destinationtable','sys_id');
Doc Link.