• David Binstead
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
I have a Visualforce page with a flow embedded. When the flow finishes I need to pass some flow variables into a new VF page.

When I do, I get the error:

"Invalid Page Redirection The page you attempted to access.....etc"
I've narrowed it down to fields that have spaces or symbols such as a plus sign
i.e phone number:
+49 894 5560519

I am using the function urlEncode, and it is encoding the url as such:
phone number-

PhoneFcmCustomers=%252B49%2B894%2B5560519

Works fine when it's not using special characters. :
        

Here is a section of the code:

PageReference prRef = new PageReference('/apex/NISUpdateAccountContact?');
string test = EncodingUtil.urlEncode(flowITDB_Please_provide_the_phone_number_FCm_customers,'UTF-8');
              prRef.getParameters().put('PhoneFcmCustomers',test);

prRef.setRedirect(false);
return prRef;
I am redirecting a visualforce page with an embedded flow to another page using PageReference on flow finish. I have a name/value pair for an email addresss.
        
I have tried encoding this using EncodingUtil.urlEncode() but it still gives the error. When I check the debug output it appears as :

david_smith%2540thedomain.com

When I comment this line out, it works fine with the other parameters.

Thanks

I'm trying to code a solution to default all Community Chatter group digests'  Frequency to 'Never' for all of our internal users based on profiles so that users do not recieve duplicated chatter digests. I.e one for Internal user and one for Community user.

We currently have a manual process, exporting reports/manipulating in Excel and then importing with demand tools, updating the CollaborationGroup record, after the community user has joined the group.

I can match this with code and run a scheduled apex but I was wondering if anybody knows how to achieve this so that the frequency is set to never when the Community user joins the group.

I've been experimenting with the NetworkMember Object, after setting the 'DefaultGroupNotificationFrequency' to 'N' for a user,  the users joins a group but then the frequency for that group in their email settings is still set to 'Weekly Digests'
Hello,

Trying to move attachments on outbound emails to the matching Task on Cases, however i'm getting the error "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Attachment owner must be the same as the owner of the parent task or event.: [OwnerId]"

My aim is to find the userId of the user who created the task, via ActivityID on the emailMessage object and use this when adding  a new attachment with the task as the owner.

The problem is that I can't find any reference to ActivityID when querying the task. Does anybody know how to related the ActivityID on the emailMessage object to the task. One would assume this would be the task Id but this does not seem to be the case?

Cheers

Code snipped- ------

Map<Id, EmailMessage> eMessage = new Map<Id, EmailMessage>([select id, ActivityId, ReplyToEmailMessageId, ParentId, (select Id from attachments) from EmailMessage where ParentId in:cIds]);
     
          
     
      for (EmailMessage a : eMessage.values()){
       system.debug (a.id);
       msgTest += a.id + ' ';
     
       if (a.attachments != null){
        for(attachment atc: a.attachments){
      attIds.add(atc.Id);
      system.debug ('attchment ID' + atc.Id);
     }
       }//if
      }//for


List<Attachment> attCopies = new List<Attachment>();

List<Attachment> Atts = [select Id, name, body, Parentid from Attachment where Id in:attIds];

for(attachment att: Atts)
{
  if (eMessage.get(att.parentID).ActivityId != null) {
       
   
   attachment copyAtt = new Attachment(name = att.Name, body = att.Body, ParentId = eMessage.get(att.parentID).ActivityId, ownerid = xxxxxx);
   system.debug ('this is the activity ID - attachment will be updated' + eMessage.get(att.parentID).ActivityId + ' for item email ID ' +  eMessage.get(att.parentID).ActivityId);
   
   attCopies.add(copyAtt);
   }   
}




I have a Visualforce page with a flow embedded. When the flow finishes I need to pass some flow variables into a new VF page.

When I do, I get the error:

"Invalid Page Redirection The page you attempted to access.....etc"
I've narrowed it down to fields that have spaces or symbols such as a plus sign
i.e phone number:
+49 894 5560519

I am using the function urlEncode, and it is encoding the url as such:
phone number-

PhoneFcmCustomers=%252B49%2B894%2B5560519

Works fine when it's not using special characters. :
        

Here is a section of the code:

PageReference prRef = new PageReference('/apex/NISUpdateAccountContact?');
string test = EncodingUtil.urlEncode(flowITDB_Please_provide_the_phone_number_FCm_customers,'UTF-8');
              prRef.getParameters().put('PhoneFcmCustomers',test);

prRef.setRedirect(false);
return prRef;
I am redirecting a visualforce page with an embedded flow to another page using PageReference on flow finish. I have a name/value pair for an email addresss.
        
I have tried encoding this using EncodingUtil.urlEncode() but it still gives the error. When I check the debug output it appears as :

david_smith%2540thedomain.com

When I comment this line out, it works fine with the other parameters.

Thanks

I'm trying to code a solution to default all Community Chatter group digests'  Frequency to 'Never' for all of our internal users based on profiles so that users do not recieve duplicated chatter digests. I.e one for Internal user and one for Community user.

We currently have a manual process, exporting reports/manipulating in Excel and then importing with demand tools, updating the CollaborationGroup record, after the community user has joined the group.

I can match this with code and run a scheduled apex but I was wondering if anybody knows how to achieve this so that the frequency is set to never when the Community user joins the group.

I've been experimenting with the NetworkMember Object, after setting the 'DefaultGroupNotificationFrequency' to 'N' for a user,  the users joins a group but then the frequency for that group in their email settings is still set to 'Weekly Digests'