The CreatorCon Call for Content is officially open! Get started here.

Set the field value based on other 2 variables

Aswin Chandras1
Tera Contributor

Hi,

 

I have 2 fields in a catalog item called From Stockroom and To stockroom which refers to stockroom table.

Based on the selection From and To location will be populated in the catalog item.

I need to set the field Shipping required to true in the catalog item based on the value chosen based on the below conditions.

1. If Location is different then I need to set the shipping required to Yes. 

2. from Stockroom.Location.Location Type='Building' && To Stockroom.Location.Location Type=='Building then set shipping required to Yes.

3. from Stockroom.Location.Location.sysid!=ToStockroom.Location.Location.sysid

 

Else need to set the shipping required to No in the field

 

Have already written the script include which return the location and building as below:

 

getStockroomLocationBuildingAddressAjax: function() {

        var stockroom = this.getParameter('sysparm_stockroom');
       
        var stockroomLocation = new x_mosti_gs_hardwar.GSHardwareAssetManagementUtil().getStockroomLocation(stockroom);
        var stockroomBuildingLocationSysID = new x_mosti_gs_hardwar.GSHardwareAssetManagementUtil().getLocationBuilding(stockroomLocation).getValue('sys_id');
        var buildingAddress = new x_mosti_gs_hardwar.GSHardwareAssetManagementUtil()._getAddressFromLocation(stockroomBuildingLocationSysID, "\n");

 

Need help on writing the client script.

 

 

0 REPLIES 0