• Max Friel.ax1251
  • NEWBIE
  • 75 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 8
    Replies

I have a rich text field that I put a URI in.  I placed it in a PDF attachment in a VF e-mail template.  When I use the Send Test and Verify Merge fields button on the template it works perfectly.  When I try to use this code to send it out...

List<Messaging.SingleEmailMessage> sendMe = new List<Messaging.SingleEmailMessage>();
for(sObject obj : actIn){
	Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
	mail.setSaveAsActivity(false);
	mail.setTargetObjectId('005A0000001eoWs');
	mail.setWhatId((String)obj.get('id'));
	mail.setTemplateID('00XK0000000IDfn');
	sendMe.add(mail);
}
Messaging.sendEmail(sendMe);

 Everything else comes out exactly the same but the image is missing from the PDF.  Any thoughts?  

Here is my code...

 

System.out.println("temp:" + temp);
ByteArrayInputStream bs = new ByteArrayInputStream(temp.getBytes());
try {
	ret.add(bc.createBatchFromStream(job, bs));
} catch (AsyncApiException e) {
	Log.mess("REST", "getBatchInfoFromCSV threw Exception:" + e.toString());
	throw e;
}

 which produces this output:

temp:Id,Value,MasterLabel,Category
"101J0000000CwTJIA0","Your Veeva password is due to expire.

Please log into Veeva Online then go to: Your name (top right) > Setup > My Personal Information > Change My Password.

If you have any difficulties, please call the Lilly IT Service Desk.

Do not reply to this email - the mailbox is not monitored.","LILLY_PASSWORD_RESET_BODY","lilly"
"101J0000000CwTMIA0","Veeva Password Expiration Notice","LILLY_PASSWORD_RESET_SUBJECT","lilly"

 But when I check the label in the environment it looks like this...

Your Veeva password is due to expire. Please log into Veeva Online then go to: Your name (top right) > Setup > My Personal Information > Change My Password. If you have any difficulties, please call the Lilly IT Service Desk. Do not reply to this email - the mailbox is not monitored.

 How can I keep the carriage returns in it?  What am I missing here? 

<apex:page controller="Lilly_Customer_Manager">
<apex:form >
<apex:repeat value="{!$ObjectType.Account.FieldSets.Lilly_Customer_Manage}" var="f"/>
<apex:outputPanel id="pleaseWork">
<apex:repeat value="{!actFldMap}" var="act">
	<apex:pageBlock title="{!$ObjectType[act].label}">
	    <apex:pageBlockButtons >
	    	<apex:commandButton action="{!mySave}" immediate="true" Value="Save" rendered="{!IF(act == 'Account','true','false')}"/>
	        <apex:commandLink action="{!myNew}" immediate="true" rerender="pleaseWork" Value="New {!$ObjectType[act].Label}" rendered="{!IF(act != 'Account','true','false')}">
	        	<apex:param name="str" value="{!act}" assignTo="{!tabButton}"/> 
	        </apex:commandLink>
	    </apex:pageBlockButtons>
	    <apex:repeat value="{!tabIdMap[act]}" var="aciId">
	        <apex:pageBlockSection title="{!aciNameLookup[aciId]}" columns="2" collapsible="true">
	            <apex:repeat value="{!newFields[aciId]}" var="aci">
	               <apex:inputField rendered="{!IF(aci['Type__c'] == 'PICKLIST' || aci['Type__c'] == 'MULTIPICKLIST','false','true')}" label="{!aci['Field_Label__c']}" value="{!aci[fldLookup[aci['Type__c']]]}"/> 
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'PICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plv[aciId + '.' + aci['Field_Name__c']]}" size="1" multiselect="false">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aciId + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           </apex:repeat>
	        </apex:pageBlockSection>
	    </apex:repeat>
	</apex:pageBlock>
	<apex:repeat >
	</apex:repeat>
</apex:repeat>
</apex:outputPanel>
</apex:form>
</apex:page>

