• LeeFranke
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 2
    Replies

During Validate Deployment I get the error:

 

Problem: In field: recipient - no User named santa.clause@northpole.com.sanboxf found

 

Do I have to remove all of the recipients and then migrate the template?

 

thanks,

 

lee

This is NOT on a VF page. This is on a standard layout page.

 

Is it possible (if so how) by using clicks not code, to display the detail data from a lookup field on the parent form?

 

For instance.

 

I have a custom object of locations that I have on a 'shipto' form that displays the 'shipto' object.

 

When the user selects a location on the  shipto form, I would like to populate the street,city, state fields on the form from the locations object.

 

Is it possible to do it dynamically?

 

So without saving the record, everytime a new location is selected the street, city, etc would change.

 

thanks,

 

lee

I would like to recreate this functionality on a form. I'm sure I can do it with a VF page, but I think I might be able to do it without creating a VF page.

 

I have 'Bill Address' data populated on the form. When the user changes the checkbox to true, I would like to populate the 'Ship Address' with the data from the 'Bill Address' fields.

 

 

Is it possible? Can someone point me in the right direction of accomplishing this?

 

thanks,

 

lee

 

 

I have a custom object (Eval_Forecast__c) and some email templates.

 

In a trigger, I would like to send an email using those templates populating the dynamic text of the template. I can get the email to send, but the problem is the dynamic text is not populated.

 

When I set the WhatId (which seems to be what I need to do), I get the error:

 

SendEmail failed. First exception on row 0; first error: INVALID_ID_FIELD, WhatId is not available for sending emails to UserIds.

 

 

Here is the Apex code:

 

Messaging.SingleEmailMessage emailOut = new Messaging.SingleEmailMessage(); if(forecast.Stage__c =='Submitted to Sales Operations') { emailOut.setTemplateId('00XQ0000000QCUo'); } if(forecast.Stage__c =='Sales Order Released') { emailOut.setTemplateId('00XQ0000000QCV3'); } if(forecast.Stage__c =='Closed Cancelled') { emailOut.setTemplateId('00XQ0000000QCV8'); } emailOut.setTargetObjectId(user.Id);

 

Here is a sample of the template code:

 

*** Sales Order Has Been Released *** Eval Forecast Name: {!Eval_Forecast__c.Name} Account Name: {!Eval_Forecast__c.Account_name__c} Sales Order Number: {!Eval_Forecast__c.Sales_Order_Number__c} IMTR Number : {!Eval_Forecast__c.IMTR_Number__c} Note: Your Sales Order has been removed from shipping block and is now elidgible to ship.

 

 thanks,

 

lee

 

 

The Edit button only appears if the action and method is 'editMe' if they are named 'edit' the button no longer appears.

 

I have different page/class with the same edit method, is that the problem? The edit method needs to be uniquely named?

 

Here is the page:

 

<apex:page standardController="Service_Revnue_Forecast__c" extensions="ServiceForecast" title="Service Forecast" showHeader="true" sidebar="true"> <apex:detail relatedList="false" title="true"/> <apex:form > <apex:pageBlock title="Monthly Service Forecasts" id="gridform"> <apex:pageBlockButtons > <apex:commandButton action="{!saveForecasts}" value="Save" rendered="{!EditFlag}" id="SaveForecastButtonhhh" rerender="gridform" status="status"/> <apex:commandButton action="{!cancelEdit}" value="Cancel" rendered="{!EditFlag}" id="CancelForecastButton" rerender="gridform" status="status"/> <apex:commandButton action="{!editMe}" value="Edit" rendered="{!EditFlag == false}" id="EditForecastButton" rerender="gridform" status="status"/> </apex:pageBlockButtons> <apex:outputPanel id="viewTable" rendered="{!EditFlag == false}"> <apex:dataTable value="{!lForecasts}" var="item" id="ForecastTableView" rowClasses="odd,even" styleClass="" rules="rows" width="100%" > <apex:column headervalue="Forecast Name"><apex:outputLink value="/{!item.Id}" target="_self">{!item.name}</apex:outputLink></apex:column> <apex:column headervalue="Forecast"> <apex:outputField id="Forecast_Amount" value="{!item.Forecast__c}"/> </apex:column> <apex:column headervalue="Actual"> <apex:outputField id="Actual_Amount" value="{!item.Actual__c}"/> </apex:column> <apex:column headervalue="Comments"> <apex:outputText id="Comments" value="{!item.Comments__c}"/> </apex:column> <apex:column headervalue="Date" value="{!item.Date__c}"/> </apex:dataTable> </apex:outputPanel> <apex:outputPanel id="editTable" rendered="{!EditFlag}"> <apex:dataTable value="{!lForecasts}" var="item" id="ForecastTableEdit" rowClasses="odd,even" styleClass="" rules="rows" width="100%" > <apex:column headervalue="Forecast Name"> <apex:inputField id="Name" value="{!item.Name}"/> </apex:column> <apex:column headervalue="Bkgs Fcst Amt"> <apex:inputField id="Forecast_Amount" value="{!item.Forecast__c}"/> </apex:column> <apex:column headervalue="Comments"> <apex:inputText id="Comments" value="{!item.Comments__c}"/> </apex:column> </apex:dataTable> </apex:outputPanel> <apex:actionStatus id="status" startText="Requesting..." stopText="Data Retrieved!"/>&nbsp;{!StatusText} </apex:pageBlock> </apex:form> </apex:page>

 

 Here is the class:

 

