• MaxFriel
  • NEWBIE
  • 54 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 39
    Replies

All,

I am currently working on an integration project with a third party utility.  I have the connector setup to write any errors with the connection to an object.  The issue that comes up is there are some VF page controllers that have call outs in the contructor to get the needed information to display on the page.  If this call out fails, it attempts to write an error to the error object and gets the error "DML currently not allowed".  I know I could retool the thing to save the error and then call an action on the page to save it, but that would force into having multiple functions to do basically the same thing and have multiple points of maintence going forward.  Just wondering if anyone had a better idea.  

I have a rather large page layout for the Case object.  Towards the bottom I have an embedded VF page that I would like to make a custom button on the Case object that will move down to that page.  I have already put an anchor in the VF page, just wondering if there is a way to link to an anchor from a custom button?  Thanks in advance for any help.  

All,

I posted this question in the VF boards but figured this might be a better place for it.  I am looking for a way to grab a template and enter in the merge fields for it.  In this instance, all templates are based off of case so its relative easy.  The problem is there are certain fields that are available when making a template (Case.OwnerFullName) that do not actually exist on the object.  I am aware they all link to an actual field, for instance Case.OwnerFullName is really just Case.Owner.Name.  I would prefer not to have to go and manually code in substitutions for this.  Is there a better way?  

All,

I am working on a VF page where a user can select an e-mail template, potentially edit the content of the template and then send the e-mail.  To accomplish this I am looking up the template via Apex, grabbing the html body and dropping in a textArea with richtext set to true.  I have 90% of this up and running perfectly the only issue I have is when trying to substitute in merged fields.  I have a lookup mechanism in place to grab the value for merged fields, however there are fields available in the template editor such as {!Case.OwnerFullName} that do not exist on the object itself.  I am aware I can get this field by grabbing the field Owner.Name on the case, however I would like to avoid hardcoding in a bunch of substitutions.  Is there an easier way to do this?  Am I completely missing something here?  

All,

I am hoping there is something dumb I am missing here.  This is a sample bit of code that illustrates the problem.  I am trying to look up variable fields based off of custom settings so I have to use the get method on SObject just using a c.Investigations__r.Additional_Medical_Device_Eval_Info__c, won't work.  So my question is why does the following code give an invalid field error and how can I get the value for that field out of the object using the get mehtod?

Complaint__c c = [Select Investigations__r.Additional_Medical_Device_Eval_Info__c FROM Complaint__c Limit 1];
System.debug(c.get('Investigations__r.Additional_Medical_Device_Eval_Info__c'));

 Thanks in advance for any help.  

After an object is created or updated, I want to send out a VF page I made as an attachment.  Here is the trigger I wrote to do this...

 

trigger Medical_Inquiry_After_Upsert on Medical_Inquiry_vod__c (after insert, after update) {

    for(Medical_Inquiry_vod__c mi : Trigger.new){
       MIRFFuture.sendEmail(mi.Name,mi.Id);
    }
}

 And here is the sendEmail function...

global class MIRFFuture{
    
    @future
    public static void sendEmail(String name, String id){
        Messaging.reserveSingleEmailCapacity(1);
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'max.friel@veevasystems.com'};
        mail.setToAddresses(toAddresses);
        mail.setReplyTo('max.friel@veevasystems.com');
        mail.setSenderDisplayName('Max Friel');
        mail.setSubject('Medical Inquiry : ' + name);
        String text = 'Please see attached';
        mail.setPlainTextBody(text);
        mail.setHtmlBody(text);
        Messaging.EmailFileAttachment att = new Messaging.EmailFileAttachment();
        //PageReference pr = new PageReference('/apex/MIRF?id=' + id);
        PageReference pr = Page.MIRF;
        pr.getParameters().put('id',id);
        pr.setRedirect(true);
        att.setBody(pr.getContentAsPDF());
        att.setContentType('application/pdf');
        att.setFileName(name + '.pdf');
        att.setInline(false);
        mail.setFileAttachments(new Messaging.EmailFileAttachment[]{att});
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
    }
    
}

 Everything works pretty much as expect, except when I receive the e-mail the PDF is blank.  

 

