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
SImmySImmy 

Please help me please with fetching the ID

I want to fetch the Invoice ID whenever the account matches from the map values:
InvoiceTo__c:{Id=a1m3L000000LMk9QAG, OptyAccount_For_reference__c=0017E000017irV8QAI, Name_InvoiceTo__c=0013L000002eawkQAA, Opportunity__c=0067E00000EPYbkQAH, RecordTypeId=0127E000001ikJ9QAI, CurrencyIsoCode=GBP}, InvoiceTo__c:{Id=a1m3L000000LMk9QAG, OptyAccount_For_reference__c=0017E000017irV8QAI, Name_InvoiceTo__c=0013L000002eawkQAA, Opportunity__c=0067E00000EPYbkQAH, RecordTypeId=0127E000001ikJ9QAI, CurrencyIsoCode=GBP})

If my account matches from the map values then it should trim the invoice id of that index. I want to get the invoice id from that index. How to do that please suggest.  Because you can see the opportunity can have multiple invoices, so I thought of using Substring by checking the index but somehow in comse cases it is throwing an exception.