• hkp716
  • NEWBIE
  • 50 Points
  • Member since 2012

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

Hey Everyone,

 

I have a VF page that sends an email of a table to whomever email address is entered in a text field.  The user has permissions to View, Create, Edit, and Delete for all objects in the table.  The user also has the send email permission checked.  After inputting an email address and clicking send a confirmation message should show up on the VF page.  This works fine when I do it as a syst admin but if i login as another user and hit send I get a rdr to Insufficient Privileges error but the email send anyway.  Any ideas what the problem is?

 

-hkp716

  • January 18, 2013
  • Like
  • 0

Hi everyone,

 

I can retrieve any records with this query.  It is an issure with the Date format.  Is lastmodifieddate a date or datetime?  If i remove the LastModifiedDate >=:d AND LastModifiedDate <=:c filter the query works just fine.

 

 

Date d = system.Today().addDays(-3);
Date c = system.Today().addDays(-5);

//collect a list of records
//
List<Lead> setfollow = [SELECT Id, OwnerID, status FROM Lead WHERE LastModifiedDate >=:d AND LastModifiedDate <=:c AND Map_Record_Type__c = 'Contract/Direct Customer' AND IsConverted = FALSE AND status IN('Qualified', 'Prospecting')];

 

Im trying to get a list of leads that havent been modified in 4 days.

 

I already tried:

Date d = system.Today().addDays(-4) 

and bind it with the query but nothing shows up.

 

Any ideas?

 

-hkp716

  • December 14, 2012
  • Like
  • 0

Hi everyone,

 

I cant get my scheduled aplex class to assign a task to the lead.  How do i check if my list, setfollow, is populating with any lead records?  And am I using the proper syntax to insert a task and assign to the lead owner?

 

The scheduler works fine and i see the job in monitoring.

 

-hkp716

 

Apex Class:

 

global class leadfollowup30daystest2 implements Schedulable{

global void execute(SchedulableContext sc)
{
leadfollowup30daystest2 q = new leadfollowup30daystest2();
        String sch = '0 25 16 * * ?';
        system.schedule('30 day lead followup test2', sch, q);
}
public static Date todayMinusThirty = system.Today().addDays(-2);


public static void updateLeads ()
{


//collect a list of records

List<Lead> setfollow = [SELECT Id FROM Lead WHERE (LastActivityDate = :todayMinusThirty OR LastActivityDate = NULL) AND LastModifiedDate = :todayMinusThirty AND ISconverted = FALSE AND Map_Record_Type__c = 'Contract_DirectCustomer' AND (status = 'Working ASM' OR status = 'Contacted' OR status = 'Prospecting' OR status = 'Qualified' OR status = 'Proposal' OR status = 'Negotiation' OR status = 'Sent to ABD' OR status = 'Working Lead Specialist')];

for (Lead ld :setfollow)
{
    Task t = new Task();
    t.Subject = 'Needs Follow up - No Activity in 30 dayss';
    t.Status = 'Not Started';
    t.Priority = 'Normal';
    t.ActivityDate = Date.Today()+7;
    t.OwnerID = ld.OwnerID;
    
   insert t;
}


}
}

  • December 12, 2012
  • Like
  • 0

Hi everyone,

 

I have a couple of question. How do i get my scheluded apex job to show up in monitoring?  How can i add picklist values from status in my String checkLead?  if i add status = 'open', 'closed' at the end the string breaks because im adding  '.  

 

 

-hkp716

 

apex class:

 

global class leadfollowup30day implements Schedulable{

global void execute(SchedulableContext sc)
{
leadfollowup30day t = new leadfollowup30day();
        String sch = '0 0 11 * * ?';
        system.schedule('30 day lead followup', sch, t);
}
public static Date todayMinusThirty = system.Today().addDays(-30);


public static String checkLead = 'select Id, status, LastModifiedDate from Lead WHERE (LastActivityDate = :todayMinusThirty OR LastActivityDate = NULL) AND LastModifiedDate = :todayMinusThirty';


public static void updateLeads ()
{

//system.debug('\n\n30 checkLead ' + checkLead);
//collect a list of records

List <Lead> setfollow = Database.query(checkLead);

for (Lead ld :setfollow)
{
    Task t = new Task();
    t.Subject = 'Needs Follow up - No Activity in 30 days';
    t.OwnerID = ld.OwnerID;
}


}
}

  • December 11, 2012
  • Like
  • 0

This workflow should fire after 2 days.  Its been 2 days and hasnt worked yet.  Anyone see any errors i may have overlooked?

 

AND(Ceiling(Today() - LastActivityDate ) = 2,Ceiling(Today() - DateValue(LastModifiedDate)) = 2, $RecordType.Name ='Contract/Direct Customer', IsConverted =FALSE, OR(ISPICKVAL(Status,'Working ASM'),ISPICKVAL(Status,'Contacted'),ISPICKVAL(Status,'Prospecting'),ISPICKVAL(Status,'Qualified'),ISPICKVAL(Status,'Propoal'),ISPICKVAL(Status,'Negotiation'),ISPICKVAL(Status,'Sent to ABD')))

 