Via debug statements I have output the PageReference url, and when I copy that into the browser it brings me to the correct page.  I have also checked the blob size of the getContentAsPDF and it is 794, so there is something there.  Why is my PDF blank?

Alright I have wound up in a situation where I am using a Text(255) field to field in the value parameter of a SelectList in Visualforce.  When the selectList has multiSelect set to false this works perfectly.  When multiSelect is set to true, it writes the value back to the field exactly as expected.  However if there is already a value in the field, it will not show up preselected.  The value is stored as val1;val2;val3 etc... and is in the same format that the selectList wrote it there as.  Can anyone think of a way to get the selectList to preselect the correct values?  Please do not tell me to use inputField along with the correct field type, trust me that is not an option here. 

There is a lot more going on in my VF page and controller but basically I have this iframe in a repeat section...

<apex:iframe >
<apex:actionSupport event="onLoad" action="{!id}">
<apex:param name="firstParam" assignTo="{!plId}" value="{!aciId + '.' + aci['Field_Name__c']}"/>
</apex:actionSupport>
</apex:iframe>

 And this code in the controller...

public String plId {get;set;}

public void id(){
 System.debug('plId:' + plId);
}

 When I load the page, that statement never gets written to the logs.  What I am trying to do here is pass in a parameter for a get method later in the loop so a single get method could return different values.  Is this the best way to do this?  Why isn't it working? 

I have a selectList setup like this...

<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>

 The goal is that I have a dynamic series of selectLists that write back to a map.  Plv is simply a map of string,string.  When I go to display this if there is a value in the map it properly selects it, however when I go to save I get the error "An error occurred when processing your submitted information".  I put a debug line in the first line of my save code in apex and that never gets printed, so it never even makes it to the save statement.  Is what I am trying to do just not possible, thoughts? 

All,

I want to have a set of input fields based off of a fieldSet that I can use to edit a record that has been selected from a drop down.  Here is the code I have...

<apex:selectList value="{!addSel}" multiselect="false" size="1" id="addSelect">
            <apex:selectOptions value="{!addItems}"/>
            <apex:actionSupport event="onchange" 
                      rerender="addBlock"/>
</apex:selectList><p/>

<apex:pageBlock title="Address" id="addBlock" mode="edit">
	<h2>addSel-{!addSel}</h2>
	<apex:variable var="address" value="{!addMap[addSel]}" />
	<h2>Address Name: {!address.Name}</h2>
	<apex:pageBlockSection title="My Content Section" columns="2">
	<apex:repeat value="{!$ObjectType.Address_vod__c.FieldSets.Lilly_Customer_Manage}" var="f">
		   <apex:inputField value="{!addMap[addSel][f]}"/> 
	</apex:repeat>
	</apex:pageBlockSection>
</apex:pageBlock>

 

 

addMap is a Map of id's to Address_vod__c.  The field Name is a part of the Lilly_Customer_Manage fieldset.  When I change the drop down, the variable addSel changes to the correct sfdc Id.  However the name field does not change as well as all the information in the inputFields.  The weird thing is, when I comment out the inputFields the heading in h2 with Name in it, changes as expected.  When I remove the field Name from the fieldSet the information in h2 also changes as expected.  So what am I missing with rerendering fields?  Am I going about this all wrong?

I am looking to build a client a list of all fields along with their descriptions.  I can not find access to the description anywhere in Apex or any other API.  Am I missing something?  Or does it just not exist?

With in a trigger, I would like to flag a warning that does not prevent the DML operation but still notifies the user.  Is this possible at all?  Pretty much exactly like the addError method but still allowing the DML operation. 

All I have a VF page that I insert on a person account that is a rating section.  I want one profile to be able to edit it and another profile only view it.  I have the permissions set for the object it is displaying to read and the fields set to read only, however the profile in the read only group can still update it.  What am I missing?  Do I have to check in the apex if the user has permission to that object? 

All I have some data that has a new line in the value...
"true","iPad","This text is displayed in the call report when the expiration of a sample lot is within a certain number of days defined by .the SAMPLE_LOT_EXP_WARNING_THRESHOLD_vod custom setting.
The {0} placeholder is populated by the expiration date of the sample lo","iPad-SAMPLE_LOT_EXP_WARNING_TEXT-en_US","en_US","SAMPLE_LOT_EXP_WARNING_TEXT","Expires: {0}","Label_vod"
"true","iPad","This text is displayed in the call report when the number of remaining sample lots falls below a threshold defined by .the SAMPLE_LOT_QTY_WARNING_THRESHOLD_vod custom setting.
The {0} placeholder is populated by the current on hand quantity of the sample","iPad-SAMPLE_LOT_QTY_WARNING_TEXT-en_US","en_US","SAMPLE_LOT_QTY_WARNING_TEXT","Remaining: {0}","Label_vod"

Even though the newline is surounded by quotes this causes an error when trying to use the bulk api to upload it.  Does anyone know what I should be using instead of line breaks to make this work?

I wanted to make something that reported how many days a user has left before their password expires.  I found the LastPasswordChangeDate field on the User table.  Now I was just wondering if there was anywhere I could pull down the org's policy on "User passwords expire in" programatically? 

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

All,

I am using the Bulk Data Api to upsert a large number of records.  If one of those records fails I would not like the successful changes commited.  Is there a way to achieve this.  On the BulkConnection I see there is an abortJob method.  If I abort a job after it has already run through a few batchs will be undo the changes that have already been made?  Is there any easier way to do this?  Thanks in advance for any help. 

I am trying to use the bulk data api and keep getting a AsyncApiException kicked back with the excpetion code being Invalid Job and the exceptionMessage = 'Operation cannot be specified'.  What does that even mean?  I have tried this code with upsert/delete/insert/query/update.  I even commented out the ExternalIdFieldName setting when it wasn't an update or insert with no luck.  Any help would be much appreciated.  Here is the code...

            

String url = "https://" + conn.getServer() + ".salesforce.com/services/async/22.0/job";
			ConnectorConfig config = new ConnectorConfig();
			config.setSessionId(sesId);
			config.setRestEndpoint(url);
			config.setTraceMessage(true);
			BulkConnection bc = new BulkConnection(config);
			JobInfo job = new JobInfo();
			job.setObject(table);
			job.setExternalIdFieldName(extId);
			job.setOperation(OperationEnum.upsert);
			job.setContentType(ContentType.CSV);
			job = bc.createJob(job);
			System.out.println(job);

 

I am trying to query using the REST api.  If the result is under 2000 records it works great here is what I use...

https://na10.salesforce.com/services/data/v22.0/query.xml?q=SELECT+id+FROM+Message_vod__c

 

Then I add the session Id to the header and I am good to go.  If the query is over two thousand records the nextRecordsUrl is returned and then I will proceed to call something like this...

https://na10.salesforce.com/services/data/v22.0/query/01gF000000CNh00IAD-2000

 

Problem is that this is now returned via JSON rather than XML.  How do I get that next set of records in XML?  I tried changing the URL to...

https://na10.salesforce.com/services/data/v22.0/query.xml/01gF000000CNh00IAD-2000

with no luck.  Any thoughts?

I am attempting to write something with the metadata API to mimick the validate deployment option of the deploy to server interface in Eclipse.  Does anyone know what exactly Eclipse is calling in the metadata API to test the deployment with out deploying?  Any help would be much appreciated. 

With in a trigger, I would like to flag a warning that does not prevent the DML operation but still notifies the user.  Is this possible at all?  Pretty much exactly like the addError method but still allowing the DML operation. 

All,