I am using this page for a change request system and it works perfectly to display the information in question, however it will not update it.  When I attempt to write it back to the database the original value is store, and the apex debug statement shows the object behind it matches the original value and not the value updated via the form.  Here is the db write statement...

public PageReference mySave(){
		Account_Change_Request__c acr = new Account_Change_Request__c();
		acr.Status__c = 'Submitted';
		if(!actId.equals(''))acr.Account__c = actId;
		Database.SaveResult sr = Database.insert(acr);
		String parId = '';
		if(sr.isSuccess()){
			parId = sr.getId();
			List<Account_Change_Item__c> ins = new List<Account_Change_Item__c>();
			for(String s : newFields.keySet()){
				for(Account_Change_Item__c aci : newFields.get(s)){
					aci.Account_Change_Request__c = parId;
					System.debug('Field:' + aci.Field_Name__c + ' Value:' + aci.get(fldLookup.get(aci.Type__c)));
					ins.add(aci);
				}
			}
			insert ins;
		}else{
			String err = '';
			for(Database.Error e : sr.getErrors()){
				err += '\n' + e.getMessage();
			}
			ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Failed to create object\n' + err));
		}
		PageReference ret = null;
		if(!parId.equals(''))ret = new PageReference('/apex/LILLY_Account_Change_Request?id=' + parId);
		return ret;
	}

 Any idea why when I update the values in the UI, the change is not reflected it the Account_Change_Item__c?

Here is my page...

<apex:page controller="Lilly_Customer_Manager" id="pg">
<apex:form >
<apex:outputText id="outTxt">{!testStr}</apex:outputText>
<apex:repeat value="{!$ObjectType.Account.FieldSets.Lilly_Customer_Manage}" var="f"/>
<apex:repeat value="{!actFldMap}" var="act">
	<apex:pageBlock title="{!$ObjectType[act].label}" >
	    <apex:pageBlockButtons >
	    	<apex:commandButton action="{!mySave}" rerender="pg" Value="Save" rendered="{!IF(act == 'Account','true','false')}"/>
	        <apex:commandLink action="{!myNew}" rerender="pg" Value="New {!$ObjectType[act].Label}" rendered="{!IF(act != 'Account','true','false')}">
	        	<!-- <apex:param name="str" value="{!act}" assignTo="{!tabButton}"/>  -->
	        </apex:commandLink>
	    </apex:pageBlockButtons>
	    <apex:repeat value="{!tabIdMap[act]}" var="aciId">
	        <apex:pageBlockSection title="{!aciNameLookup[aciId]}" columns="2" collapsible="true">
	            <apex:repeat value="{!newFields[aciId]}" var="aci">
	               <apex:inputField rendered="{!IF(aci['Type__c'] == 'PICKLIST' || aci['Type__c'] == 'MULTIPICKLIST','false','true')}" label="{!aci['Field_Label__c']}" value="{!aci[fldLookup[aci['Type__c']]]}"/> 
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'PICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plv[aciId + '.' + aci['Field_Name__c']]}" size="1" multiselect="false">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aciId + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           </apex:repeat>
	        </apex:pageBlockSection>
	    </apex:repeat>
	</apex:pageBlock>
	<apex:repeat >
	</apex:repeat>
</apex:repeat>
</apex:form>
</apex:page>

 And here are the button/link methods...

public PageReference mySave(){
		//System.debug('Save pressed for ' + tabButton);
		testStr = 'bye';
		return null;
	}
	
	public PageReference myNew(){
		System.debug('Save pressed for ' + tabButton);
		makeNew(tabButton);
		testStr = 'bye';
		return null;
	}

 I initialize the value of testStr to hi and would expect it to be changed to bye when I click the button or the link.  Why does it not?  I eventually want to do something much more complicated with this, but wanted to get this simple example working first.  I know I am missing something simple here, any help would be appreciated. 

