You need to sign in to do that
Don't have an account?
Trying to get grp id but not working
I am trying to run the following code in system log.
gives me errors. Any idea
public String getGroupId(string conId)
{
Map<Id,Subscription_Group_Subscription__c> subMap=new Map<Id,Subscription_Group_Subscription__c>();
String grpId='';
for(Subscription_Group_Subscription__c g : [select Id, Subscription__c, Subscription_Group__c from
Subscription_Group_Subscription__c where Subscription__c=:subId])
{
subMap.put
(g.Subscription__c,g);
System.Debug('subMap'+subMap);
}
for(Subscription_Member__c a : [select Id, Name, Subscription__c, Email__c, Contact__c, Subscribed__c, Subscription_Opt_Out_Date__c from Subscription_Member__c where Contact__c=:conId
LIMIT 1])
{
grpId=subMap.get(a.Subscription__c).Subscription_Group__c ;
System.Debug('grpId'+grpId);
}
return grpId;
}
If you can post the error we may be able to help.