-hkp716

  • December 06, 2012
  • Like
  • 0

Hey Everyone,

 

Im having issues rerendering fields based on which select option i choose.  The outputfields populate just fine when i add new options to the selectlist, but when I click on another option the fields fail to rerender.  I have already tried both onselect and onclick.  Does anyone see anything wrong?

 

<apex:selectList id="selected_list" required="false" value="{!unselected}" multiselect="true" size="20" style="width:150px">
<apex:selectOptions value="{!selectedOptions}"/>
<apex:actionSupport event="onchange" reRender="Details"/>
</apex:selectList>

<apex:panelGroup >
<apex:actionFunction name="UpdatePopDetails" rerender="AllDetails"/>
<apex:outputPanel id="Details">
<apex:pageBlockSection columns="1" >
<apex:outputField value="{!items.Brand__c}"/>
<apex:outputField value="{!items.Product_Line__c}"/>
<apex:outputField value="{!prodObject.Sub_Product_Line__c}"/>
<apex:outputField value="{!items.SKU__c}"/>
<apex:outputField value="{!prodObject.Description__c}"/>
<apex:outputField value="{!prodObject.Plan_to_Sell__c}"/>
<apex:outputField value="{!prodObject.NPI_Transition__c}"/>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:panelGroup>

 

-hkp716

  • December 06, 2012
  • Like
  • 0

Hi Everyone,

 

This has probably been talked about before but i really haven't found a clear example.  Is it possible to rerender fields on a VF page based on selectlist item.  I have tried to use "onclick" and onselect" in the apex:selectlist tag and in an actionsupport tag.  The problem is when I click a button to move an item from one selectlist to another new selectlist the fields rerender, when i move another item to the new selectlist the fields change again,  but when I click on the first item I moved in the new selectlist the fields dont rerender back to the accociated record.  Has anyone encountered this problem?

 

Thanks in advance for the help,

-hkp716

  • December 03, 2012
  • Like
  • 0

Im trying to create a VF Component and it keeps throwing me this error.

 

Error: Unknown property 'MultiSelectComponentController.options'

 

Thanks for the help, 

hkp716

 

Heres my component:

 

<apex:component controller="MultiSelectComponentController">
<apex:attribute name="AvailableList" type="selectOption[]" description="Available List from the Page" assignTo="{!options}" required="true"/>
<apex:attribute name="ChosenList" type="selectOption[]" description="Chosen List from the Page" assignTo="{!selectedOptions}" required="True"/>
<!-- <apex:attribute name="AvailableTitle" type="String" description="Title for Available List" assignTo="{!selectedTitle}"/> -->
<!-- <apex:attribute name="ChosenTitle" type="String" description="Title for Chosen List" assignTo="{!deSelectedTitle}"/> -->

<apex:outputPanel id="panel">
<apex:pageBlockSection columns="4" >
<apex:selectList multiselect="true" size="5" value="{!selected}" >
<apex:selectOptions value="{!options}" />
<apex:actionSupport event="ondblclick" action="{!selecting}" rerender="panel" status="waitingStatus" />
</apex:selectList>
<apex:pageBlockSection columns="1">
<!-- <apex:outputText value="{!selectedTitle}" /> -->
<apex:commandButton reRender="panel" id="select" action="{!selecting}" value=">" status="waitingStatus"/>
<!-- <apex:outputText value="{!delectedTitle}" /> -->
<apex:commandButton reRender="panel" id="deselect" action="{!deselecting}" value="<" status="waitingStatus"/>
</apex:pageBlockSection>
<!-- An action status to show that the operation of moving between the lists is in progress--->
<apex:actionStatus id="waitingStatus" startText="Please wait..." stopText=""/>
<apex:selectList multiselect="true" size="5" value="{!deselected}">
<apex:selectOptions value="{!selectedOptions}"/>
<apex:actionSupport event="ondblclick" action="{!deselecting}" rerender="panel" status="waitingStatus"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:component>

 

 

  • November 20, 2012
  • Like
  • 0

Hey everyone,

 

I get this error thrown.  Any ideas?

 

Controller:

 

