Rollbase - auto filling fields when object selected

Posted by araqiel on 01-Jul-2014 04:32

Hi,

For the future versions of Rollbase, could you insert a feature ?

I would like an auto filling fields when an object is selected.

e.g. I have an object City and an other Country.

In Country, there are name of country and country code (like France - FR or United-States - US).

In City, there are name of city, longitude, latitude, related field Country, and related field country code.

Now I filling my City's table. By example, I add Philadelphia. I add United-States, by click-on the search button of related field. When my country selected, I would like the country code whether auto filling by his country code 'US', because, Rollbase auto-fill in live the field by search in Object "United-State".

Thanks

All Replies

Posted by Sven Cuypers on 01-Jul-2014 05:05

Hi,

I think this can already be achieved by adding a trigger. After selecting the country, a trigger can be fired off to look up the country code.

Have you tried this already ?

Thanks,
Sven

Posted by Bill Wood on 01-Jul-2014 05:06

FYI... there is an "Ideas" section in Community where Ideas for Rollbase new features such as this one can be posted.  Other users can see your ideas and vote on ones that appeal to them.  

Ideas can be posted at: https://community.progress.com/businessusers/i/rollbase/default.aspx

The root page for all Ideas is here.

Posted by araqiel on 01-Jul-2014 05:12

Hi,

Yes by triggers it's possible. But the triggers execute after clink-on the Save button. I would like this operations run just after selecting the country.

Thanks.

Posted by araqiel on 01-Jul-2014 05:13

Sorry Bill,

I wasn' t aware of this section.

Posted by Bill Wood on 01-Jul-2014 05:29

Not a problem.  Probably other people are unaware of the section as well.   I was using your post as a chance to remind everyone.

Posted by Godfrey Sorita on 01-Jul-2014 08:52

Hi,


This feature is already possible in Rollbase using field events and client-side APIs. For more information on this topic, please refer to chapter 7 of Rollbase in Action. Below is the link to the latest version of the documentation:

https://www.rollbase.com/download/Rollbase_in_Action.pdf

Regards,

Godfrey

Posted by araqiel on 02-Jul-2014 02:39

Thanks for your replies !

Posted by araqiel on 03-Jul-2014 05:24

I read the Chapter 7, but not work.

I have a Contact object. With first name, last name fields and related object Company.

I would like auto fill the email field. Composed by "firstName.lastName@company.com".


On my page,  I add Javascript, but not working.

<script>
function setEmail() {

if ($("#nom").val().length > 0 && $("#prenom").val().length > 0) {
        $("#email").val($("#prenom").val().toLowerCase() + '.' + $("#nom").val().toLowerCase() + "@");
    }
    
if ($("#email").val() == ".") {
    $("#email").val("");
}    
}

//select company
function my_callback(relName, objId, values) {

    alert(relName + '-' + objId + '-' + values);
}

function getSociete() {
    rbf_getRelatedFields("R11603", id, "name", my_callback);
}
</script>

Thanks and Regards,

Posted by Godfrey Sorita on 03-Jul-2014 08:58

Have you tried binding the getSociete() function to the onchange event of the field? You may do this by navigating to the events window of the lookup field.

Also, I recommend you to use Google Chrome as your browser in debugging client-side codes. Once installed, you may press F12 to enable the developer tools. The console tab should display any error in your script.

Posted by araqiel on 03-Jul-2014 09:32

Yes,

getSociete() function is already on the event field. And chrome is my default web browser. But when I'm in debugging mode, the callback function not called.

Posted by Godfrey Sorita on 03-Jul-2014 10:00

I noticed an error in the script you made. The variable id is not defined. A record id needs to be assigned to this variable for your script to work.

Kindly replace your function with the code below and see if it works:

function getSociete() {

   var id = rbf_getFieldValue("R11603");

   rbf_selectValue("SELECT name FROM your_object WHERE id="+ id, my_callback);

}

Important: Replace your_object with the integration name of the object you are trying to query.

Posted by araqiel on 04-Jul-2014 01:43

Hi,

Thanks Godfrey. It's work !

I told myself, the variable id isn't defined.

Posted by ornhill on 04-Feb-2015 20:18


On 03 Jul 2014, at 16:33, araqiel <bounce-araqiel@community.progress.com> wrote:

Reply by araqiel

Yes,

getSociete() function is already on the event field. And chrome is my default web browser. But when I'm in debugging mode, the callback function not called.

Stop receiving emails on this subject.

Flag this post as spam/abuse.


This thread is closed