Closed andrewduckett closed 1 month ago
I think this could be relatively easily supported, and I agree with your assessment. Though the link
attribute via API is 'new' to me as in I don't know/remember it so I'd have to look a little, assuming you weren't just going to send a PR
@vetsin I'm happy to open a PR; if you'd prefer to tackle it yourself just let me know how i can support.
I'd like to include the
link
attribute in GlideElement when it exists to know if/when an element of a record is a link to another record. Some elements come with an additional attribute,link
that points at the specific record.I did check out the
guess_is_sys_id
which is usually enough to tell if it's asys_id
but would prefer to use the returned field when available.I took a quick look to see what this would take, minimally something like:
the base API would need to make the
sysparm_exclude_reference_link
param configurable. The default value should probably still be false so a quick check to see if it was set is probably enough. https://github.com/ServiceNow/PySNC/blob/1.1.8/pysnc/client.py#L151the
GlideElement
would need to accept an optionallink
when adict
is provided. Optionally an additional kwarg could be included but this might cause more grief for existing users. https://github.com/ServiceNow/PySNC/blob/1.1.8/pysnc/record.py#L32-L36It might be worth adding some type of getter to the
GlideElement
as well, again, if it's not going to impact users. Otherwise it looks like it would be included inserialize
so that may be sufficient.