public class ServiceForecast { String StatusText; public List<Monthly_Service_Revenue_Forecast__c> lForecasts; public Monthly_Service_Revenue_Forecast__c editForecast {get;set;} Boolean InsertFlag; public Boolean EditFlag {get;set;} private final Service_Revnue_Forecast__c SF; // Constuctor for extending the standard controller public ServiceForecast(ApexPages.StandardController stdController) { this.SF = (Service_Revnue_Forecast__c)stdController.getRecord(); StatusText = ''; lForecasts = ForecastList(); InsertFlag = false; EditFlag=false; } public String getParam(String name) { return ApexPages.currentPage().getParameters().get(name); } // Fill list with Forecasts public List<Monthly_Service_Revenue_Forecast__c> ForecastList(){ List<Monthly_Service_Revenue_Forecast__c> fl; try { fl = [Select c.id, c.Actual__c,c.Forecast__c, c.Date__c,c.Name, c.Comments__c from Monthly_Service_Revenue_Forecast__c c where c.Service_Revenue_Forecast__c = :SF.id]; } catch (QueryException e){ system.debug(e.getMessage()); StatusText = e.getMessage(); } return fl; } // Called from Grid to get List of Forecasts public List<Monthly_Service_Revenue_Forecast__c> getlForecasts () { if (InsertFlag){ lForecasts.add(new Monthly_Service_Revenue_Forecast__c(Service_Revenue_Forecast__c = SF.id)); InsertFlag = false; } return lForecasts; } // Called from Page to pass values from grid to controller public void setlForecasts(List<Monthly_Service_Revenue_Forecast__c> mf) { lForecasts = mf; } // Called from Page to get StatusText public String getStatusText() { return StatusText; } // Called from "Save" Button public PageReference saveForecasts () { try { upsert lForecasts; } catch (DMLException e) { system.debug(e.getMessage()); StatusText = e.getMessage(); } lForecasts = ForecastList(); EditFlag=false; return null; } // Called from "Add" Button public PageReference addForecast () { InsertFlag = true; return null; } public PageReference cancelEdit(){ EditFlag = false; return null; } public PageReference saveEdit() { try { UPDATE editForecast; editForecast = null; } catch (Exception e) { ApexPages.addMessages(e); } return null; } public PageReference editMe() { EditFlag = true; return null; } }

 

 Got it to work, just checking for my own edification.

 

thanks,

 

lee

 

 

Newbie here. Please be gentle :)

 

I'm attempting to display (and then edit) a related list.

 

Error (it says line 0):

 

Save error: Unknown property 'Bookings_Forecast__cStandardController.lForecasts'

 

 Custom Controller:

 

