Sending Field values when opening a URL

Posted by IramK on 08-Dec-2014 06:36

Hello,

I am trying to update some field values when trying to open the "New" page of my object. For eg: I have a "Contact" object and I am trying to open the New Contact Page URL from outside of Rollbase using its page ID. I would like to set a default field value (say email address: abc@hello.com) when trying to open the URL. Is there a way I could do this?

For eg: Can we do something like: www.rollbase.com/master/m/main.jsp?pageId=1234&email='abc@hello.com' ... ??

All Replies

Posted by matman on 08-Dec-2014 06:44

You could add a scripts that runs when the "New" page loads, and then use rbf_setFieldValue() to set the value of that particular field.

<script>
	$(function() {
		rbf_setFieldValue(fieldname, value);
	});
</script>

Now you just have to determine what e-mail address you're going to set in the field.

Posted by IramK on 08-Dec-2014 06:47

But how do I specify that in the URL? I am doing this outside of Rollbase and my email address is different every time.

Should I add the script component in the URL? or should I use setFieldValue in the URL?

Posted by matman on 08-Dec-2014 07:02

This would be possible by adding a GET variable to your URL and then reading the GET variables from the URL using a script I could post here if you want.

However, Rollbase doesn't allow users from outside to "just" visit a New page without logging in. Have you taken a look at "Portals"?

If you want I can describe how you could achieve your goal without using portals. But that method only works if you can make sure the user is logged in.

Posted by IramK on 08-Dec-2014 08:01

Yes the user would be logged in to visit a New Page. How can I achieve this without the use of portals using only a URL to get to a New page with the required fields filled up when opening a New Page.

Posted by Gian Torralba on 08-Dec-2014 08:34

Hello,

You need to send the Login URL with the user's credential and password together with the pageID parameter so that when the user clicks on the link, the user will be logged in and then redirected to the page. Here is a similar post explaining how to redirect to a specific page after logging in. https://community.progress.com/.../6227.aspx

You can add another GET parameter e.g(&email=name.com) and then use a script to extract the email parameter and then do a rbf_setFieldValue() when the page is loaded.

Hope this helps.

Thank you,
Gian

Posted by IramK on 08-Dec-2014 09:17

Is it not possible to just do that from a URL rather than accessing the onload function of a page etc? I can open up a page from its ID without any problem but I just cannot get the fields to get updated with a value that I would like to pass into the URL.

Posted by Gian Torralba on 08-Dec-2014 10:04

Hello,

Unfortunately, there is no such function that enables you to update a field while redirecting it to a page in Rollbase. You need to manually create those using Javascript/JQuery and the rbf_setFieldValue() method.

Thank you,
Gian

This thread is closed