LOCATIONS - how it works?

Could someone help me with LOCATIONS and explain me how it works?
I tried to do something like tree (like in documentation) but i can’t.
Every objets which i create can only choose “root” and can fill the field: “Label in location tree:”
I create 3 locations in one type.
How should i create next secondary locations for these primary locations.
How can i create relations to this locations for exists objects in other type

please explain me step by step maybe with pictures :wink:

BR MArcin

Hi @marcinw ,
Step 1:
Create a simple type, with just a section and inside of the section place a text field and the special control location and save the type. (I call the type in this example LocTest)

Now you are able to create objects of this type with a location.

Step 2:
Go to the object list ovewview of this type (click in sidebar on this type) and add a new object.
Select in “Location” the “Root” location and give “label in location tree” the name “LocObject1”.
Save the object.

Step 3:
Switch in the sidebar to the “LOCATIONS”-tab and confirm that your created location is displayed.

Step 4:
When you now create another object of this type, you can select the “Root” location and also the “LocObject1” as the parent of your new object. Lets select the “LocObject1” as parent and give it the label “LocObject2”. Save the new object.

Step 5:
Switch in the sidebar to the “LOCATIONS”-tab and confirm that your created location is displayed as child of “LocObject1” (there is a + icon next to LocObject1).

image

###################

Can you confirm that these steps work on your side?
Are there still some questions?

BR Adnan

Hello,
in

Have I mark or unmark it?
image

Just keep it in the default configuration (checked)

now i have two problems: :smiley:

  1. i see old objects which i deleted them earlier


    I restarted application and restart system and nothing changed i still see these locations
    even though i have only one object (location) test1
    image

  2. i create first object test1 and try create second
    i don’t see first object:

Go into your mongodb inside your “cmdb.framework.locations” - collection and delete all locations except the “Root” location (public_id:1) and try it again.

Done :wink:

i created again object "jeden’ and tried create next object but i don’t see object “jeden” under “root”

Can you post me here the created loction “jeden” from the db(cmdb.framework.locations) and the type definition of “jeden” (cmdb.framework.types) in json format, so i can have a look at it ?

BR Adnan

Ofcourse:

[
{
_id: ObjectId(‘668663688ef0d5dabc079d29’),
object_id: 3953,
parent: 1,
type_id: 51,
type_label: ‘Test’,
type_icon: ‘fa fa-cube’,
type_selectable: false,
public_id: 14,
name: ‘jeden’
}
]

can you also send me the type of this object ?

Where i should search definition of this type?
In types? I try search in types my type and i don’t have deffinition

It is in “cmdb.framework.types”.

From the info of the location you posted, the public_id of the type should be 51.

BR Adnan

That’s why I couldn’t find this type by name
This other definition than normally type

under is definition

type

[ [0/8232]
{
_id: ObjectId(‘6683c29c67201e691c136093’),
global_template_ids: ,
fields: [
{ type: ‘location’, name: ‘dg_location’, label: ‘Location’ },
{
type: ‘ref-section-field’,
name: ‘ref-section-4965eb83-7f9f-42e4-9eb7-45f105546ddc-field’,
label: ‘Reference’
},
{
type: ‘ref’,
name: ‘ref-4f77cadc-c364-402f-9d86-5b98413968f4’,
label: ‘Ref’,
ref_types: [ 1 ],
summaries: ,
default: 3100
}
],
active: true,
version: ‘1.0.0’,
author_id: 2,
render_meta: {
icon: ‘fa fa-cube’,
sections: [
{
type: ‘section’,
name: ‘section-7d875c09-fb2d-477b-a25b-6e2aa558295e’,
label: ‘Section’,
fields: [ ‘dg_location’, ‘ref-4f77cadc-c364-402f-9d86-5b98413968f4’ ]
},
{
type: ‘ref-section’,
name: ‘ref-section-4965eb83-7f9f-42e4-9eb7-45f105546ddc’,
label: ‘Reference’,
reference: {
type_id: 1,
section_name: ‘dane’,
selected_fields: [ ‘nazwa-lokalizacji’ ]
},
fields: [ ‘ref-section-4965eb83-7f9f-42e4-9eb7-45f105546ddc-field’ ]
}
],
externals: ,
summary: {
fields: [
‘dg_location’,
‘ref-section-4965eb83-7f9f-42e4-9eb7-45f105546ddc-field’,
‘ref-4f77cadc-c364-402f-9d86-5b98413968f4’
]
}
},
acl: { activated: false, groups: { includes: {} } },
name: ‘test’,
label: ‘Test’,
selectable_as_parent: false,
creation_time: ISODate(‘2024-07-04T05:43:31.024Z’),
public_id: 51,
description: null,
editor_id: 2,
last_edit_time: ISODate(‘2024-07-04T05:43:31.024Z’)
}
]

In the type set the property “selectable_as_parent” to true instead of false.

In the location set the property “type_selectable” to true instead of false.

Then everything should work.

It looks like you somehow unckecked the “selectable as parent” box in the type.

BR Adnan

I saved few times this field selectable_as_parent: with mark checked but when i check verify the field in unchecked.

I think I might have to delete this type

I deleted this object type and created again.
It looks good now.
i see my tree :wink:

But now when i used reference field in other object type
it show only public id of location:

I think that it should show Labels not public id these objects because user will not be able to find object which he want.

Could you fix it?

Could you also write what is these numbers?