You need to sign in to do that
Don't have an account?
Giovanni Di Santo
Test trigger on ContentDocumentLink
I developed a trigger firing after inserting records in the ContentDocumentLink object.
You can find the code here: http://nopaste.linux-dev.org/?780808.
The trigger works just fine but I have a problem with the testing class I wrote for it: http://nopaste.linux-dev.org/?780809
As you can see there is an insert for the object checked by the trigger.
When I run the test class I don't receive any error but the coverage is stuck at 0% no matter what I try to do. It seems like the trigger is not fired at all.
I suppose I'm making a mistake somewhere but I don't know where...
Can you guys guve me any hint?
Thanks,
Giovanni
You can find the code here: http://nopaste.linux-dev.org/?780808.
The trigger works just fine but I have a problem with the testing class I wrote for it: http://nopaste.linux-dev.org/?780809
As you can see there is an insert for the object checked by the trigger.
When I run the test class I don't receive any error but the coverage is stuck at 0% no matter what I try to do. It seems like the trigger is not fired at all.
I suppose I'm making a mistake somewhere but I don't know where...
Can you guys guve me any hint?
Thanks,
Giovanni
Hi Sonam,
It turned out the problem was releated to the test class api version, I siwtched to version 35.0 and the test class worked.
Let me know if you still need the code.
Giovanni
Can you share the code you wrote to cover the contentDocumentLink trigger.
I am in urgent need for it?
Hi Nitin,
Can you give me your email address? I'm going to share you my code in private.
I solved the problem by switching to the newest api version though, even if we had a strange problem while we had to deploy the class in production. We had to deploy that class separately...
I've posted one issue related to trigger I've written on ContenDocumentLink : https://salesforce.stackexchange.com/questions/197003/how-to-show-error-msg-in-contentnote
would you pls share ur view on this or can u pls share ur code which u have written so I can get some idea.