Conditional default value for catalog variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2017 09:02 AM
Is it possible to force default value of a catalog variable based on another variable oflike we do in ref qual ?
For example, we create a variable set with 2 field
type : integer value
test : string field
If type = 1 then default value for field Test is FirstName
if type = 2 then default value for field Test is LastName
We can like create a function testDefaultValue(type) and would like to use it to define default value for field test
For reference qualifier , syntax is javascript:testDefaultValue(current.variables.type) but this doesn't seem to work for default value (log says current.variables.type is not defined)
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2017 10:06 AM
Why don't you write a onChange client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2017 02:07 PM
Here you go. Put this in the default value line
javascript: if(current.type==1) return 'FirstName'; else return 'Lastname';