• hp
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 1
    Replies
for (ContentVersion cv : trigger.new)
{
	if (cv.Contact__c != null && cv.Hold__c == true)
	{
		cv.TagCsv = 'Hold';
	}
	system.debug('@@ cv.TagCsv : ' + cv.TagCsv);
}

This code has been put on ContentVersion, Before Update trigger. And this debug line: system.debug('@@ cv.TagCsv : ' + cv.TagCsv);, also shows that TagCsv field has been put value into it successfully, but when I go into the Content record, the Tags field is coming in Empty.

 

Is this some kind of Bug ?

  • August 14, 2012
  • Like
  • 1
for (ContentVersion cv : trigger.new)
{
	if (cv.Contact__c != null && cv.Hold__c == true)
	{
		cv.TagCsv = 'Hold';
	}
	system.debug('@@ cv.TagCsv : ' + cv.TagCsv);
}

This code has been put on ContentVersion, Before Update trigger. And this debug line: system.debug('@@ cv.TagCsv : ' + cv.TagCsv);, also shows that TagCsv field has been put value into it successfully, but when I go into the Content record, the Tags field is coming in Empty.

 

Is this some kind of Bug ?

  • August 14, 2012
  • Like
  • 1

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))
		TagContentTH.tagContent(Trigger.new);
}

 

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);
		}
	}
}

 Output:

did it make it here?

doc type = somethinghere

content type = Q6

tagcsv = somethinghere, Q6