Hi... I am new to sugarcrm.I want to make a field read only based on another field in sugarcrm5.0.
Any help will be greatly appreciated..... help plz.. someone.. anyone...![]()
Hi... I am new to sugarcrm.I want to make a field read only based on another field in sugarcrm5.0.
Any help will be greatly appreciated..... help plz.. someone.. anyone...![]()
Last edited by dnandi; 2008-05-05 at 10:54 AM.
The best way to do this is to not add that field to the editview part of the module.
Is that field to be edited if the other is not set.
Another way to do this would be to set up a logic hook such that if the field is set the way that says the other should not be is to have the logic hook to blank the filed.
Good luck,
Paris
Hi, dnandi.
If you want to make that field readonly you can do that:
1. Add this array inside the templateMeta of the editviewdefs.php of the module.
2. Inside the javascript you can add the code:PHP Code:'includes'=> array(
array('file'=>'modules/YourModuloe/YourModule.js'),
),
),
document.getElementById("field_to_lock").readOnly = true;
Based on the rule to make that field locked.
Cheers
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
Thanks a lot Andopes.
Will give it a try. Actually i have to keep it in editview mode cause if the other field is not set, it's got 2 b edited...
I tried it but its not working Andopes.. I think it's not calling the .js file. any suggestions...
try putting an alert in the js file to see if it is being calledOriginally Posted by dnandi
I am new to sugarcrm.. Can u tell me the syntax of alert..
Originally Posted by dnandi
The alert is just a bit of javascript - put it in the js file
something like alert('test')
if the js file is being called you will get a popup saying 'test'
hope that makes sense
Thanks. That makes complete sense.. And do u think that the above given solution by andopes will be good enough for the problem stated above...
Andre's solution looks good to meOriginally Posted by dnandi
What he comes up with is usually great - I wish I was 1/2 as good
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks