跳至内容
菜单
此问题已终结
1 回复
1277 查看

I want to have x_invoice as a required field in the 'Won' stage but not the ones before that. Field x_invoice can be empty for the New, Qualified and Proposition stages but i want it to be required when moving the record to Won stage. So if a user were to drag and drop a record to the Won stage without an invoice it would give an error and only be moved to Won if invoice is entered.

I have tried to use record rules and coding in front end but either there is no change or it gives error. I need a solution that can be done from front end/ interface because I dont have access to backend. I would really appreciate it if someone can help me please.


Solutions I've tried:

1. - No change

2.  - No change

3.  - No change

4. - No Change

(okay i dont know why my codes are not showing but please i would appreciate any help)

I've also tried the variations for state_id instead of stage_id.


Record rules (in crm.lead):

1. [('stage_id', '=', 4), ('x_invoice','!=',False)]

2. [('stage_id', '=', 'Won'), ('x_invoice','=',True)]


Both give error:

"the requested operation ("read" on "lead/opportunity" (crm.lead)) was rejected because of the following rules: - invoice required for stage won (records: new (id=2), user: administrator (id=2))"

形象
丢弃
最佳答案

Record rules are not the proper option to do this. The record rule is a mechanism that controls the visibility and access rights of records in a database based on certain conditions. 

I suggest you to use an automated action, like this. The example is made in V17, where you can set automations directly on the pipeline, but you can do the same in previous versions using the same logic.


形象
丢弃