public class listTest{

private String[] selectedMakes = new String[]{};
private SelectOption[] availableList;
private SelectOption[] chosenList;
private String selectedTitle;
private String deSelectedTitle;
private static String MULTIPICKLIST_SEPERATOR = ';';

public ApexPages.StandardController MyProductController2 {get; set;}
public Product2 Product2 {get; set;}


public SelectOption[] getAvailableList(){
if (availableList == null) {
availableList = new SelectOption[]{};
List <Product2> pmakes = [Select Name, display_name__c, sku__c from Product2];
for (Product2 f : pmakes ) {
availableList.add(new SelectOption(f.sku__c, f.sku__c));
}
}

return availableList ;
}

public SelectOption[] getChosenList(){
if (chosenList== null) {
chosenList= new SelectOption[]{};
}
combineOptions(chosenList);
return chosenList;
}

private String combineOptions(List<SelectOption> values) {
String result = '';
for(SelectOption s: values) {
result = result + MULTIPICKLIST_SEPERATOR + s.getValue();
quote.es_nlp_makes__c = result;
}
return result;
}

public String getDeselectedTitle(){

deselectedTitle = 'Available';

return deselectedTitle;

}

public String getSelectedTitle(){

selectedTitle = 'Chosen';

return selectedTitle;

}
}

  • November 19, 2012
  • Like
  • 0

Hey everyone,

 

I'm trying to render my fieldset when I click on a select option in my "choosen sku value" select list.  

 

here is the fieldset i want to rerender:

 

<apex:outputPanel id="details">
<apex:pageBlockSection columns="1">
<apex:repeat value="{!$ObjectType.product2.FieldSets.product_field_set}" var="g">
<apex:inputfield value="{!product2[g]}"/>

</apex:repeat>

 

Thanks in advance for the help...

 

hkp716

 

 

VF:

<apex:page standardController="product2" extensions="brands1,plist1,vp1,floordisplay"> <!-- sidebar="false" -->
<apex:form >

<apex:actionRegion >
<apex:actionFunction name="UpdateProductList" rerender="ProductList,details"/>
<apex:pageBlock title="Floor plan details" mode="edit" id="temptable">
<apex:pageBlockSection columns="1">
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Add models" mode="edit" id="ptable">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!prodObject.Brand__c}">
<apex:actionSupport event="onchange" reRender="ptable"/>
</apex:inputField>
<apex:inputField value="{!prodObject.Product_Line__c}" >
<apex:actionSupport event="onchange" reRender="ptable"/>
</apex:inputField>
<apex:inputField value="{!prodObject.Sub_Product_Line__c}" onchange="UpdateProductList();" >
<apex:actionSupport event="onchange" reRender="ptable"/>
</apex:inputField>
</apex:pageBlockSection>

<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputPanel id="ProductList">
<br>SKU Name:</br>
<apex:selectList value="{!skuname}" size="4" multiselect="true"> <!-- multiselect="true" -->
<apex:selectOptions value="{!skuNames}"/>
</apex:selectList><p/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:inputCheckbox rendered="{!b}"></apex:inputCheckbox><apex:inputText rendered="{!b}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:commandButton value=" ADD SKU " action="{!displaySkuValue}"/>
</apex:pageBlockSectionItem>

</apex:pageBlockSection>
</apex:pageBlock>

<apex:pageBlock title="Add additional details to models" mode="edit">

<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<br>Choosen SKU:</br>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:selectList value="{!choosenSkuValues}" size="4" multiselect="false">
<apex:selectOptions value="{!remainingSkuValues}"/>
</apex:selectList><p/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

<apex:outputPanel id="details">
<apex:pageBlockSection columns="1">
<apex:repeat value="{!$ObjectType.product2.FieldSets.product_field_set}" var="g">
<apex:inputfield value="{!product2[g]}"/>

</apex:repeat>

<apex:repeat value="{!fields}" var="f">
<apex:inputField value="{!fpdisplay[f.fieldPath]}" required="{!OR(f.required, f.dbrequired)}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:actionRegion>
</apex:form>
</apex:page>

  • November 14, 2012
  • Like
  • 0

Does anyone know how to move a value or many values from one selectlist to another selectlist  in a VF page.  I already looked at the dynamic references example but couldn't apply to my requirement....

 

-hkp716

  • November 07, 2012
  • Like
  • 0

When i add a record type filter my joined report won't run. Anyone have any issues similar to mine?

 

-hkp716

  • November 05, 2012
  • Like
  • 0

Fellow Devs,

I am trying to set up a select list that rerenders after an option is selected in my sub product line picklist. All the products currently being shown right now. I've used action support on my visualforce page but no luck so far.

 

Any suggestions?

hkp716

 

VF:
<apex:page standardController="product2" extensions="brands1,plist1">
<apex:form >
<apex:pageBlock title="Floor Planning" mode="edit">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!product2.Brand__c}">
<b>Product Line:</b> <apex:inputField value="{!product2.Product_Line__c}" />
<b>Sub-Product Line:</b> <apex:inputField value="{!product2.Sub_Product_Line__c}" />
</apex:inputField>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:selectList value="{!Prods}" multiselect="true">
<apex:selectOptions value="{!items}"/>
</apex:selectList><p/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>


</apex:page>

 

 

Controller:

 