This code works...

<apex:page controller="Lilly_Customer_Manager">
<apex:form >
<apex:repeat value="{!$ObjectType.Account.FieldSets.Lilly_Customer_Manage}" var="f"/>
<apex:repeat value="{!actFldMap}" var="act">
	<apex:pageBlock title="{!$ObjectType[act].label}" mode="edit">
	    <apex:pageBlockButtons >
	    	<apex:commandButton action="{!mySave}" Value="Save" rendered="{!IF(act == 'Account','true','false')}"/>
	        <apex:commandLink action="{!myNew}" Value="New {!$ObjectType[act].Label}" rendered="{!IF(act != 'Account','true','false')}">
	        	<apex:param name="str" value="{!act}" assignTo="{!tabButton}"/>
	        </apex:commandLink>
	    </apex:pageBlockButtons>
	    <apex:repeat value="{!tabIdMap[act]}" var="aciId">
	        <apex:pageBlockSection title="{!aciNameLookup[aciId]}" columns="2" collapsible="true">
	            <apex:repeat value="{!newFields[aciId]}" var="aci">
	               <apex:inputField rendered="{!IF(aci['Type__c'] == 'PICKLIST' || aci['Type__c'] == 'MULTIPICKLIST','false','true')}" label="{!aci['Field_Label__c']}" value="{!aci[fldLookup[aci['Type__c']]]}"/> 
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'PICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plv[aciId + '.' + aci['Field_Name__c']]}" size="1" multiselect="false">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aciId + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           </apex:repeat>
	        </apex:pageBlockSection>
	    </apex:repeat>
	</apex:pageBlock>
</apex:repeat>

</apex:form>
</apex:page>

 And this code throws the error

Field Account.label does not exist. Check spelling

Error is in expression '{!$ObjectType[act].label}' in component <apex:pageBlock> in page lilly_customer_manager
<apex:page controller="Lilly_Customer_Manager">
<apex:form >

<apex:repeat value="{!actFldMap}" var="act">
	<apex:pageBlock title="{!$ObjectType[act].label}" mode="edit">
	    <apex:pageBlockButtons >
	    	<apex:commandButton action="{!mySave}" Value="Save" rendered="{!IF(act == 'Account','true','false')}"/>
	        <apex:commandLink action="{!myNew}" Value="New {!$ObjectType[act].Label}" rendered="{!IF(act != 'Account','true','false')}">
	        	<apex:param name="str" value="{!act}" assignTo="{!tabButton}"/>
	        </apex:commandLink>
	    </apex:pageBlockButtons>
	    <apex:repeat value="{!tabIdMap[act]}" var="aciId">
	        <apex:pageBlockSection title="{!aciNameLookup[aciId]}" columns="2" collapsible="true">
	            <apex:repeat value="{!newFields[aciId]}" var="aci">
	               <apex:inputField rendered="{!IF(aci['Type__c'] == 'PICKLIST' || aci['Type__c'] == 'MULTIPICKLIST','false','true')}" label="{!aci['Field_Label__c']}" value="{!aci[fldLookup[aci['Type__c']]]}"/> 
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'PICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plv[aciId + '.' + aci['Field_Name__c']]}" size="1" multiselect="false">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aciId + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           </apex:repeat>
	        </apex:pageBlockSection>
	    </apex:repeat>
	</apex:pageBlock>
</apex:repeat>

</apex:form>
</apex:page>

 The only difference is the repeat block, with no code in it running through the fieldset.  Is it the repeat tag with the magical power or the previous call to $ObjectType

I am trying to load multi select picklists for a record however no matter what I seem to do the lists never show up with any of hte selectOptions selected...

 

<apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>

 Where plvMS is a map of String String[].  The String[] have values loaded into them that match the values selectOptions that are given.  I must be missing something incredibly obvious here, thoughts? 

