Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Browse screen

johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: Browse screen

Unread post by johan »

Max,

With window.history.go(-1); I return to the browse screen of my form. I need to return to the row of my subform I selected before.

Actualy I have te errase the value in the row of the subform
ScreenShot001.png
Thanks for helping me out.
Johan
You do not have the required permissions to view the files attached to this post.
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Browse screen

Unread post by massiws »

Johan, to erase values in the subform row you may try something like this:
1 - add this function in Custom Code > Javascript of the main form:

Code: Select all

/**
 * Disallow lookup in a subform if one subform field matches a value.
 *
 * This function perform a check in a given text field of a subform:
 *   if the value entered in the field equals a given parameter, 
 *   text and lookup fields are emptied.
 *   
 * @param {string} pLookup      Lookup field name
 * @param {string} pFieldName   Name of the field to inspect
 * @param {string} pValue       Value to check
 */
function stopLookupOnValue(pLookup, pFieldName, pValue) {
  var fieldID = nuGetRow() + pFieldName;
  if ($('#'+fieldID).val() == pValue) {
    alert('Dit boek is niet beschikbaar in deze periode');
    // Erase subform fields
    $('#'+fieldID).val('');
    $('#code'+nuGetRow() + pLookup).val('');
    $('#description'+nuGetRow() + pLookup).val('');
  }
}
2 - in Lookup tab > Javascript field you can call that function:

Code: Select all

stopLookupOnValue('your_lookup_field_name', 'res_actief', '2');
This should works.
Max
johan
Posts: 422
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: Browse screen

Unread post by johan »

Max,

You are fantastic, it works.

Johan
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Browse screen

Unread post by massiws »

Ok!
Locked