+ Start a Discussion

Content TagCsv Field

On the Content Version object there is a TagCsv field.  I wrote a trigger to set this field to the quarter/type of document but it doesn't seem to work.  Anyone have any ideas?


trigger ContentVersionTriggers on ContentVersion (before insert, before update)
	if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate))


public with sharing class TagContentTH
	public static void tagContent(List<ContentVersion> triggerNew)
		for (ContentVersion currContent: triggerNew)
			System.debug('did it make it here?');
			System.debug('doc type = ' + currContent.Type_Of_Document__c);
			System.debug('content type = ' + currContent.Quarter__c);
			currContent.TagCsv = currContent.Type_Of_Document__c + ', ' + currContent.Quarter__c;
			System.debug('tagcsv = ' + currContent.TagCsv);


did it make it here?

doc type = somethinghere

content type = Q6

tagcsv = somethinghere, Q6



Yes tagcsv field of type textArea can be updated. You have assigned values to tagcsv and through debug statements you have verified its values.

Now what is not workign? Is it like tags are nit created?

In the above example two tags will be created somethinghere and Q6.

Refer section "ContentVersion API tagging" in following document: