Custom field type object 2way visibility #12714
kirillmuravyev
started this conversation in
Ideas
Replies: 3 comments
-
Having a Script which runs periodically and updates a reverse relationship is a way to solve this using the tools built into the existing system, but the way I've solved this (from before object refs were a thing) is to make a Custom URL on the object where you want the reverse relation, and encode the search for the primary relation, eg. on VM have a URL which templates
/dcim/device/?cf_runs_on=$my_vm_id_here
then you have one click to see what relation is. It's not as neat as having it on the main object page itself, but it requires even less to maintain.
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: Kirill Muravyev ***@***.***>
Sent: Thursday, May 25, 2023 7:28 AM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [netbox-community/netbox] Custom field type object 2way visibility (Discussion #12714)
Hi All.
I was playing with custom fields a little bit and noticed interesting thing that might be useful to implement.
I have creates a custom field with type "object" in "dcim -> device", object type is "virtual machine".
So I want to link some devices to virtual machines.
BTW, there is no way to model virtual network devices deployed on cloud VMs, when you have a virtual machine in cloud and network device software deployed on it. And we treat those things differently, vurtual machine itself is supported by one team, but virtual network device installed on that machine is supported by another team.
That is why I want to link device and virtual machine together.
So, when I did the above relation, I can open device and link it to virtual machine (and I see that relationship), but from the virtual machine perspective I do not see that relation:
Custom field in DEvice view (I see the link to virtual machine):
[image]<https://user-images.githubusercontent.com/40544508/240911413-2da3261f-797e-44e2-a94b-11d1313e4cc2.png>
But when you open virtual machine you do not see that object relates to this one
I think would be good to see that relation automatically if I reference object in custom field. Otherwise you have to create 2 custom fields and maintain them in order to track it from both sides
—
Reply to this email directly, view it on GitHub<#12714>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM4FOJWMLXB6YOYLNYTXH5F6DANCNFSM6AAAAAAYOYSPCE>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @mtinberg for the idea! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Found the way with custome URL:
My custom field name is "runson". |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All.
I was playing with custom fields a little bit and noticed interesting thing that might be useful to implement.
I have creates a custom field with type "object" in "dcim -> device", object type is "virtual machine".
So I want to link some devices to virtual machines.
BTW, there is no way to model virtual network devices deployed on cloud VMs, when you have a virtual machine in cloud and network device software deployed on it. And we treat those things differently, vurtual machine itself is supported by one team, but virtual network device installed on that machine is supported by another team.
That is why I want to link device and virtual machine together.
So, when I did the above relation, I can open device and link it to virtual machine (and I see that relationship), but from the virtual machine perspective I do not see that relation:

Custom field in DEvice view (I see the link to virtual machine):
But when you open virtual machine you do not see that object relates to this one
I think would be good to see that relation automatically if I reference object in custom field. Otherwise you have to create 2 custom fields and maintain them in order to track it from both sides
Beta Was this translation helpful? Give feedback.
All reactions