function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DaveHagmanDaveHagman 

Creating a trigger on CaseSolution object

Hi All,

 

I am trying to create a trigger on the CaseSolution object in SF. I am using the Force.com IDE plugin for eclipse. When I go to create a new trigger, CaseSolution is not in the list of available objects. I ran updates for the IDE to make sure there were no updates from SF and there were none. Is there a reason that I can't create a trigger on this object? Has anyone else ran into this before?

Best Answer chosen by Admin (Salesforce Developers) 
DaveHagmanDaveHagman

I actually already designed a workaround for this but basically we wanted to update a field on the case everytime a new solution was linked to the case.

All Answers

sales4cesales4ce

To best of my knowledge, you cannot create triggers on casesolution object.

You can only create triggers on Case, CaseComments and email Messages that are related to case.

 

What is that you want to achieve by writing triggers on Case solution object?

 

Sales4ce

DaveHagmanDaveHagman

I actually already designed a workaround for this but basically we wanted to update a field on the case everytime a new solution was linked to the case.

This was selected as the best answer
etienne.giraudyetienne.giraudy

I would suggest to post an idea about this feature!

sales4cesales4ce

Dave,

Nice that you had a workaround already in place.

If you could share your workaround , that would certainly help people trying to do something same.

 

Sales4ce

LakshmanLakshman

Hi Dave,

 

Could you please share the workaround which you have already design or atleast can you give a brief idea of what have you done to achieve this,

 

Thank you!

Julian Juez AlfaroJulian Juez Alfaro

Hi Dave,

 

We are looking for the exact same thing. How did you work around it?

 

Thank you,

Julian.

PranayPranay

I'm not sure what Dave came up with... but i would assume, you could create a trigger at for the Solution creation... and get the case id like so...

 

Select id, (Select CaseId from CaseSolutions), SolutionName from Solution where id='XXXXXXXXXXXX'

 

Then simply update the case!

 

Hope this helps.

 

 

Julian Juez AlfaroJulian Juez Alfaro

Hi Pranay,

 

Thank you for your answer! I have understood that it is not possible to create triggers on CaseSolution. Another user in another forum kind of suggested that a visualforce page needs to be created instead, as the only possible workaround.

 

I am not so familiar with programming (not a programmer at all). I can modify existing code to fit our company needs, but wouldn't even know how to write such trigger that you suggest. Could you help me out here?

 

Thank you!

Julian.

Hemanth BakthavatsaluHemanth Bakthavatsalu
Dave - I know its a very old post, but we have a similar requirement, can you please provide the work around that you have put in place..

I tried to write a trigger on Solution with the below query and retrieve the case id, but the case or solution record does not get updated when a case is associated to existing solution, so the trigger on the solution never gets fired..

Select id, (Select CaseId from CaseSolutions), SolutionName from Solution where id='XXXXXXXXXXXX'