public class brands1 {

Public string currentbrand {get; set;}
Public string currentpline {get; set;}
Public string currentspline {get; set;}

public brands1(ApexPages.StandardController controller)
{
currentbrand = currentpline = currentspline = null;
}
public List<SelectOption> getTypes()
{
Schema.sObjectType sobject_type = product2.getSObjectType();
Schema.DescribeSObjectResult sobject_describe = sobject_type.getDescribe();
Map<String, Schema.SObjectField> field_map = sobject_describe.fields.getMap();

List<Schema.PicklistEntry> pick_list_values = field_map.get('Select_Brand__c').getDescribe().getPickListValues();
List<selectOption> options = new List<selectOption>();
for (Schema.PicklistEntry a : pick_list_values)
{
options.add(new selectOption(a.getLabel(), a.getValue()));
}
return options;
}


public with sharing class plist1 {
String[] prods = new String[]{};

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
List<Product2> ProductsForPage = [Select Id,SKU__c,Brand__c From Product2];
for (Product2 p : ProductsForPage) {
options.add(new SelectOption(p.Id, p.SKU__c));
}
return options;
}

public String[] getprods() {
return prods;
}

public void setprods(String[] prods) {
this.prods = prods;
}


public List<Product2> getProducts() {

List<Product2> ProductsForPage = [Select Id,SKU__c,Brand__c From Product2];
return ProductsForPage;


}
}
}


EXT:


public with sharing class plist1 {

public plist1() {

}


public plist1(ApexPages.StandardController controller) {

}

String[] prods = new String[]{};

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
List<Product2> ProductsForPage = [Select Id,SKU__c,Brand__c From Product2 WHERE Use_for_Floor_Planning__c = true];
for (Product2 p : ProductsForPage) {
options.add(new SelectOption(p.Id, p.SKU__c));
}
return options;
}

public String[] getprods() {
return prods;
}

public void setprods(String[] prods) {
this.prods = prods;
}

}

  • October 26, 2012
  • Like
  • 0

Hi Everyone,

 

I want to uncheck a checkbox after I save a record.  I have a vadation rule stating the checkbox should be checked if status is "new".  Even if the status is "new" i want the trigger to uncheck the box after save so if someone edits the record they have to recheck the box, if the status is still new.

 

My Trigger:

trigger Uncheckbox on Lead (after update) {

for (Lead cb : Trigger.new) {
if (cb.Confirm_New_Status__c == true) {

Lead ourcb = new Lead (Confirm_New_Status__c=false);


update ourcb;

}
}
}

 

Any suggestions?

 

-Hkp716

 

  • October 24, 2012
  • Like
  • 0

Is there a way to setup a trigger to send bounced e-mails to the org wide email address?

 

 

Thank you for any response in advance,

hkp716

  • October 23, 2012
  • Like
  • 0

How do you send bounced emails to the organization-wide address?  I have checked the activate bounce management and return bounced email to sender but it sending the bounced emails to the wrong address.  Is this even feasible?

  • October 18, 2012
  • Like
  • 0

How can I populate my select list with the product names?  I know instead of creating new options:

 List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico'));
return options;

 

I have to call the name field in the products object but i can't fiqure out how to do it.  Anyone got any ideas?

-Hkp716

 

 

public with sharing class plist1 {
String[] prods = new String[]{};

public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico'));
return options;
}

public String[] getprods() {
return prods;
}

public void setprods(String[] prods) {
this.prods = prods;
}


public List<Product2> getProducts() {

List<Product2> ProductsForPage = [Select Id,Name,Brand__c From Product2];
return ProductsForPage;


}
}

  • October 17, 2012
  • Like
  • 0

Hi Everyone,

 

Is there a way to show a multi-select listbox on a visual force page that populates the name(s) of the product record when a certian criteria is met using a picklist?

 

Ex:  I have a 3 level dependent picklist already setup on my visualforce page, brands, product, and sub product.  (They all belong to the same object.)  Is there a way where I can populate a list box, multi-select if possible, of all the record names that meet the criteria?  Than to add more complexity move the selected list to another box where information of the record can be edited?

 

This is a real tough and complex requirement.  Any information that can point me in the right direction will be usefull.

 

Thanks,

-Hkp716

 

P.S. I already read the extended functionality of Vforce and the Dynamic binding section in the developer guide.  Couldn't really find anything to support my requirement.

  • October 09, 2012
  • Like
  • 0

Hi Everyone,

 

I have a picklist issue i can't get to work.  My 3rd pick list is dependent on my 2nd picklist and it works fine, but my 2nd picklist is not dependent on my 1st.  Is there a way set up a query in my controller or vforce page where values in my 2nd picklist only populate when when a certain value in my 1st pick list is selected? (Without using field dependancies in my object)

 

Some brands only have 1 or 2 product lines but instead all the product line show up in the picklist.

 

Thank again for your help,

-Hersh

 

My Controller:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

