Block closed opportunities/projects

Hi everyone!
Does anyone know any way to block closed projects/opportunities? I need users can’t edit the registers in this state. In other hand, I need that in related fields cannot be chosen. Please, I need your help!!! Thanks in advance.

Regards,
María.

Hi,
you could forbid direct updates of the bean by dynamically adding security groups (using workflows).

For relationships you’ll probably need to add some hooks, e.g. before_relationship_add. Here you could verify the current status and either add or remove the relationship.

I don’t know if I understand well your answer. Is it possible to apply a security group only to one record, not to the entire module?

Yes, exactly. That’s how you manage permissions per record (if the respective role is set to “group”).

Sorry, I don’t get it. This is the process that I’m following:

  • First, I have a security group with a role with this permissions:



This is the security group that the user is assigned.

  • On the other hand, I have another security group with other role with this permissions:



This is the security group that I’m going to use in the workflow.

  • Then, I have created this workflow:



My goal is that when an opportunity is in a state “Cancelled”, users can’t edit it. But with this method, the users can view all oportunities and edit only the opportunities which they have created. There aren’t change with the workflow.

Could you help me, please???
Thank you very much!!!

Sorry for the insistence, but I really need to solve this. Can anybody help me? Thank you again!!!

@crmspace could you help me???
Thanx!!!

Hi,
I am currently in vacation, but I’ll have a look next week unless someone else can assist you.

Kind regards,
F.

@mtruanru

As a variant you can make special form where fields mark as readonly for your projects in status “Cancelled”. For it you should edit several php files.

Hey @mtruanru

That workflow looks like it should assign the Security Group to the Opportunities

If you go to one of your “Cancelled” Opportunities, do you see both of your security groups in the Subpanel?
(The One that the user is assigned, and the “Cancelled” one)

Or just one?


If you see both, it might be due to the setting “Additive Rights” in Security Suite settings.

I believe this is because the “Additive Rights” setting will apply the most non-restricting permission of the user’s groups.
(Which in this case, allows them to edit/view)


If you toggle the “Additive Rights” in Security Suite Settings, does it behave closer to what you’d expect?



If you only see one Security Group, Which one?
If it is not your “Cancelled” group, It might be worth checking the Workflow’s “Process Audit” subpanel to see if it has run successfully on any records


Also, as an aside, the “Access”->“Disabled” permission will prevent the user from access the Opportunities Module itself, not specific records

You might have to Allow Access, but setting “None” for the other permissions should suffice

Hi @John,
When I have an opportunity cancelled, it only have related one security group (the security group that i have assigned with the workflow).

Moreover, I have tried to change the role associated with this security group (now the module Opportunities is enabled althought the rest of options are in none), but the result is the same: I can edit the opportunity…

I believe the problem is in the security group, but… Where? Any idea?
Thanks again!

María.

Hello, Maria. Do you still need help on this?

I solved that very need with Conditional Notifications plugin, cheap and one time charge (see Suite CRM Store). You will also need Field Level Access plugin. I’ve Also hired the FLA plugin vendor for a little customization for quite a fair value. (the customization is to have Read Only fields appearing as regular fields in edit layout, but with no edit rights)

For a given module, I’ve created a numeric field, let’s say, “Cancelled” with default value 0.

Then a workflow. Whenever the record is saved and status is “Cancelled”, set the Cancelled field value to 1.

In Field Level Access, I marked that field “Cancelled” as “Read Only” for the needed roles and put it in the edit form, “hiden” in a “Control” tab.

Then, in the Conditional Notifications plugin, I created a new notification for that module, with the condition “Cancelled = 1”, then set for Save Not Allowed with a message like “You are not allowed to change a Cancelled record”.

With a few hundred bucks (one time charge) and 30 minutes, your issue is solved.

Another solution is to code a little PHP file and put it as a hook method, but you will need a programmer and learn how to extend SuiteCRM. With time and some frustration, will get there.

Let me know if you need more details.