function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Joe MaurasJoe Mauras 

Convert NULL to Empty String

Hello everyone,
I have a Trigger that simply concatenates fields in an object. However if any of the fields are blank it returns NULL. I would like it to return nothing. I tried a couple things with no luck. Any help would be appreciated. Thanks. 

EXAMPLE:
 User-added image
if ( obj.Item_Description_Code__c == 'ORAS' ){
obj.Item_Description__c = obj.Default_Product_Group_Value__c + '-' + obj.Subcategory_Group_Code__c + ' ' + obj.O_ring_Size_Value__c + ' ' + obj.Material_Family_Value__c + ' ' + obj.Compound_Name_Value__c;
obj.Extended_Description__c = obj.Product_Group_Value__c + ' ' + obj.Subcategory_Group_Value__c + '\n' +
obj.Material_Family_Value__c + ' ' + obj.Durometer__c + ' ' + obj.Color__c + obj.REACH_RoHS_Value__c + obj.Spec_Formula_Value__c + '\n' +
obj.Nominal_ID_Value__c + '"ID x ' + obj.Nominal_CS_Value__c + '"CS Nom. (' + obj.ID__c + '"ID x ' + obj.CS__c + '"CS)' + '\n' +
'Tolerances: AS-568';
        }


 
MagulanDuraipandianMagulanDuraipandian
For each, try like below
( obj.Default_Product_Group_Value__c != null ? obj.Default_Product_Group_Value__c : '' )
--
Magulan Duraipandian
www.infallibletechie.com