public class brands
{
public brands(ApexPages.StandardController controller)
{

}
public List<SelectOption> getTypes()
{
Schema.sObjectType sobject_type = product2.getSObjectType();
Schema.DescribeSObjectResult sobject_describe = sobject_type.getDescribe();
Map<String, Schema.SObjectField> field_map = sobject_describe.fields.getMap();

List<Schema.PicklistEntry> pick_list_values = field_map.get('Select_Brand__c').getDescribe().getPickListValues();
List<selectOption> options = new List<selectOption>();
for (Schema.PicklistEntry a : pick_list_values)
{
options.add(new selectOption(a.getLabel(), a.getValue()));
}
return options;
}

}

 

 

 <apex:page standardController="product2" extensions="brands">

<apex:form >

<apex:pageBlock title="Floor Planning" mode="edit">

<apex:pageBlockSection columns="1">

<apex:inputField value="{!product2.Brand__c}">

<apex:inputField value="{!product2.Product_Line__c}" />

<apex:inputField value="{!product2.Sub_Product_Line__c}" />

</apex:inputField>

</apex:pageBlockSection>

</apex:pageBlock>

</apex:form>

</apex:page>

  • October 09, 2012
  • Like
  • 0

Hi Everyone,

 

I'm new to VisualForce Pages and Salesforce in general.  I need an visual page that shows a dependent picklist from an object.  The picklist goes down 3 levels.  My custom fields are brand, product line, and subproduct line. Right now I can see the page but my picklists have no values.  I know I need a controller and maybe a wrapper class but im not sure where to insert it.

 

*I found this code online and just tweaked as per my specs.

 

My Controller 

 

public with sharing class MyController {

public string currentBrand { get; set; }
public string currentPline { get; set; }
public string currentSpline { get; set; }

public MyController() {
currentBrand = currentPline = currentSpline = null;
}

 

public List<SelectOption> getListBrand() {
List<SelectOption> options = new List<SelectOption> { new SelectOption('','-- Choose --') };
for(Schema.PicklistEntry pe:Product2.Family.getDescribe().getPicklistValues()) {
options.add(new SelectOption(pe.getValue(),pe.getLabel()));
}
return options;
}


public List<SelectOption> getListPline() {
List<SelectOption> options = new List<SelectOption> { new SelectOption('','-- Choose --') };
for(Schema.PicklistEntry pe:Product2.Family.getDescribe().getPicklistValues()) {
options.add(new SelectOption(pe.getValue(),pe.getLabel()));
}
return options;
}

public List<SelectOption> getListSpline() {
List<SelectOption> options = new List<SelectOption>();
if(currentPline == null || currentPline == '')
return options;
options.add(new SelectOption('','-- Choose --'));
for(Product2 p2:[select id,name from product2 where family = :currentPline]) {
options.add(new SelectOption(p2.id,p2.name));
}
return options;
}

}

 

VForce page:


<apex:page controller="MyController">
<apex:form id="theForm">
<apex:sectionHeader title="Choose Product Line"/>
<apex:pageBlock title="Demo Page">
<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel >Product Line</apex:outputLabel>
<apex:selectList size="1" multiselect="false" value="{!currentPline}">
<apex:selectOptions value="{!ListPline}"/>
<apex:actionSupport reRender="theForm" event="onchange"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Sub-Product</apex:outputLabel>
<apex:selectList value="{!currentSpline}" size="1" multiselect="false">
<apex:selectOptions value="{!listProducts}"/>
<apex:actionSupport reRender="theForm" event="onchange"/>
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Can anyone help me out?

Thanks for the help in advance,

Hkp716

  • October 07, 2012
  • Like
  • 0

Hey Everyone,

 

I have a VF page that sends an email of a table to whomever email address is entered in a text field.  The user has permissions to View, Create, Edit, and Delete for all objects in the table.  The user also has the send email permission checked.  After inputting an email address and clicking send a confirmation message should show up on the VF page.  This works fine when I do it as a syst admin but if i login as another user and hit send I get a rdr to Insufficient Privileges error but the email send anyway.  Any ideas what the problem is?

 

-hkp716

  • January 18, 2013
  • Like
  • 0

Hi everyone,

 

I can retrieve any records with this query.  It is an issure with the Date format.  Is lastmodifieddate a date or datetime?  If i remove the LastModifiedDate >=:d AND LastModifiedDate <=:c filter the query works just fine.

 

 

Date d = system.Today().addDays(-3);
Date c = system.Today().addDays(-5);

//collect a list of records
//
List<Lead> setfollow = [SELECT Id, OwnerID, status FROM Lead WHERE LastModifiedDate >=:d AND LastModifiedDate <=:c AND Map_Record_Type__c = 'Contract/Direct Customer' AND IsConverted = FALSE AND status IN('Qualified', 'Prospecting')];

 

Im trying to get a list of leads that havent been modified in 4 days.

 

I already tried:

Date d = system.Today().addDays(-4) 

and bind it with the query but nothing shows up.

 

Any ideas?

 

-hkp716

  • December 14, 2012
  • Like
  • 0

Hi everyone,

 

