Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] Programmat...
 
Notifications
Clear all

[SOLVED] Programmaticaly set field to required on status change

5 Posts
3 Users
0 Reactions
2,457 Views
(@antoine1003)
Posts: 36
Active Member
Topic starter
 
[#6841]

Hey,

I would like to set a field of Action object to required when status is changed. I tried to use

dijit.byId("idEfficiency").set('required', 'true');

but it doesn't work.

Is there any way to do it?

Thanks ! 🙂


 
Posted : 24 Jul 2020 16H00
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

Best way is to use our Screen Customization plugin.


 
Posted : 24 Jul 2020 16H04
(@antoine1003)
Posts: 36
Active Member
Topic starter
 

Haha :')


 
Posted : 24 Jul 2020 16H06
(@antoine1003)
Posts: 36
Active Member
Topic starter
 

For the one who are looking for the same thing I found it by my self...
You need to go to SqlElement.php and in function getExtraRequiredFields add the desired field.

For example in my case when an Action status is changed to done I want the field idEfficiency to become required to I wrote :

if (!isset($statusObj) || $statusObj == null) {
    $statusObj = new Status($status);
}
if ($class == 'Action' && $statusObj->id && $statusObj->name == 'done') {
    $result['idEfficiency'] = 'required';
}

 
Posted : 24 Jul 2020 17H19
Paul Ghobril
(@envergus)
Posts: 46
Active Member
 

Still the Screen Customization plugin is the Best way to do it.
Otherwise you need to make a change on code every time you upgrade Projeqtor.


 
Posted : 25 Jul 2020 9H30
Share:

Scroll to Top