You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to clear the field in the VBS defaulting rule in JS code?

edited Jul 2, 2026 1:49PM in Visual Builder Studio for HCM 2 comments

Summary:

How to clear the field in the VBS defaulting rule in JS code?

Content (please ensure you mask any confidential information):

Hi experts,

I am trying to migrate the autocomplete field modification rules to VBS. This is extremely challenging. I would say mostly impossible.

I would suggest sharing the experience on this.

I am faced with the following issues and have questions to ask:

  1. How is it possible to clear a field value in the advanced expression of the defaulting rule

Below is the code:

/* eslint-disable dot-notation */
define([], () => {
  'use strict';

  /**
   * Default value expression for employmentAssignments.assignmentsDFF.iPayBuChar
   * @param {object} context
   * @return {string}
   */
  function getEmploymentAssignmentsAssignmentsDFFIPayBuChar(context) {
    const { $fields } = context;

    const l4 =
      $fields.employmentAssignments.departmentsLov.departmentsDFF.l4.$value();
    const dc =
      $fields.employmentAssignments.departmentsLov.departmentsDFF.iDepartmentCode.$value();
    const legalEntity =
      $fields.employmentAssignments.legalEntitiesLov.Name.$value();
    console.log('DEFAULTING start...');
    console.log('Legal Entity:', legalEntity);
    console.log('L4:', l4);
 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!