get attachment.sys_id before catalog item is submitted

Mart Sinimaa
Tera Guru

Hi all,

i need to have somehow to get attachment.sys_id before catalog item is submitted. (so I can't use current.sys_id...)
The use case is as follows: check whether the file is in the correct format, size, etc.

 

1 ACCEPTED SOLUTION

And is this for just the Catalog Item with for example Catalog Client Script? Or about a custom widget to be set up?

If just Catalog Item AND Service Portal... you can't query the sys_attachment table for the correct attachment, because you don't know the sys_id of the sc_req_item (not yet created) or the cart (cart sys_id is added initially on the attachment). 

For Platform UI this would be possible, though Service Portal 😞

Though maybe the variable type which I mentioned would do for you, if you are on Paris-release.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Is this for a Catalog Item on the Platform UI or Service Portal?

If you are on Paris, you could also have a look at variable type Attachment. This can be used with 2 attributes, to validates extension and size.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Service Portal

And is this for just the Catalog Item with for example Catalog Client Script? Or about a custom widget to be set up?

If just Catalog Item AND Service Portal... you can't query the sys_attachment table for the correct attachment, because you don't know the sys_id of the sc_req_item (not yet created) or the cart (cart sys_id is added initially on the attachment). 

For Platform UI this would be possible, though Service Portal 😞

Though maybe the variable type which I mentioned would do for you, if you are on Paris-release.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

so I understand correclty that if I make new widget it's possible but if I need to use catalog client script it's not possible to get that sys_id?