public class ForecastBookingsTest {

String StatusText;
public List<Monthly_Forecast__c> lForecasts;
Boolean InsertFlag;
private final Bookings_Forecast__c BF;

// Constuctor for extending the standard controller
public ForecastBookingsTest(ApexPages.StandardController stdController) {
this.BF = (Bookings_Forecast__c)stdController.getRecord();
StatusText = '';
lForecasts = ForecastList();
InsertFlag = false;
}

// Fill list with Forecasts
public List<Monthly_Forecast__c> ForecastList(){
List<Monthly_Forecast__c> fl;
try {
fl = [Select c.id, c.Bkgs_Fcst_Amt__c, c.Shippable__c, c.Est_Bkgs_Amt__c, c.Left_to_Book__c, c.Comments__c, c.Date__c
from Monthly_Forecast__c c where c.Bookings_Forecast__c = :BF.id];
} catch (QueryException e){
system.debug(e.getMessage());
StatusText = e.getMessage();
}
return fl;
}

// Called from Grid to get List of Forecasts
public List<Monthly_Forecast__c> getForecasts () {
if (InsertFlag){
lForecasts.add(new Monthly_Forecast__c(Bookings_Forecast__c = BF.id));
InsertFlag = false;
}
return lForecasts;
}

// Called from Page to pass values from grid to controller
public void setForecasts(List<Monthly_Forecast__c> mf) {
lForecasts = mf;
}

// Called from Page to get StatusText
public String getStatusText() {
return StatusText;
}

// Called from "Save" Button
public PageReference saveForecasts () {
try {
upsert lForecasts;
} catch (DMLException e) {
system.debug(e.getMessage());
StatusText = e.getMessage();
}
lForecasts = ForecastList();
return null;
}

// Called from "Add" Button
public PageReference addForecast () {
InsertFlag = true;
return null;
}
}

 

 Page:

 

<apex:page standardController="Bookings_Forecast__c" extensions="ForecastBookingsTest" title="Test Bookings Forecast (Lee)" showHeader="true" sidebar="true">
<apex:detail relatedList="false" title="true"/>
<apex:form >
<apex:pageBlock title="Monthly Forecasts" id="gridform">
<apex:pageBlockButtons >
<apex:commandButton action="{!saveForecasts}" value="Save" id="SaveForecastButton" rerender="gridform" status="status"/>
<apex:commandButton action="{!addForecast}" value="New" id="AddForecastButton" rerender="ForecastTable" status="status"/>
</apex:pageBlockButtons>
<apex:dataTable value="{!lForecasts}" var="item" id="ForecastTable" rowClasses="odd,even" styleClass="" rules="rows" width="100%" columnsWidth="60px">
<apex:column headerValue="Action">
<b><apex:outputLink value="/{!item.id}/e" id="editLink">Edit</apex:outputLink>
|&nbsp;
<apex:outputLink id="delLink" onclick="if ((Modal.confirm && Modal.confirm('Are you sure?')) || (!Modal.confirm && window.confirm('Are you sure?'))) navigateToUrl('/setup/own/deleteredirect.jsp?delID={!item.Id}&retURL=/apex/ForecastBookingsTest?id={!Forecast_Bookings__c.id}');">Del</apex:outputLink></b>
</apex:column>
<apex:column headervalue="Monthly Forecast Name"><apex:outputLink value="/{!item.Id}" target="_self">{!item.name}</apex:outputLink></apex:column>
<apex:column headervalue="Bkgs Fcst Amt" value="{!item.Bkgs_Fcst_Amt__c}"/>
<apex:column value="{!item.Shippable__c}"/>
<apex:column value="{!item.Est_Bkgs_Amt__c}"/>
<apex:column value="{!item.Left_to_Book__c}"/>
<apex:column value="{!item.Comments__c}"/>
<apex:column value="{!item.Date__c}"/>
</apex:dataTable>
<apex:actionStatus id="status" startText="Requesting..." stopText="Data Retrieved!"/>&nbsp;{!StatusText}
</apex:pageBlock>
</apex:form>
</apex:page>

 

I'm sure I'm missing something simple.

 

Thanks,

 

lee

 

 


 

 

 

 

 

I would like to recreate this functionality on a form. I'm sure I can do it with a VF page, but I think I might be able to do it without creating a VF page.

 

I have 'Bill Address' data populated on the form. When the user changes the checkbox to true, I would like to populate the 'Ship Address' with the data from the 'Bill Address' fields.

 

 

Is it possible? Can someone point me in the right direction of accomplishing this?

 

thanks,

 

lee