You need to sign in to do that
Don't have an account?

How to pass the Auto Number field on MAX aggregate to fetch the latest Transaction
Hi All,
How to pass the Auto_Number field on MAX aggregate to fetch the latest Transaction, hence by passing ID we are not getting latest Transaction, so, I'm trying with MAX(auto_num) as name of transaction, while trying this getting error on AfterUpdate trigger Issues.
please help me on how to convert Auto_Num to ID.
here is the logic..................
AggregateResult[] aggtransold = [SELECT MAX(Id) newestTransactionOnBond
FROM Transaction__c
WHERE Bond_ID__c IN :bondids
AND Issued__c = true
GROUP BY Bond_ID__c];
for (AggregateResult agg : aggtransold) {
System.debug('BTH: CloneTransactionSchedules: OLD TRANSACTION ' + agg.get('newestTransactionOnBond'));
setoldtransids.add((String)agg.get('newestTransactionOnBond'));
}
.......................
With Regards,
Bheem
How to pass the Auto_Number field on MAX aggregate to fetch the latest Transaction, hence by passing ID we are not getting latest Transaction, so, I'm trying with MAX(auto_num) as name of transaction, while trying this getting error on AfterUpdate trigger Issues.
please help me on how to convert Auto_Num to ID.
here is the logic..................
AggregateResult[] aggtransold = [SELECT MAX(Id) newestTransactionOnBond
FROM Transaction__c
WHERE Bond_ID__c IN :bondids
AND Issued__c = true
GROUP BY Bond_ID__c];
for (AggregateResult agg : aggtransold) {
System.debug('BTH: CloneTransactionSchedules: OLD TRANSACTION ' + agg.get('newestTransactionOnBond'));
setoldtransids.add((String)agg.get('newestTransactionOnBond'));
}
.......................
With Regards,
Bheem