Is it possible to for an apex:inputField element to be editable even if the user viewing the page has read only access to it?  I don't actually want to write the change back to the record, simply want an input field there of the correct type based on the field with the records info already filled in. 

All,

I have this bit of code in my VF...

<apex:repeat value="{!IF(vp,$ObjectType.Call2_vod__c.FieldSets.LILLY_QR_VP_Interaction,IF(team== 'OL',IF(call['RecordTypeId'] == addId,$ObjectType.Call2_vod__c.FieldSets.LILLY_QR_OL_INTERACTION_ADDENDUM,$ObjectType.Call2_vod__c.FieldSets.LILLY_QR_OL_INTERACTION),IF(call['RecordTypeId'] == addId,$ObjectType.Call2_vod__c.FieldSets.LILLY_QR_ML_INTERACTION_ADDENDUM,$ObjectType.Call2_vod__c.FieldSets.LILLY_QR_ML_INTERACTION)))}" var="f"> 
                <tr><td class="label"><apex:outputText value="{!f.label}" /></td>
                <td><apex:outputField value="{!call[f]}" label="{!call[f].label}"/></td></tr>
            </apex:repeat>

 The issue is when I am logged in with a user who does not have access to a field in the fieldSet, that field still gets displayed.  Is that supposed to happen?  How can I prevent it from happening?

All,

I believe I am missing something here.  I have a class that starts out with this...

