This topic contains 2 replies, has 0 voices, and was last updated by Infinet Cloud Solutions 8 years, 3 months ago.
-
AuthorPosts
-
August 9, 2016 at 6:19 am #6251
SooSHi 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. -
August 9, 2016 at 9:23 am #6252
david.smithI 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.
-
August 9, 2016 at 5:36 pm #6253
Infinet Cloud SolutionsIt 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.
-
AuthorPosts
You must be logged in to reply to this topic.