Aurora Posted February 3, 2017 Report Share Posted February 3, 2017 Hi all ! Does anyone has a solution for this? I need to hide some text on the details page, when AuthField' value is not equal value from the Field#2. Merci! Quote Link to comment Share on other sites More sharing options...
0 Mathilda Posted February 3, 2017 Report Share Posted February 3, 2017 Hi Aurora, You may try using the following code in the footer of your details page. I wrapped text in a div with ID "Text" <div id="text">Custom text</div> <SCRIPT LANGUAGE="JavaScript"> function hide() { var x = '[@authfield:FIELNAME]'; var y = document.getElementById("EditRecordFIELDNAME#2").value; if (x!=y){ document.getElementById("text").style.display="none"; } } window.onload=hide; </SCRIPT> Insert your authentication parameter instead of '[@authfield:FIELDNAME]' also use your field name instead of "FIELDNAME#2" Cheers! Quote Link to comment Share on other sites More sharing options...
0 SNMCStrategicSupport Posted February 3, 2017 Report Share Posted February 3, 2017 (edited) Would there be a way to do this and hide results page fields? I have a report that produces editable fields; but I want to set a rule that if an auth field is not equal to a field in the table, I want them to see but not be able to edit. Worst case, I'd take just hiding the field all together... EDIT: for clarity - instead of hiding by identifying the <div> I want to perform the function by identify a results field as seen in the picture. Edited February 3, 2017 by SNMCStrategicSupport Quote Link to comment Share on other sites More sharing options...
0 Mathilda Posted February 14, 2017 Report Share Posted February 14, 2017 On 2/4/2017 at 0:50 AM, SNMCStrategicSupport said: Would there be a way to do this and hide results page fields? I have a report that produces editable fields; but I want to set a rule that if an auth field is not equal to a field in the table, I want them to see but not be able to edit. Worst case, I'd take just hiding the field all together... EDIT: for clarity - instead of hiding by identifying the <div> I want to perform the function by identify a results field as seen in the picture. I don't see an option to restrict editing on results page. For example inline edit links have the same class for each Id. As a workaround, we can compare info in auth field to field value and if those values are equal, we can provide a link to a separate details page, where you will be able to edit the record. Add an html block to your report, disable editor and paste the following script: <script> if ([@authfield:Field_name] ==[@field:Field_name]) { document.write('<a href="URL_Of_details_page?ID=[@field:ID]">Edit record</a>'); } </script> Paste your fields instead of [@authfield:Field_name] and [@field:Field_name] Also you need to paste your URL with parameter instead of: URL_Of_details_page?ID=[@field:ID] Quote Link to comment Share on other sites More sharing options...
0 SNMCStrategicSupport Posted February 14, 2017 Report Share Posted February 14, 2017 I'll try that, thank you Quote Link to comment Share on other sites More sharing options...
Question
Aurora
Hi all !
Does anyone has a solution for this?
I need to hide some text on the details page, when AuthField' value is not equal value from the Field#2.
Merci!
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.