12

After our upgrade to Tridion 2011, I was trying to convert our Tridion 2009 Custom URL code written using ASP, to work on 2011. While working on this, I was stuck with a few API's that are not available on Tridion 2011.

On Tridion 2009, below is working as expected:-

window.dialogArguments.fieldValue
window.dialogArguments.fieldType
window.dialogArguments.isMultiValued
window.dialogArguments.publicationURI

On Tridion 2011, I changed the Custom URLs to use the below format but I didn't get back values from the Custom URLs as expected. For firefox, I get too few values back and on IE I get values as undefined.

FireFox:

window.dialogArguments.getFields()[0].properties.fieldDefinition.localName = SingleLineTextField
window.dialogArguments.getFields()[0].isMultiValued = Undefined
window.dialogArguments.getFields()[0].publicationURI = undefined

IE:

window.dialogArguments.getFields()[0].properties.fieldDefinition.localName = Undefined
window.dialogArguments.getFields()[0].isMultiValued = Undefined
window.dialogArguments.getFields()[0].publicationURI = Undefined

Please suggest how I might be able to fix this.

2
  • Hi Siva, if one of the answers below helped fix your issue, could you consider accepting it? (click the check mark next to that answer) Commented Mar 4, 2013 at 12:06
  • @BartKoopman: Thanks for the information :) . Actually I was working on it, thats the reason I haven't accepted. Once my testing is completed on it, I will accept it Commented Mar 4, 2013 at 16:50

2 Answers 2

14

The Publication URI is available through the controller object which is available in the window.dialogArguments, so you should be able to use:

window.dialogArguments.controller.getItemPublicationUri()

Through the controller you can also get the actual item and related information, best to check it out in a debugger to see all available method.

isMultivaluedis a method, so you should call it like: window.dialogArguments.getFields()[0].isMultivalued(), that should return you the correct value.

It's unclear to me why properties.fieldDefinition.localName does not work in IE. I have the same behaviour while it works fine in Chrome and FF (something you should report to Customer Support). For the time being, perhaps you can try to use window.dialogArguments.getFields()[0].getTypeName() instead, that does seem to return the fieldtype fine in both Chrome and IE for me.

3
  • When I was testing, window.dialogArguments.getFields()[0].isMultivalued() is still not working and window.dialogArguments.controller.getItemPublicationUri() is working Commented Mar 10, 2013 at 14:10
  • window.dialogArguments.getFields()[0].isMultivalued() works fine for me on both Chrome and IE on 2011 SP1 HR1, so you might want to contact Customer Support if it doesn't for you. Commented Mar 11, 2013 at 8:33
  • 1
    I found isMultivalued() issue on FF. The problem is on 2009 isMultiValued, the letter V is Caps but on 2011 isMultivalued() letter v is small case. Commented Mar 11, 2013 at 13:44
5

Another series of calls you might find helpful here and in the future are calls obtainable from window.dialogArguments.controller.getItem().

For example:

window.dialogArguments.controller.getItem().getSchemaId()
window.dialogArguments.controller.getItem().getContent()
window.dialogArguments.controller.getItem().getLockedById()
window.dialogArguments.controller.getItem().getOwningPublicationId()
window.dialogArguments.controller.getItem().getOrganizationItemId()
window.dialogArguments.controller.getItem().getTitle()
window.dialogArguments.controller.getItem().getVersion()

.. and the list is quite large, check it out in Firefox Firebug Console command line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.