This topic contains 2 replies, has 0 voices, and was last updated by Infinet Cloud Solutions 8 years, 3 months ago.

  • Author
    Posts
  • #6251

    SooS

    Hi everyone,

    I have suitelet that generate a Form and some fields (one select and one textarea). I am trying to have the rejectreason field changed to displaytype(‘normal’) when we select a specific value [rejected] on the select field.

    Code:
    if ( request.getMethod() == ‘GET’ ){
    var newForm = nlapiCreateForm(‘My Form’);

    var select = newForm.addField(‘custpage_selectfield’,’select’, ‘Approve or Reject here’);
    select.addSelectOption(”,”);
    select.addSelectOption(‘approved’, ‘I approve’);
    select.addSelectOption(‘rejected’, ‘I reject’);
    select.setMandatory(true);

    var rejectreason = newForm.addField(‘custpage_rejectreason’, ‘textarea’, ‘Please enter reject reason if applicable’);
    rejectreason.setDisplayType(‘disabled’);
    }
    this driving me crazy and i am starting wondering if this is possible.?

    PS: I am using suitescript 1.0

    Thank in advance,
    This is a cached copy. Click here to see the original post.

  • #6252

    david.smith

    I can’t remember if this works or not in client scripts but worth a try. Set the client script on your form and then on field change event try this: nlapiGetField(fldnam).setMandatory(true)


    Infinet Cloud Solutions replied on 08/09/2016, 05:35 PM: the above returns SSS_NOT_YET_SUPPORTED, but would be nice if it did.

  • #6253

    Infinet Cloud Solutions

    It is possible to do this via client side workflow but as far as I know there isn’t a supported client side API to do this. I believe the client side workflow generates a script call to nlapiSetFieldMandatory(“custpage_employee”,true) which changes the label to display the * next to the field, but it doesn’t apply business logic to stop the form from being submitted if not completed, so you would need to apply the mandatory business logic in your saveRecord. Usual disclaimer as its not officially supported it could break in future releases although as its got an nlapi prefix it looks more like an undocumented API call to me.

You must be logged in to reply to this topic.