Difference between revisions of "Updating Store Value System Variables with Pandora"
From SmartWiki
Line 23: | Line 23: | ||
rset.addfieldnames("eventid,cf_v1234713"); | rset.addfieldnames("eventid,cf_v1234713"); | ||
var idx=rset.getnewrecnumber(); | var idx=rset.getnewrecnumber(); | ||
− | + | ||
rset.addfieldvaluebyname(idx,'eventid',eventid); | rset.addfieldvaluebyname(idx,'eventid',eventid); | ||
rset.addfieldvaluebyname(idx,'cf_v1234713','ignore'); | rset.addfieldvaluebyname(idx,'cf_v1234713','ignore'); |
Revision as of 20:05, 22 August 2012
When updating a Store Value - System Variable custom field using Pandora you have 2 options:
1) Populate the actual value with Pandora 2) Prompt the SmartSimple server to calculate the value based on the field configuration
For the first option, the values are added directly by the javascript code, just like any other custom field that stores data. To update custom field with ID 1234713 with the text "Store This Value" the following code would be used:
rset=new ssRecordSet(null); rset.addfieldnames("eventid,cf_1234713"); var idx=rset.getnewrecnumber(); rset.addfieldvaluebyname(idx,'eventid',eventid); rset.addfieldvaluebyname(idx,'cf_1234713','Store This Value'); result=level23_update(false ,"",100022,2,rset);
For the second option you add the letter "v" in front of the fieldid. The value that you pass will be ignored, and the system will process the variables in the configuration of the Store Value - System Variable custom field to determine what value will be stored.
For example:
rset=new ssRecordSet(null); rset.addfieldnames("eventid,cf_v1234713"); var idx=rset.getnewrecnumber(); rset.addfieldvaluebyname(idx,'eventid',eventid); rset.addfieldvaluebyname(idx,'cf_v1234713','ignore'); result=level23_update(false ,"",100022,2,rset);
Important
- Prefixing the custom field id with the letter "v" is only appropriate if the custom field is an Store Value - System Variable field.