I cant get my scheduled aplex class to assign a task to the lead.  How do i check if my list, setfollow, is populating with any lead records?  And am I using the proper syntax to insert a task and assign to the lead owner?

 

The scheduler works fine and i see the job in monitoring.

 

-hkp716

 

Apex Class:

 

global class leadfollowup30daystest2 implements Schedulable{

global void execute(SchedulableContext sc)
{
leadfollowup30daystest2 q = new leadfollowup30daystest2();
        String sch = '0 25 16 * * ?';
        system.schedule('30 day lead followup test2', sch, q);
}
public static Date todayMinusThirty = system.Today().addDays(-2);


public static void updateLeads ()
{


//collect a list of records

List<Lead> setfollow = [SELECT Id FROM Lead WHERE (LastActivityDate = :todayMinusThirty OR LastActivityDate = NULL) AND LastModifiedDate = :todayMinusThirty AND ISconverted = FALSE AND Map_Record_Type__c = 'Contract_DirectCustomer' AND (status = 'Working ASM' OR status = 'Contacted' OR status = 'Prospecting' OR status = 'Qualified' OR status = 'Proposal' OR status = 'Negotiation' OR status = 'Sent to ABD' OR status = 'Working Lead Specialist')];

for (Lead ld :setfollow)
{
    Task t = new Task();
    t.Subject = 'Needs Follow up - No Activity in 30 dayss';
    t.Status = 'Not Started';
    t.Priority = 'Normal';
    t.ActivityDate = Date.Today()+7;
    t.OwnerID = ld.OwnerID;
    
   insert t;
}


}
}

  • December 12, 2012
  • Like
  • 0

Is there a way to schedule an apex job to run everyday at 5pm? 

Hi everyone,

 

I have a couple of question. How do i get my scheluded apex job to show up in monitoring?  How can i add picklist values from status in my String checkLead?  if i add status = 'open', 'closed' at the end the string breaks because im adding  '.  

 

 

-hkp716

 

apex class:

 

global class leadfollowup30day implements Schedulable{

global void execute(SchedulableContext sc)
{
leadfollowup30day t = new leadfollowup30day();
        String sch = '0 0 11 * * ?';
        system.schedule('30 day lead followup', sch, t);
}
public static Date todayMinusThirty = system.Today().addDays(-30);


public static String checkLead = 'select Id, status, LastModifiedDate from Lead WHERE (LastActivityDate = :todayMinusThirty OR LastActivityDate = NULL) AND LastModifiedDate = :todayMinusThirty';


public static void updateLeads ()
{

//system.debug('\n\n30 checkLead ' + checkLead);
//collect a list of records

List <Lead> setfollow = Database.query(checkLead);

for (Lead ld :setfollow)
{
    Task t = new Task();
    t.Subject = 'Needs Follow up - No Activity in 30 days';
    t.OwnerID = ld.OwnerID;
}


}
}

  • December 11, 2012
  • Like
  • 0

This workflow should fire after 2 days.  Its been 2 days and hasnt worked yet.  Anyone see any errors i may have overlooked?

 

AND(Ceiling(Today() - LastActivityDate ) = 2,Ceiling(Today() - DateValue(LastModifiedDate)) = 2, $RecordType.Name ='Contract/Direct Customer', IsConverted =FALSE, OR(ISPICKVAL(Status,'Working ASM'),ISPICKVAL(Status,'Contacted'),ISPICKVAL(Status,'Prospecting'),ISPICKVAL(Status,'Qualified'),ISPICKVAL(Status,'Propoal'),ISPICKVAL(Status,'Negotiation'),ISPICKVAL(Status,'Sent to ABD')))

 

-hkp716

  • December 06, 2012
  • Like
  • 0

Hey Everyone,

 

Im having issues rerendering fields based on which select option i choose.  The outputfields populate just fine when i add new options to the selectlist, but when I click on another option the fields fail to rerender.  I have already tried both onselect and onclick.  Does anyone see anything wrong?

 

<apex:selectList id="selected_list" required="false" value="{!unselected}" multiselect="true" size="20" style="width:150px">
<apex:selectOptions value="{!selectedOptions}"/>
<apex:actionSupport event="onchange" reRender="Details"/>
</apex:selectList>

<apex:panelGroup >
<apex:actionFunction name="UpdatePopDetails" rerender="AllDetails"/>
<apex:outputPanel id="Details">
<apex:pageBlockSection columns="1" >
<apex:outputField value="{!items.Brand__c}"/>
<apex:outputField value="{!items.Product_Line__c}"/>
<apex:outputField value="{!prodObject.Sub_Product_Line__c}"/>
<apex:outputField value="{!items.SKU__c}"/>
<apex:outputField value="{!prodObject.Description__c}"/>
<apex:outputField value="{!prodObject.Plan_to_Sell__c}"/>
<apex:outputField value="{!prodObject.NPI_Transition__c}"/>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:panelGroup>

 

