• Darth Plagueis
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hey Everyone... any help is greatly appreciated. Finally reaching out as I can not see what the heck I am doing wrong here.

I am just trying to grab string data from the request URL  - code originally worked fine without the encodingutil class on simple reports - however as reports got more complex with special characters I would recieve the BLOB is not a valid UTF-8 format - so I introduced the base64string and now I am receiving this error.

Help before dreamforce recieve an extra special prize!

Thanks everyone!
Justin

public class CSVexport {
    public static Boolean isTest;
    public static String strEmailAddr;
    public static String strOut;
    public static Boolean restRequested;
    public String strEmail{get;set;}
    public String strRptname{get;set;}
    public static base64string;
   
    void CSVexport () {
        strOut = '';       
        }

   public String getCSVexport() {
        restRequested = System.isFuture() || System.isScheduled();
        executeRpt();
        return strOut;
        }
 
    public void executeRpt() {
        String requestURL;
        requestURL = '/' + strRptname + '?csv=1&exp=1';
        strOut = new PageReference(requestURL).getContent().toString();
        base64string = EncodingUtil.base64Encode(base64string);
        System.debug('CALLING executeRpt:  output= ' + strOut );
    }

}

I've been round-and-round with this one.  All I'm trying to do is create an AccountTeamMember object and then use sforceService.create() to add it.   I can do it if I don't set AccountAccessLevel = "Edit".  If I don't, AccountAccessLevel is set by default to "Read". The problem is, I want AccountAccessLevel to be "Edit".  If I set AccountAccessLevel = "Edit", then when I execute the create() method the following exception is thrown:

 

Unable to create/update fields: AccountAccessLevel. Please check the security settings of this field and verify that it is read/write for your profile.

 

I've tried everything to remedy this situation, including setting the API user to the top role of the company (CEO), making the API user the owner of the account, checking every capability in the API user's profile, and creating account sharing rules.  Nothing makes a difference.  In fact, I can log in as the API user and create AccountTeamMembers with "Edit" access at Salesforce.com-- just not with the API. 

 

Has anyone been able to do this?  Please help.

  • September 29, 2011
  • Like
  • 0