• ShaneMcLaughlin
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have developed a code that pulls records into a custom object from a specified directory that has been setup so our clients can view training videos we have hosted on a server outside of salesforce. The code works as it should (it deletes all records and then compiles all of the records in memory and when it completes its search inserts a new copy of each record), but it pulls in every file located in the subfolders and not just the video files i want.
This is my first time working with coding so am asking for assistance in how to write a line to include only .mp4, .swf, .html as the file types that are pulled. The code is based off of one we created to pull in document records the same way.



// Remove existing Training Video records which will remove Training Video Records records
        delete [SELECT Id FROM Training_Video__c] ;

        videoRecordsToCreate = new List<Training_Video_Record__c>();
        trainingVideosToCreate = new List<Training_Video__c>();

        // Interate through the file to build records   
        for (Integer i=1;i<fileLines.size();i++) {

            system.debug('Looping through fileLines: ' + i + ' Length: ' + fileLines[i].length() + ' ' + fileLines[i]);

            // Nothing to see here, move along
            if (fileLines[i].contains('Directory of') != true){continue;}

            // Find and Training Video Category
            String[] inputValues = new String[]{};
            inputValues = fileLines[i].split('\\\\');
           
            // Look for Sub Directory and Get Training Video Directory and Training Video Records
            if (inputValues.size()==3) {               

                system.debug('Found two path qualifiers in fileLines: ' + i + ' ' + fileLines[i]);            
                   
                Training_Video__c tv = new Training_Video__c();
                tv.Name = inputValues[2]; //<--Workflow rules will change the name
                insert tv;                  

                // Read File Names and Create Video Records
                eoFiles = false;
                i = i+4;
                while (eoFiles != true) {                               

                    // Check for end of Files
                    if (fileLines[i].contains('File(s)') == true) {
                        eoFiles = true;
                        continue;
                        }
                     
                    if (fileLines[i].substring(31).length() > 0) {

                        system.debug('fileLines: ' + i +' ' + fileLines[i]);
              
                        Training_Video_Record__c vr = new Training_Video_Record__c();
               
                        vr.Name = fileLines[i].substring(40);
                        vr.Video__c = tv.Id;
                        videoRecordsToCreate.add(vr);
               
                        }

I need to share an encrypted bit of data through our partner portal.  On all our internal profiles, there's a box to check for "view encrypted data"

 

Doesn't exist for partner profiles.

 

How do I share the data with them?  How can I unencrypt it using apex so that I can share with them?

I've got a force.com site linked to a customer portal for authentication.  With this, we are using a custom domain.

 

Once I login to the site, it takes me to a secure page [ourcustomdomain]/[HomePageName].  No problem there.

 

From then on, no matter what page I go to, the URL in the address bar never changes.  Google Analytics (real-time), however, can see which page I'm on.

 

Biggest problem is when the user hits Refresh in the browser and it loads the home page (since that's what's in the browser bar) rather than the page they were actually on.

 

Interestingly, if I go to ourSFdomain.force.com, all the URLs behave as expected.  Why would the URL not change on the custom domain?

I have developed a code that pulls records into a custom object from a specified directory that has been setup so our clients can view training videos we have hosted on a server outside of salesforce. The code works as it should (it deletes all records and then compiles all of the records in memory and when it completes its search inserts a new copy of each record), but it pulls in every file located in the subfolders and not just the video files i want.
This is my first time working with coding so am asking for assistance in how to write a line to include only .mp4, .swf, .html as the file types that are pulled. The code is based off of one we created to pull in document records the same way.



// Remove existing Training Video records which will remove Training Video Records records
        delete [SELECT Id FROM Training_Video__c] ;

        videoRecordsToCreate = new List<Training_Video_Record__c>();
        trainingVideosToCreate = new List<Training_Video__c>();

        // Interate through the file to build records   
        for (Integer i=1;i<fileLines.size();i++) {

            system.debug('Looping through fileLines: ' + i + ' Length: ' + fileLines[i].length() + ' ' + fileLines[i]);

            // Nothing to see here, move along
            if (fileLines[i].contains('Directory of') != true){continue;}

            // Find and Training Video Category
            String[] inputValues = new String[]{};
            inputValues = fileLines[i].split('\\\\');
           
            // Look for Sub Directory and Get Training Video Directory and Training Video Records
            if (inputValues.size()==3) {               

                system.debug('Found two path qualifiers in fileLines: ' + i + ' ' + fileLines[i]);            
                   
                Training_Video__c tv = new Training_Video__c();
                tv.Name = inputValues[2]; //<--Workflow rules will change the name
                insert tv;                  

                // Read File Names and Create Video Records
                eoFiles = false;
                i = i+4;
                while (eoFiles != true) {                               

                    // Check for end of Files
                    if (fileLines[i].contains('File(s)') == true) {
                        eoFiles = true;
                        continue;
                        }
                     
                    if (fileLines[i].substring(31).length() > 0) {

                        system.debug('fileLines: ' + i +' ' + fileLines[i]);
              
                        Training_Video_Record__c vr = new Training_Video_Record__c();
               
                        vr.Name = fileLines[i].substring(40);
                        vr.Video__c = tv.Id;
                        videoRecordsToCreate.add(vr);
               
                        }

Hi All,

 

Fired up Salesforce this morning to resume work on a VF page I've been working on. After opening the fairly large controller class in the Dev console and trying to save changes I get a modal window popup that states "STRING_TO_LONG Failed to create createContainerMember for containerId=XXXXXX: Body: data value too large". The class is 1362 lines long (not too uncommon). Anyone else receiving this error? I was not getting this error on Friday when I left for the weekend.

 

Thanks in advance!

  • January 14, 2013
  • Like
  • 0