Record Producer attachment copy to Demand

kendall_lin
Giga Contributor

Hello,

I have a record producer that allows the user to attach a document. The record producer is used to create a Demand record. The attached file is not showing up on the opened demand. I did research and found information on the GlideSysAttachment.copy script below. However, I have several questions (note I am a SN novice).

GlideSysAttachment.copy('sourcetable', 'sys_id', 'destinationtable', 'sys_id');

NOTE: I used a UI Page to allow the user to attach a file, not the paper clip icon on the record producer. this is a user requirement.

  • The record producer (in a service catalog) is based on the Demand Table. Why is the attachment from the record producer not carrying over to the demand record created from the record producer?
  • If I need to use the above script how do I get the sourcetable, sys_id, destinationtable, sys_id info for the record producer?   Are the sys_ids for the corresponding tables?

Any information provided would be helpful.

Thank you

8 REPLIES 8

Hi,



Just an update. I used the following script for the record producer.



GlideSysAttachment.copy('sc_cart_item', 'sc_cart_item sys_id', 'dmn_demand', 'dmn_demand sys_id');



No joy. The attachment is still being created in the sys_attachment table. Interestingly though, in the sys_attachment table the sys_id in the 'table sys ID' field is different than the one I get when I copy the sys_id of the sc_cart_item table. No idea why...



Thank you,


Kendall Lin


New update!



I actually now see in the sys_attachment table, the attachment is being created on the dmn_demand table. But I do not see it on the demand record that was created as a result of the record producer submission. No attachment shows in the demand record summary form...



Weird


Then please make sure the 'table_sys_id' is same as the sys_id of the record in demand table.


Actually, Can you please let us know,



What is the relation ship between your UI page and the record producer?



Are you using the UI page in place of record producer to create records in the table?



If yes, what is your attachment script doing? The 'table name' in sys_attachment table is supposed to be the target table name where you wanted to insert the record. 'table_sys_id' should be the sys_id of the target record you have created in the table.



As I mentioned above I was wondering you are inserting record into the cart table if you are using a custom UI Page.