I am trying to set up a sys_DropDownSingle field that is populated by content items (of a particular type - “Location” in this case) that are in the folder that a new item is created in. In other words, I want my lookup application to filter my “Location” items by their parent folder.
I have this working on the creation of an item. I am able to send the sys_folderid as a parameter that can be read by the lookup application. However, once the item has been created, I am no longer able to pass sys_folderid as a parameter and the DropDown menu, is no longer filtered (way too many entries). I thought this might be something to do with a created item possibly having multiple parent folders, but it seems that it’s not possible to add any parameters to the Content Editor when editing an existing item.
Can anybody suggest a way to pass a sys_folderid of an existing item to a lookup application?
Looks like this same general question has been asked recently @ http://forum.percussion.com/showthread.php?11257-Field-visibility-problem.
The window opened for editing a content window doesn’t have the sys_folderid parameter in its URL. We have been able to adjust the parameters passed to the edit window to include the sys_folderid; however, it disappears after updating.
You could have a hidden field that saves the sys_folderid upon creation, and use this value in your XML Application; however, if the content item is moved you may need to create a method for updating its field.
Thanks, Riley. Yes, that pretty much as far as I’ve got.
This may be a solution and for this particular content type, we could probably make moving it an Admin only issue (and have that hidden field visible for Admin).
However, I’m still having problems trying to use the field value in my look-up application.
Assuming my field is called “hidden_field” and populated by the folderid I have the following in my Selector Properties:
PSX_OBJECTRELATIONSHIP.OWNER_ID = PSXParam/hidden_field
If I put the folderid number directly in, it’s working, so it looks like I’m not passing this field to the application either.
I ended up solving this problem by manually adding SQL in the application that conditionally chooses the folderid if it’s there or otherwise uses a subquery to get the folderid from the contentid.