I am hoping there is something dumb I am missing here.  This is a sample bit of code that illustrates the problem.  I am trying to look up variable fields based off of custom settings so I have to use the get method on SObject just using a c.Investigations__r.Additional_Medical_Device_Eval_Info__c, won't work.  So my question is why does the following code give an invalid field error and how can I get the value for that field out of the object using the get mehtod?

Complaint__c c = [Select Investigations__r.Additional_Medical_Device_Eval_Info__c FROM Complaint__c Limit 1];
System.debug(c.get('Investigations__r.Additional_Medical_Device_Eval_Info__c'));

 Thanks in advance for any help.  

After an object is created or updated, I want to send out a VF page I made as an attachment.  Here is the trigger I wrote to do this...

 

trigger Medical_Inquiry_After_Upsert on Medical_Inquiry_vod__c (after insert, after update) {

    for(Medical_Inquiry_vod__c mi : Trigger.new){
       MIRFFuture.sendEmail(mi.Name,mi.Id);
    }
}

 And here is the sendEmail function...

global class MIRFFuture{
    
    @future
    public static void sendEmail(String name, String id){
        Messaging.reserveSingleEmailCapacity(1);
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {'max.friel@veevasystems.com'};
        mail.setToAddresses(toAddresses);
        mail.setReplyTo('max.friel@veevasystems.com');
        mail.setSenderDisplayName('Max Friel');
        mail.setSubject('Medical Inquiry : ' + name);
        String text = 'Please see attached';
        mail.setPlainTextBody(text);
        mail.setHtmlBody(text);
        Messaging.EmailFileAttachment att = new Messaging.EmailFileAttachment();
        //PageReference pr = new PageReference('/apex/MIRF?id=' + id);
        PageReference pr = Page.MIRF;
        pr.getParameters().put('id',id);
        pr.setRedirect(true);
        att.setBody(pr.getContentAsPDF());
        att.setContentType('application/pdf');
        att.setFileName(name + '.pdf');
        att.setInline(false);
        mail.setFileAttachments(new Messaging.EmailFileAttachment[]{att});
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
    }
    
}

 Everything works pretty much as expect, except when I receive the e-mail the PDF is blank.  

 

Via debug statements I have output the PageReference url, and when I copy that into the browser it brings me to the correct page.  I have also checked the blob size of the getContentAsPDF and it is 794, so there is something there.  Why is my PDF blank?

Alright I have wound up in a situation where I am using a Text(255) field to field in the value parameter of a SelectList in Visualforce.  When the selectList has multiSelect set to false this works perfectly.  When multiSelect is set to true, it writes the value back to the field exactly as expected.  However if there is already a value in the field, it will not show up preselected.  The value is stored as val1;val2;val3 etc... and is in the same format that the selectList wrote it there as.  Can anyone think of a way to get the selectList to preselect the correct values?  Please do not tell me to use inputField along with the correct field type, trust me that is not an option here. 

I have a selectList setup like this...

<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>

 The goal is that I have a dynamic series of selectLists that write back to a map.  Plv is simply a map of string,string.  When I go to display this if there is a value in the map it properly selects it, however when I go to save I get the error "An error occurred when processing your submitted information".  I put a debug line in the first line of my save code in apex and that never gets printed, so it never even makes it to the save statement.  Is what I am trying to do just not possible, thoughts? 

<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?

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 want to have a set of input fields based off of a fieldSet that I can use to edit a record that has been selected from a drop down.  Here is the code I have...

<apex:selectList value="{!addSel}" multiselect="false" size="1" id="addSelect">
            <apex:selectOptions value="{!addItems}"/>
            <apex:actionSupport event="onchange" 
                      rerender="addBlock"/>
</apex:selectList><p/>

<apex:pageBlock title="Address" id="addBlock" mode="edit">
	<h2>addSel-{!addSel}</h2>
	<apex:variable var="address" value="{!addMap[addSel]}" />
	<h2>Address Name: {!address.Name}</h2>
	<apex:pageBlockSection title="My Content Section" columns="2">
	<apex:repeat value="{!$ObjectType.Address_vod__c.FieldSets.Lilly_Customer_Manage}" var="f">
		   <apex:inputField value="{!addMap[addSel][f]}"/> 
	</apex:repeat>
	</apex:pageBlockSection>