-hkp716

  • December 06, 2012
  • Like
  • 0

I'm new to creating formulas in SalesForce and having trouble with this.  I'd like to start by saying I keep reading about creating formulas through the advanced formula tab, and I don't know where this is which may be my problem.  The only place I know to add a formula is from customizing a report and using the "add formula" option.

 

That said, in my report I just need to subtract two custom fields, which I believe should be, "Call_Date_Time__c - Date_Assigned__c" but I get an error, "Error: Invalid custom summary formula definition: Field Call_Date_Time__c does not exist."  I found the field name directly from activity custom fields.  Any help would be greatly appreciated.

  • November 26, 2012
  • Like
  • 0

Im trying to create a VF Component and it keeps throwing me this error.

 

Error: Unknown property 'MultiSelectComponentController.options'

 

Thanks for the help, 

hkp716

 

Heres my component:

 

<apex:component controller="MultiSelectComponentController">
<apex:attribute name="AvailableList" type="selectOption[]" description="Available List from the Page" assignTo="{!options}" required="true"/>
<apex:attribute name="ChosenList" type="selectOption[]" description="Chosen List from the Page" assignTo="{!selectedOptions}" required="True"/>
<!-- <apex:attribute name="AvailableTitle" type="String" description="Title for Available List" assignTo="{!selectedTitle}"/> -->
<!-- <apex:attribute name="ChosenTitle" type="String" description="Title for Chosen List" assignTo="{!deSelectedTitle}"/> -->

<apex:outputPanel id="panel">
<apex:pageBlockSection columns="4" >
<apex:selectList multiselect="true" size="5" value="{!selected}" >
<apex:selectOptions value="{!options}" />
<apex:actionSupport event="ondblclick" action="{!selecting}" rerender="panel" status="waitingStatus" />
</apex:selectList>
<apex:pageBlockSection columns="1">
<!-- <apex:outputText value="{!selectedTitle}" /> -->
<apex:commandButton reRender="panel" id="select" action="{!selecting}" value=">" status="waitingStatus"/>
<!-- <apex:outputText value="{!delectedTitle}" /> -->
<apex:commandButton reRender="panel" id="deselect" action="{!deselecting}" value="<" status="waitingStatus"/>
</apex:pageBlockSection>
<!-- An action status to show that the operation of moving between the lists is in progress--->
<apex:actionStatus id="waitingStatus" startText="Please wait..." stopText=""/>
<apex:selectList multiselect="true" size="5" value="{!deselected}">
<apex:selectOptions value="{!selectedOptions}"/>
<apex:actionSupport event="ondblclick" action="{!deselecting}" rerender="panel" status="waitingStatus"/>
</apex:selectList>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:component>

 

 

  • November 20, 2012
  • Like
  • 0

Hey everyone,

 

I get this error thrown.  Any ideas?

 

Controller:

 

public class listTest{

private String[] selectedMakes = new String[]{};
private SelectOption[] availableList;
private SelectOption[] chosenList;
private String selectedTitle;
private String deSelectedTitle;
private static String MULTIPICKLIST_SEPERATOR = ';';

public ApexPages.StandardController MyProductController2 {get; set;}
public Product2 Product2 {get; set;}


public SelectOption[] getAvailableList(){
if (availableList == null) {
availableList = new SelectOption[]{};
List <Product2> pmakes = [Select Name, display_name__c, sku__c from Product2];
for (Product2 f : pmakes ) {
availableList.add(new SelectOption(f.sku__c, f.sku__c));
}
}

return availableList ;
}

public SelectOption[] getChosenList(){
if (chosenList== null) {
chosenList= new SelectOption[]{};
}
combineOptions(chosenList);
return chosenList;
}

private String combineOptions(List<SelectOption> values) {
String result = '';
for(SelectOption s: values) {
result = result + MULTIPICKLIST_SEPERATOR + s.getValue();
quote.es_nlp_makes__c = result;
}
return result;
}

public String getDeselectedTitle(){

deselectedTitle = 'Available';

return deselectedTitle;

}

public String getSelectedTitle(){

selectedTitle = 'Chosen';

return selectedTitle;

}
}

  • November 19, 2012
  • Like
  • 0

 

 

Hi, I dont know whats wrong in this code im getting this error msg

 

Error: Invalid field ischecked for SObject Sample_Item__c

 

class:

