تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4389 أدوات العرض

Hi everyone ! 

 

I have a function that should be called every time some fields are modified (so use api.depends here), but i would like the user to choose whether or not the function should be called for some fields or not. Is it possible to do so ? Do you have any idea where i can start ? 

 

Thank you !

الصورة الرمزية
إهمال
أفضل إجابة

Hi Bastien,
You can make to install a module when user tick some fields in the configuration  to execute the function or not. currently you can see when analytic accounting in the account settings is ticked a module will get installed. You can do it like the above or, inside the function you can check whether the field is ticked, and if the field is ticked, then only execute the rest.

الصورة الرمزية
إهمال
الكاتب

Thank you very much, didn't thought about to check wether or not the field is ticked inside of it. Don't know what i was thinking ;)

الكاتب

Actually, after thinkin about it, the problem is that my api.depends is huge and as far as i know it is impossible to detect which field has triggered the method. So the only way to do this is to create methods for each fields in my api.depends and detect in each method if the field is ticked or not ?

المنشورات ذات الصلة الردود أدوات العرض النشاط
5
يناير 25
22251
0
مايو 15
3161
0
يناير 24
2775
0
يوليو 17
3275
4
ديسمبر 19
8468