You need to sign in to do that
Don't have an account?
JohnDurai
accessing the relationship object field value in apex trigger handler ?
Hi Everyone - I am trying to get the field value of relationhip object and putting in the set though it is not throwing any error but when i try to do system.debug it returns null value. when i tried to do query it returns value. below is my code can some one suggest is my approach is correct or somehwhere i am going wrong?
Set<String> assetCouponCodes = new Set<String>();
set<id>newOrderItemId = new set<id>();
for (Asset asset : newAssetList) {
assetCouponCodes.add(asset.Order_Product__r.DISCOCouponCode__c);
system.debug('assetCouponCodes' +assetCouponCodes);
newOrderItemId.add(asset.Order_Product__r.id);
system.debug('newOrderItemId' +newOrderItemId);
Thanks!
Set<String> assetCouponCodes = new Set<String>();
set<id>newOrderItemId = new set<id>();
for (Asset asset : newAssetList) {
assetCouponCodes.add(asset.Order_Product__r.DISCOCouponCode__c);
system.debug('assetCouponCodes' +assetCouponCodes);
newOrderItemId.add(asset.Order_Product__r.id);
system.debug('newOrderItemId' +newOrderItemId);
Thanks!
Can you please check the newAssetList getting the value for Order_Product__r.DISCOCouponCode__c
Thanks!!