• Vivek Pawar
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Here's what I'm trying :-

I've Map<String, Object> results = {Id=10001,Value=7777}, I want a map with {10001=7777} type.

This is what I attempted :-

Map<String,String> TraversedResultMap = new Map<String,String>();
            for (String s : results.KeySet())
            {
                TraversedResultMap.put(String.valueOf((String)results.get(s)),String.valueOf((String)results.get(s)));
            }system.debug('###TRAVERSED RESULT'+TraversedResultMap);
But I'm getting o/p as : {10001=10001,7777=7777}
Any Help would be appreciated

Hi Guys,

I have written a trigger. The objective is if No See on Account is TRUE, Zip code of address appends to Address name and in turn zip code updates to 'nosee'. My trigger is almost working with one small defect that is address name is getting appended to zip numeric value and new value ie, no see. How doI correct it to display only old zip numeric value . Please find code below:

trigger TKD_Update_Address_Zip_Code on Account (after update) {
Set<Id> accountIds = new Set<Id>();
for(Account newAcc: Trigger.new){
    Account oldAcc = Trigger.oldMap.get(newAcc.Id);

    if(oldAcc.TKD_No_See__c != newAcc.TKD_No_See__c && newAcc.TKD_No_See__c == true) {
      accountIds.add(newAcc.Id);  
      system.debug('id'+accountIds);
       }
    }
     List<Address_vod__c> addressAddressLine = [select Zip_vod__c, Name from Address_vod__c where Account_vod__c in :accountIds];
     
     for(Address_vod__c AddressLine:addressAddressLine){
     
        AddressLine.Name= AddressLine.Name + ',' + AddressLine.Zip_vod__c;        
     }
     
    if(addressAddressLine.isEmpty()== false)
        update addressAddressLine;
    
    List<Address_vod__c> addressZipCodes = [select Zip_vod__c from Address_vod__c where Account_vod__c in :accountIds];
         for(Address_vod__c zip:addressZipCodes){
             
             zip.Zip_vod__c='no_see';
    
     }
     
     if(addressZipCodes.isEmpty()== false)
        update addressZipCodes;
     
}
I want to write a trigger to update stock quantity custom field in product object after orderitem in inserted in order........i mean stock quantity will deducted according to quanity of product selected in order item