Archiving Records

From SmartWiki
Revision as of 16:01, 17 June 2013 by Ciaran Donnelly (talk | contribs)

Jump to: navigation, search

Level 1 records can be archived so they no longer appear in the Level 1 list view.

This is done via Batch Update.

ArchivingBatchUpdate.png

Batch Update can be used both to Archive records, and remove records from the Archive.


Reports can also be filtered based on whether or not the object has been archived.

RBArch.png
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 = Not-Archived.

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:

  1. The report is run where a record can be filtered according to search criteria.
  2. The user will click on a hyperlink into the record where the "Unarchive" button will be exposed.
  3. Upon clicking the button, the record will be unarchived where it will now re-appear when searched within the UTA.


//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>

See Also