public with sharing class Lilly_QR_PDF {

 And contains this function...

//Get all the accessible fields for a given object
    public static String getAccessibleFields(String objName){
        String fields = '';        
        Map<String,Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get(objName.toLowerCase()).getDescribe().Fields.getMap();         
        if(fieldMap != null){
            for(Schema.Sobjectfield ft : fieldMap.values()){
                Schema.DescribeFieldResult fd = ft.getDescribe();
                if(fd.isAccessible()){
                    fields = fields + fd.getName() + ',';
                }
            }
            if(fields.length() > 0){
                fields = fields.subString(0,fields.length()-1);
            }else{
                fields = 'id';
            }
        }else{
            System.debug('FieldMap was null');
        }
        return fields;
    }

 As you can see that should only return the fields that come back with isAccessible equal to true. 

When I call the page with this heading...

<apex:page controller="Lilly_QR_PDF" renderAs="PDF" showHeader="false" sidebar="false" standardStyleSheets="false">

 It grabs fields that the user I am currently logged in with does not have access to.  I am sure I am just missing something or misunderstanding some basic security rules here, but I have looked at can not figure out what is going on.  Any help would be appreciated. 

I wanted to prevent test orgs from having their e-mail addresses updated to valid e-mail addresses so e-mails do not get sent out to everyone in the company.  I can do this for an insert no problem, however the issue with an update is when an update to the e-mail address is requested, the confirmation e-mail is sent out and the change is not commited until after the confirmation link is clicked which is when the record is updated in the user table.  So my question is where is that information stored in the meantime, so maybe I can trigger on that or is there a more effective way to write this trigger?

I use this code...

<apex:repeat value="{!IF(vp,$ObjectType.Standing_Request__c.FieldSets.LILLY_QR_VP_SR,IF(team== 'OL',$ObjectType.Standing_Request__c.FieldSets.LILLY_QR_OL_SR,$ObjectType.Standing_Request__c.FieldSets.LILLY_QR_ML_SR))}" var="f">
                        <tr><td class="label"><apex:outputText value="{!f.label}"/></td>
                        <td><apex:outputField value="{!obj[f]}"/></td></tr>
                    </apex:repeat>

 

To generate a table.  Some of the fields I am using have Japanese characters as their names.  If I use the renderAs="PDF" parameter on the page the Japanese characters simply display as a '_'.  If I remove the renderAs="PDF" then it displays properly.  Does anyone know a way to get the characters to properly display with in the PDF?  

Thanks in advance for any help.

 

Regards,

Max

 

All,

I can not figure out how to do this and must be missing something simple.  If I setup a ListMetadataQuery and just set the type to "Report" I get nothing in return.  If I set the folder to null or "" I still get nothing in return.  If I set the Type to "Report" and set the folder to a folder with in the org then I get all the reports from that folder, which is expected.  What I need to know is, is there a way to get a list of folders for reports?  Or is there a way to list all the reports regardless of folder? Thanks in advance for any help. 

 

Regards,

Max

Here is my code...

 

System.out.println("temp:" + temp);
ByteArrayInputStream bs = new ByteArrayInputStream(temp.getBytes());
try {
	ret.add(bc.createBatchFromStream(job, bs));
} catch (AsyncApiException e) {
	Log.mess("REST", "getBatchInfoFromCSV threw Exception:" + e.toString());
	throw e;
}

 which produces this output:

temp:Id,Value,MasterLabel,Category
"101J0000000CwTJIA0","Your Veeva password is due to expire.

Please log into Veeva Online then go to: Your name (top right) > Setup > My Personal Information > Change My Password.

If you have any difficulties, please call the Lilly IT Service Desk.

Do not reply to this email - the mailbox is not monitored.","LILLY_PASSWORD_RESET_BODY","lilly"
"101J0000000CwTMIA0","Veeva Password Expiration Notice","LILLY_PASSWORD_RESET_SUBJECT","lilly"

 But when I check the label in the environment it looks like this...

Your Veeva password is due to expire. Please log into Veeva Online then go to: Your name (top right) > Setup > My Personal Information > Change My Password. If you have any difficulties, please call the Lilly IT Service Desk. Do not reply to this email - the mailbox is not monitored.

 How can I keep the carriage returns in it?  What am I missing here? 

Here is my page...

<apex:page controller="Lilly_Customer_Manager" id="pg">
<apex:form >
<apex:outputText id="outTxt">{!testStr}</apex:outputText>
<apex:repeat value="{!$ObjectType.Account.FieldSets.Lilly_Customer_Manage}" var="f"/>
<apex:repeat value="{!actFldMap}" var="act">
	<apex:pageBlock title="{!$ObjectType[act].label}" >
	    <apex:pageBlockButtons >
	    	<apex:commandButton action="{!mySave}" rerender="pg" Value="Save" rendered="{!IF(act == 'Account','true','false')}"/>
	        <apex:commandLink action="{!myNew}" rerender="pg" Value="New {!$ObjectType[act].Label}" rendered="{!IF(act != 'Account','true','false')}">
	        	<!-- <apex:param name="str" value="{!act}" assignTo="{!tabButton}"/>  -->
	        </apex:commandLink>
	    </apex:pageBlockButtons>
	    <apex:repeat value="{!tabIdMap[act]}" var="aciId">
	        <apex:pageBlockSection title="{!aciNameLookup[aciId]}" columns="2" collapsible="true">
	            <apex:repeat value="{!newFields[aciId]}" var="aci">
	               <apex:inputField rendered="{!IF(aci['Type__c'] == 'PICKLIST' || aci['Type__c'] == 'MULTIPICKLIST','false','true')}" label="{!aci['Field_Label__c']}" value="{!aci[fldLookup[aci['Type__c']]]}"/> 
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'PICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plv[aciId + '.' + aci['Field_Name__c']]}" size="1" multiselect="false">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           	   <apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aciId + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>
	           </apex:repeat>
	        </apex:pageBlockSection>
	    </apex:repeat>
	</apex:pageBlock>
	<apex:repeat >
	</apex:repeat>
</apex:repeat>
</apex:form>
</apex:page>

 And here are the button/link methods...

public PageReference mySave(){
		//System.debug('Save pressed for ' + tabButton);
		testStr = 'bye';
		return null;
	}
	
	public PageReference myNew(){
		System.debug('Save pressed for ' + tabButton);
		makeNew(tabButton);
		testStr = 'bye';
		return null;
	}

 I initialize the value of testStr to hi and would expect it to be changed to bye when I click the button or the link.  Why does it not?  I eventually want to do something much more complicated with this, but wanted to get this simple example working first.  I know I am missing something simple here, any help would be appreciated. 

I am trying to load multi select picklists for a record however no matter what I seem to do the lists never show up with any of hte selectOptions selected...

 

<apex:selectList rendered="{!IF(aci['Type__c'] == 'MULTIPICKLIST','true','false')}" label="{!aci['Field_Label__c']}" value="{!plvMS[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}" size="5" multiselect="true">
	           	   	<apex:selectOptions value="{!plvVals[aci['Object_Name__c'] + '.' + aci['Field_Name__c']]}"/>
	           	   </apex:selectList>

 Where plvMS is a map of String String[].  The String[] have values loaded into them that match the values selectOptions that are given.  I must be missing something incredibly obvious here, thoughts? 

Is it possible to for an apex:inputField element to be editable even if the user viewing the page has read only access to it?  I don't actually want to write the change back to the record, simply want an input field there of the correct type based on the field with the records info already filled in. 

All,

I believe I am missing something here.  I have a class that starts out with this...

public with sharing class Lilly_QR_PDF {

 And contains this function...

//Get all the accessible fields for a given object
    public static String getAccessibleFields(String objName){
        String fields = '';        
        Map<String,Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get(objName.toLowerCase()).getDescribe().Fields.getMap();         
        if(fieldMap != null){
            for(Schema.Sobjectfield ft : fieldMap.values()){
                Schema.DescribeFieldResult fd = ft.getDescribe();
                if(fd.isAccessible()){
                    fields = fields + fd.getName() + ',';
                }
            }
            if(fields.length() > 0){
                fields = fields.subString(0,fields.length()-1);
            }else{
                fields = 'id';
            }
        }else{
            System.debug('FieldMap was null');
        }
        return fields;
    }

 As you can see that should only return the fields that come back with isAccessible equal to true. 

When I call the page with this heading...

<apex:page controller="Lilly_QR_PDF" renderAs="PDF" showHeader="false" sidebar="false" standardStyleSheets="false">

 It grabs fields that the user I am currently logged in with does not have access to.  I am sure I am just missing something or misunderstanding some basic security rules here, but I have looked at can not figure out what is going on.  Any help would be appreciated. 

I use this code...

<apex:repeat value="{!IF(vp,$ObjectType.Standing_Request__c.FieldSets.LILLY_QR_VP_SR,IF(team== 'OL',$ObjectType.Standing_Request__c.FieldSets.LILLY_QR_OL_SR,$ObjectType.Standing_Request__c.FieldSets.LILLY_QR_ML_SR))}" var="f">
                        <tr><td class="label"><apex:outputText value="{!f.label}"/></td>
                        <td><apex:outputField value="{!obj[f]}"/></td></tr>
                    </apex:repeat>

 

To generate a table.  Some of the fields I am using have Japanese characters as their names.  If I use the renderAs="PDF" parameter on the page the Japanese characters simply display as a '_'.  If I remove the renderAs="PDF" then it displays properly.  Does anyone know a way to get the characters to properly display with in the PDF?  

Thanks in advance for any help.

 

Regards,

Max

 

All,

I can not figure out how to retrieve a list of all reports from the metadata API and must be missing something simple.  If I setup a ListMetadataQuery and just set the type to "Report" I get nothing in return.  If I set the folder to null or "" I still get nothing in return.  If I set the Type to "Report" and set the folder to a folder with in the org then I get all the reports from that folder, which is expected.  What I need to know is, is there a way to get a list of folders for reports?  Or is there a way to list all the reports regardless of folder? Thanks in advance for any help.

I guess the easiest way of asking this is for the ListMetadataQuery, does the method setFolder have a wildcard character that will return any result from any folder?  I tried "*" and it didn't work