</apex:pageBlock>

 

 

addMap is a Map of id's to Address_vod__c.  The field Name is a part of the Lilly_Customer_Manage fieldset.  When I change the drop down, the variable addSel changes to the correct sfdc Id.  However the name field does not change as well as all the information in the inputFields.  The weird thing is, when I comment out the inputFields the heading in h2 with Name in it, changes as expected.  When I remove the field Name from the fieldSet the information in h2 also changes as expected.  So what am I missing with rerendering fields?  Am I going about this all wrong?

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

All,

I am using the Bulk Data Api to upsert a large number of records.  If one of those records fails I would not like the successful changes commited.  Is there a way to achieve this.  On the BulkConnection I see there is an abortJob method.  If I abort a job after it has already run through a few batchs will be undo the changes that have already been made?  Is there any easier way to do this?  Thanks in advance for any help. 

I am trying to use the bulk data api and keep getting a AsyncApiException kicked back with the excpetion code being Invalid Job and the exceptionMessage = 'Operation cannot be specified'.  What does that even mean?  I have tried this code with upsert/delete/insert/query/update.  I even commented out the ExternalIdFieldName setting when it wasn't an update or insert with no luck.  Any help would be much appreciated.  Here is the code...

            

String url = "https://" + conn.getServer() + ".salesforce.com/services/async/22.0/job";
			ConnectorConfig config = new ConnectorConfig();
			config.setSessionId(sesId);
			config.setRestEndpoint(url);
			config.setTraceMessage(true);
			BulkConnection bc = new BulkConnection(config);
			JobInfo job = new JobInfo();
			job.setObject(table);
			job.setExternalIdFieldName(extId);
			job.setOperation(OperationEnum.upsert);
			job.setContentType(ContentType.CSV);
			job = bc.createJob(job);
			System.out.println(job);

 

I am trying to query using the REST api.  If the result is under 2000 records it works great here is what I use...

https://na10.salesforce.com/services/data/v22.0/query.xml?q=SELECT+id+FROM+Message_vod__c

 

Then I add the session Id to the header and I am good to go.  If the query is over two thousand records the nextRecordsUrl is returned and then I will proceed to call something like this...

https://na10.salesforce.com/services/data/v22.0/query/01gF000000CNh00IAD-2000

 

Problem is that this is now returned via JSON rather than XML.  How do I get that next set of records in XML?  I tried changing the URL to...

https://na10.salesforce.com/services/data/v22.0/query.xml/01gF000000CNh00IAD-2000

with no luck.  Any thoughts?

Hi,

 

We are using Custom Labels for the translation of our application. In Apex Code, the method getLabel() retrieve the value of a given label in the language of the user. For example to retrieve the value of custom label we use: 

 

Schema.DescribeFieldResult F = Quote__c.Quote_Comment__c.getDescribe();

F.getLabel();

 

This getLabel() method returns the text label in the language of the user. However, we would like to get it in other languages. 

 

Let's illustrate this with an example. We've built a multi-langual quote engine (that can print quote in pdf thanks to a Visualforce page). As of now the Quoteis generated in the language of the user. However, we would like the user to be able to manually select in which language the Quote needs to be printed.

Therefore we need to be able to retrieve all CustomLabels translation in the Apex Code controller of the page to display thefields in the correct language (as chosen by the user).

 

It does not seem possible to do something like getLabel('Spanish') to retrieve the label translated in Spanish. Does anyone can confirm Apex Code do not support such a functionality? 

 

Thanks a lot in advance, 

 

Alexandre 

Message Edited by a_pitsaer on 08-31-2009 06:30 AM
Message Edited by a_pitsaer on 08-31-2009 06:31 AM
Message Edited by a_pitsaer on 08-31-2009 09:04 AM

Is it possible to read the Mail Merge template through Apex and populate with SF custom object data?

Code samples will be a great help.