Jump to content
  • 1

Question

4 answers to this question

Recommended Posts

  • 0

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!

Share this post


Link to post
Share on other sites
  • 0

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.

Capture.JPG

Edited by SNMCStrategicSupport

Share this post


Link to post
Share on other sites
  • 0
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.

Capture.JPG

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]

Share this post


Link to post
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...