Difference between revisions of "Updating Store Value System Variables with Pandora"

From SmartWiki
Jump to: navigation, search
(Created page with ' 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 …')
 
Line 1: Line 1:
 
  
 
When updating a [[Store Value - System Variable]] custom field using Pandora you have 2 options:
 
When updating a [[Store Value - System Variable]] custom field using Pandora you have 2 options:
Line 16: Line 15:
 
                 rset.addfieldvaluebyname(idx,'cf_1234713','Store This Value');
 
                 rset.addfieldvaluebyname(idx,'cf_1234713','Store This Value');
 
        
 
        
                 result=level23_update(false ,'',100022,2,rset);
+
                 result=level23_update(false ,"",100022,2,rset);
  
  
Line 29: Line 28:
 
                 rset.addfieldvaluebyname(idx,'cf_v1234713','ignore');
 
                 rset.addfieldvaluebyname(idx,'cf_v1234713','ignore');
 
        
 
        
                 result=level23_update(false ,'',100022,2,rset);
+
                 result=level23_update(false ,"",100022,2,rset);
  
  

Revision as of 20:00, 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);



See Also