Changes

Archiving Records

1,760 bytes added, 17:58, 20 November 2012
no edit summary
:The above image of the Report Builder shows how to filter for only records that have been Archived.
:To filter for records that are not archived use a criteria of ''='Not Archived' ''in the report builder.
 
==Referencing the field==
You can use the @archived@ variable to reference the archive status of a UTA L1 object, where 1 = Archived and 0 = Unarchived.
 
This can be used within conditional statements such as visibility and edit conditions to display/hide fields based on the object's archive status.
 
==Unarchiving records without using Batch Update==
An alternative method for unarchiving involves using [[Pandora]] in a custom javascript button. The sample code below is to be used within a [[Custom Field Type: Read Only – System Variables]] field.
 
This method is best used in combination with a report built to list all archived records, with a hyperlink for each record.
 
The process for the user will be:
#The report is run where a record can be filtered according to search criteria.
#The user will click on a hyperlink into the record where the "Unarchive" button will be exposed.
#Upon clicking the button, the record will be unarchived where it will now re-appear when searched within the UTA.
 
 
<pre>
//Displays a button where when clicked will call the "unarchive()" function
 
<input type=Button class=Button value="Unarchive Record" onClick="unarchive();">
 
<script type="text/javascript">
function unarchive(){
updatefields('archived',0); //Sets Archived flag to 0
}
 
function updatefields(fieldname,fielddata){
ss_developer_key="xxxxx"; //Enter Developer Key
var gbappid=xxxxx; //Enter application ID
var addfields="opportunityid,"+fieldname;
var rset=new ssRecordSet(null);
rset.addfieldnames(addfields);
var idx=rset.getnewrecnumber();
rset.addfieldvaluebyname(idx,'opportunityid','@opportunityid@');
rset.addfieldvaluebyname(idx,fieldname,fielddata);
var rs=levelone_update(false ,'',gbappid,rset);
}
</script>
</pre>
==See Also==
* [[Batch Update]]
[[Category:Universal Tracking Application]]
0
edits