I have an application that has Users and Administrators.
Users may only view details for that user only.
Administrators may view all details of users that they responsible for.
I have a datapage report to print user details.
If the data page report is accessed by an Administrator, I pass a parameter with value '4', for the data page to allow Admin to select users using the Cascading Dropdown. This works perfectly.
I want to use the same data page report even for users to see their details. When a user accesses this data page, I pass a parameter of '7' as initially I wanted to use the on load functionality to also pass the User ID, so that user may only see their details only. The Cascading Dropdown does not allow the on load functionality.
I want to populate the passed user Id parameter to the User Id search field.
On further reading I can do this in the footer with code that looks like the below.
The @P_MB_Role is the parameter to indicate whether an Admin or User is accessing the report.
The MemberContr_MB_SysID is the search field for the User ID with the Cascading Dropdown.
The @P_MB_SysID is the parameter with the User Id
May someone please help on how to code the below correctly, so that the passed parameter @P_MB_SysID value is populated/moved to MemberContr_MB_SysID so that the 'Search' can search on the correct User ID.
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.
Question
Mlothswwa
Hi,
I am new on Caspio.
I have an application that has Users and Administrators.
Users may only view details for that user only.
Administrators may view all details of users that they responsible for.
I have a datapage report to print user details.
If the data page report is accessed by an Administrator, I pass a parameter with value '4', for the data page to allow Admin to select users using the Cascading Dropdown. This works perfectly.
I want to use the same data page report even for users to see their details. When a user accesses this data page, I pass a parameter of '7' as initially I wanted to use the on load functionality to also pass the User ID, so that user may only see their details only. The Cascading Dropdown does not allow the on load functionality.
I want to populate the passed user Id parameter to the User Id search field.
On further reading I can do this in the footer with code that looks like the below.
The @P_MB_Role is the parameter to indicate whether an Admin or User is accessing the report.
The MemberContr_MB_SysID is the search field for the User ID with the Cascading Dropdown.
The @P_MB_SysID is the parameter with the User Id
May someone please help on how to code the below correctly, so that the passed parameter @P_MB_SysID value is populated/moved to MemberContr_MB_SysID so that the 'Search' can search on the correct User ID.
<script>
document.addEventListener('BeforeFormSubmit', function(event) {
if ("[@P_MB_Role]" == "7"){
let MemberContr_MB_SysID = [@P_MB_SysID];
})
</script>
Link to comment
Share on other sites
1 answer 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.