# Percentage - Auto Update, don't really know where to start

Hello.

I can understand if you say go away, but i’m starting off from scratch here

When you look in opportunities I can see the Sales Stage, and then there probability in percentage. When you change the Sales Stage the percentage changes.

HOW!! I want to create a new Sales Cycle field for ourselves with around 15 options in, so I’ve created that and created a sales Cycle probability field with 0.05 for 5% 0.1 for 10% etc… but how do I do something clever in the background so that when I change the Sales Cycle (my equivalent of Sales Stage) it changes my Sales Cycle Probability to the correct matching percentage. I’m struggling and guess it’s tucked away somewhere, but I just cannot work out where I start to create the backend link between the two.

Hi,

You should be able to do this fairly simply with Logic Hooks.

You can find how to set up a logic hook from the SugarCRM dev guide: http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_6.5/Module_Framework/Logic_Hooks/Introduction/
I also made a post detailing how to create a logic hook here: https://suitecrm.com/forum/advanced-opensales-workflow-portal-support/6307-custom-action#22654

If either of these aren’t descriptive enough, let me know!

Thanks

I really am rather new (translate that to thick) to programming Can you point me to the php page within Opportunities module that deals with the existing hook for probabilities, so I can read up on that one and get my head around it.

sorry!!

There isn’t one that deals with Probabilities.
Probablity is just a dropdown field with no special functionality or properties.

If you want to have custom functionality, (Such as making your Sales Cycle Probability match the other Probability field), you would have to create a Logic hook to do this.

Logic hooks are just ways for the CRM to do custom functionality that is not part of the standard CRM.

thanks