User ID on iframe link

I created a custom module with textboxes,dropdowns,bla bla and an iframe from module builder.
In the defaut link of the iframe i clicked on"generated url" and used some tags from the list.
Also i want to put the current user’s id(or username) inside the link, so it can be passed to the page that will be displayed inside the iframe.
I tried to modify the vardefs.php of the module with no success.

Does anyone has any suggestion on what files to modify?

Update to previous post.
I left the vardefs.php as it was and now i’m trying to achieve this with creating a view. i know that i’m close but something is missing.

I copy-paste the view.detail.php from the lead module to mine. Changed the class name to my custom module.
Should i use predisplay or display function?

I am using global $current_user; and $current_user->id; to retrieve the current id but i can’t push it inside the test_frame url.

The test_frame url should be like this “http;//www..com/test.php?currentid=<current’s user id>”
Also used this “$this->bean->test_frame=‘test_url’” with no lack,

Any help is welcome!

take a look at this post at Sugardeveloper

https://developer.sugarcrm.com/2011/04/22/howto-add-new-variable-parameters-for-the-iframe-sugarfield/

best regards

1 Like

Thank you mikebeck!
I’ll keep that site also for future reference.

Thank you again!

Just to mention that the above solution-link is working fine( tested on 7.6.4).
But the variable you want to pass in Iframe URL will not be visible in dropdown of “insert filed”.
You must write it manually inside the url like this {current_user_id}.

1 Like

Thanks for the extra info, this should be in the How To section you requested that no one has replied yet :frowning:

best regards

@mikebeck I agree with you.
Anyway, I’ll write a detailed post for this “How to” later, just to have this info inside this forum.