DEAR ALL
I WANT TO MAKE MY SALES HEADER FORM NON EDITABLE
BUT I NEED POSTING DATE AND DOCUMENT NO. EDITABLE.
IS THERE ANY POSSIBILITY TO DO THIS THROUGH CODES.
You can do it on the onaftergetrecord trigger and do something like:
IF "your condition"=TRUE then BEGIN
CURRFORM."Sell-to Customer No.".EDITABLE(FALSE);
<all other fields>
..
..
END ELSE BEGIN
CURRFORM."Sell-to Customer No.".EDITABLE(TRUE);
<all other fields>
..
..
END;
But why are you doing this? Are there certain users that cannot change a Sales Order?
Then it might be easier to revoke their right to change the table through the security settings.
Also if it is only a certain group of people then I would revoke them access to the regular Sales Header Form.
I would create a copy of the Sales Header form and then set all the fields to non editable and make that new form available to the restricted users.
Doing it through code is just a lot of coding, since there are quite a few fields on the Sales Header.
Hope this helps,
Regards,
Willy
Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
DEAR ALL
I WANT TO MAKE MY SALES HEADER FORM NON EDITABLE
BUT I NEED POSTING DATE AND DOCUMENT NO. EDITABLE.
IS THERE ANY POSSIBILITY TO DO THIS THROUGH CODES.
Don't use capital letters while posting. It amounts to shouting....
Take a look at 2-Controlware's Field Security module. With this module you can secure fields and sets of records. Ask your partner about it or use Google.
Comments
You can do it on the onaftergetrecord trigger and do something like:
IF "your condition"=TRUE then BEGIN
CURRFORM."Sell-to Customer No.".EDITABLE(FALSE);
<all other fields>
..
..
END ELSE BEGIN
CURRFORM."Sell-to Customer No.".EDITABLE(TRUE);
<all other fields>
..
..
END;
But why are you doing this? Are there certain users that cannot change a Sales Order?
Then it might be easier to revoke their right to change the table through the security settings.
Also if it is only a certain group of people then I would revoke them access to the regular Sales Header Form.
I would create a copy of the Sales Header form and then set all the fields to non editable and make that new form available to the restricted users.
Doing it through code is just a lot of coding, since there are quite a few fields on the Sales Header.
Hope this helps,
Regards,
Willy
Don't use capital letters while posting. It amounts to shouting....
http://ssdynamics.co.in
OnActivate()
CurrForm.EDITABLE(TRUE);
OnDeactivate()
CurrForm.EDITABLE(FALSE);
http://www.BiloBeauty.com
http://www.autismspeaks.org