public with sharing class sampleitem {

    public PageReference doSelect() {
        List<sample_Item__c> lstswi = new List<sample_Item__c>();
        for(wrapperSample objws : lstWS){
            if(objws.ischecked == true){
                objws.swi.Item__c = pid;
                update objws.swi;
            }
            
        }
        return (new pagereference('/'+pid).setredirect(true));
    }

    public String pId = apexpages.currentpage().getparameters().get('pid');
    public String wtId = apexpages.currentpage().getparameters().get('wid');
    public List<sample_Item__c> lstSWI{get;set;}
    public wrapperSample objWS{get;set;}
    public List<wrapperSample> lstWS{get;set;}
    public sampleitem(){
        lstSWI = new List<sample_Item__c>();
        lstSWI = new List<sample_Item__c>();
        lstSWI = [select id,name,Stage__r.Name,Item__r.name from sample_Item__c where Template__c =: wtId];
        lstWS = new List<wrapperSample>();
        for(sample_Item__c objSWI : lstSWI){
            objWS = new wrapperSample();
            objWS.swi = objSWI;
            lstWS.add(objWS);
        }
    }
    
    public class wrapperSample{
        public sample_Item__c swi{get;set;}
        public boolean ischecked{get;set;}
    }

 page

<apex:page controller="sampleitem">
      <apex:form >
          <apex:pageblock >
              <apex:pageblocksection >
                  <apex:pageblocktable value="{!lstWS}" var="S">
                      <apex:column headerValue="Select">
                          <apex:inputcheckbox value="{!S.ischecked}"/>
                      </apex:column>
                      <apex:column headerValue="Name">
                          <apex:outputtext value="{!S.swi.Name}"></apex:outputtext>
                      </apex:column>
                       <apex:column headerValue="Stage">
                          <apex:outputtext value="{!S.swi.Stage__r.Name}"></apex:outputtext>
                      </apex:column>
                      <apex:column headerValue="Item Name">
                          <apex:outputtext value="{!S.swi.Item__r.name}"></apex:outputtext>
                      </apex:column>
                  </apex:pageblocktable>
              </apex:pageblocksection>
              <apex:commandButton value="Select" Action="{!doSelect}"/>
          </apex:pageblock>
      </apex:form>

 

 

 

 

  • November 19, 2012
  • Like
  • 0

Hey everyone,

 

I'm trying to render my fieldset when I click on a select option in my "choosen sku value" select list.  

 

here is the fieldset i want to rerender:

 

<apex:outputPanel id="details">
<apex:pageBlockSection columns="1">
<apex:repeat value="{!$ObjectType.product2.FieldSets.product_field_set}" var="g">
<apex:inputfield value="{!product2[g]}"/>

</apex:repeat>

 

Thanks in advance for the help...

 

hkp716

 

 

VF:

<apex:page standardController="product2" extensions="brands1,plist1,vp1,floordisplay"> <!-- sidebar="false" -->
<apex:form >

<apex:actionRegion >
<apex:actionFunction name="UpdateProductList" rerender="ProductList,details"/>
<apex:pageBlock title="Floor plan details" mode="edit" id="temptable">
<apex:pageBlockSection columns="1">
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Add models" mode="edit" id="ptable">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!prodObject.Brand__c}">
<apex:actionSupport event="onchange" reRender="ptable"/>
</apex:inputField>
<apex:inputField value="{!prodObject.Product_Line__c}" >
<apex:actionSupport event="onchange" reRender="ptable"/>
</apex:inputField>
<apex:inputField value="{!prodObject.Sub_Product_Line__c}" onchange="UpdateProductList();" >
<apex:actionSupport event="onchange" reRender="ptable"/>
</apex:inputField>
</apex:pageBlockSection>

<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputPanel id="ProductList">
<br>SKU Name:</br>
<apex:selectList value="{!skuname}" size="4" multiselect="true"> <!-- multiselect="true" -->
<apex:selectOptions value="{!skuNames}"/>
</apex:selectList><p/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:inputCheckbox rendered="{!b}"></apex:inputCheckbox><apex:inputText rendered="{!b}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:commandButton value=" ADD SKU " action="{!displaySkuValue}"/>
</apex:pageBlockSectionItem>

</apex:pageBlockSection>
</apex:pageBlock>

<apex:pageBlock title="Add additional details to models" mode="edit">

<apex:pageBlockSection columns="1">
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<br>Choosen SKU:</br>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:selectList value="{!choosenSkuValues}" size="4" multiselect="false">
<apex:selectOptions value="{!remainingSkuValues}"/>
</apex:selectList><p/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

<apex:outputPanel id="details">
<apex:pageBlockSection columns="1">
<apex:repeat value="{!$ObjectType.product2.FieldSets.product_field_set}" var="g">
<apex:inputfield value="{!product2[g]}"/>

</apex:repeat>

<apex:repeat value="{!fields}" var="f">
<apex:inputField value="{!fpdisplay[f.fieldPath]}" required="{!OR(f.required, f.dbrequired)}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:actionRegion>
</apex:form>
</apex:page>

  • November 14, 2012
  • Like
  • 0

When i add a record type filter my joined report won't run. Anyone have any issues similar to mine?

 

-hkp716

  • November 05, 2012
  • Like
  • 0

I have pageblock table having contents of one object. i have cretaed another custom object

with similar fields of table. I want to create instance of the pageBlocktable with the table of

the custom object fields.

 

How can i do it..

 

 

Any suggestion with code????

 

nadi