var today_date_str = formatDate(new Date(), g_user_date_format); is not working in UI Builder

SnowShilpi
Tera Contributor

Hi Team,

I am facing one weird issue one of my catalog client script is working as expected in record producer but on ui Builder nothing is happening. Not sure what is the issue can anybody help here. Attaching screen shot below for reference.

SnowShilpi_0-1726213280103.png

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    //Type appropriate comment here, and begin script below

    var chkappliveonprod = g_form.getValue('is_the_application_currently_live_in_production');

    if (chkappliveonprod == 'Yes') {
       
        var today_date_str =  formatDate(new Date(), g_user_date_format);  
       
        g_form.setMandatory('tentative_go_live_date', false);
        g_form.setValue('temp_date', today_date_str);
        g_form.setValue('tentative_go_live_date', today_date_str);
        g_form.setReadOnly('tentative_go_live_date', true);
    } else if (chkappliveonprod == 'No') {
        g_form.setMandatory('tentative_go_live_date', true);
        g_form.clearValue('tentative_go_live_date');
        g_form.setReadOnly('tentative_go_live_date', false);
    }

}
 
Please help on priority.
 
Regards
Shilpi Sharma
0 REPLIES 0