I think I have a pretty straightforward ‘challenge’ that I’ve spend too long trying to solve, I’m trying to retrieve a (class) property of another page.
I have the full adress of this other page: in the example case it’s : "Main.Werkwijze.Formulieren.Rapport van oplevering BMI"
When viewing the object of the page the class is listed as :
I’ve also attempted variations of the class reference #set ($xobject = $xdoc.getObject('Main.Werkwijze.Formulieren.Code.FormulierenClass')) as it seems the $xobject variable remains empty.
Now I know from the documentation that there are $service queries that can be run on all the objects of a class aswell, and Im fairly confident that I can get my solution through that route… but I find myself wondering what the best practice is here… and perhaps a hint as to where I’m going wrong.
The OP screenshot of the object view was / is from the [Main.Werkwijze.Formulieren.Rapport van oplevering BMI]
“Main.Werkwijze.Formulieren.Rapport van oplevering BMI”
So it appears to me the formulierenclass is not being loaded… however the url for the formulierenclass is /Main/Werkwijze/Formulieren/Code/FormulierenClass and when I test with a link to [[test>>doc:Main.Werkwijze.Formulieren.Code.FormulierenClass]] it sends me to the Classpage just fine
This means that there’s no xobject Main.Werkwijze.Formulieren.Code.FormulierenClass in the Main.Werkwijze.Formulieren.Onderhoudsplan OAI page (i.e. getObject() returns null).
Hey @vmassol , thanks for the response during your busy day!
I understand that it’s not retrieving the object, I’m just unsure why it isnt now (and why it was before / is working on some pages!)
Also a sidenote it’s supposed to get an attribute of a page from another class, not of the current page!
Basically the setup is that there is an class that describes forms and a class that logs changes to the forms ; When making a ‘logging’ page the user selects a form page, and the script is supposed to retrieve data of that form page.