• badi
  • SMARTIE
  • 749 Points
  • Member since 2014

  • Chatter
    Feed
  • 25
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 6
    Questions
  • 100
    Replies
Hello awesome devs!

I am attempting to create a VF page with 4 fields for user inputting.  2 of these fields are Date fields which when filled in like MM/DD/YYY when I press the search button to call my custom controller the date in the field populated has its format changed to Tue Dec 26 00:00:00 GMT 2017 and doesnt seem to be being applied in the search itself as all records are returned and not ones just for the date entered. 

Can someone help me with gettign the format to stay as I think this is the cause of the date field not being used in the search criteria. 

Please see my VF Page and controller code below. 

Thank you very much for any help you can provide,

Shawn

VF Page Code - 
 
<apex:page controller="SubSearchController">
    
    <apex:form>
    	<apex:pageBlock id="pb">
        	<apex:pageBlockButtons>
                <apex:commandButton action="{!searchRecords}" value="Search" rerender="pb"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:outputLabel value="Account Id" />
                <apex:inputText value="{!AccId}"/>
                <apex:outputLabel value="Status" />
                <apex:inputText value="{!SubStatus}"/>
                <apex:outputLabel value="Service Activation date" />
                <apex:inputText value="{!SAD}"/>
                <apex:outputLabel value="Term End Date" />
                <apex:inputText value="{!TermEnd}"/>
            </apex:pageBlockSection>
            <apex:pageBlockTable var="record" value="{!records}" id="pbTable">
                <apex:column value="{!record.Name}" />
                <apex:column value="{!record.Zuora__Status__c}" />
                <apex:column value="{!record.Zuora__ServiceActivationDate__c}" />
                <apex:column value="{!record.Zuora__TermEndDate__c}" />
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
    
</apex:page>

Controller Code -

public class SubSearchController {

    public String AccId {get;set;}
    public String SubStatus {get;set;}
    public Date SAD {get;set;}
    public Date sadDate = Date.valueOf(SAD);
    public Date TermEnd {get;set;}
    public Date TermDate = Date.valueOf(TermEnd);
    
    public List<Zuora__Subscription__c> records {get; private set;}
    
    public SubSearchController(){
        records = new List<Zuora__Subscription__c>();   
    }
    
    public PageReference searchRecords() {
        
        records = [SELECT Zuora__Account__c, Zuora__Status__c, Zuora__ServiceActivationDate__c, Zuora__TermEndDate__c, OpportunityId__c, Total_Booking_Amount__c, Id, Name
                  FROM Zuora__Subscription__c WHERE Zuora__Account__c = : AccId AND Zuora__Status__c = : SubStatus AND (Zuora__ServiceActivationDate__c = : sadDate OR Zuora__TermEndDate__c = :TermDate)];
        return null;
        
    }
    
}

 
Trying to write a Validation Rule for a Custom Field on a Custom Object to handle this scenario --- If a Lookup Field is not populated, then a Picklist field and a Text field are required to be populated --- but not prevent this scenario --- If the Lookup Field is populated, then the Picklist may be updated (but is not required), and the Text Field should not be populated.

Tried coming at it a couple different angels and can't get it right. Any thoughts?
 I've tried to put my query directly in a list and then loop through the list but I'm getting an error invalid value type list for list.

Map<String,string> maprecTypewithId = new Map<String,String>();
           List<Price_Authorization_Request__c> listPARToUpdate = new List<Price_Authorization_Request__c>([select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c']);
           for(RecordType rec : listPARToUpdate)
           {
               maprecTypewithId.put(rec.Name,rec.id);
           }

However, If I try it this way - I get the aggregrate query FOR loop error (due to large recrod set) 

Map<String,string> maprecTypewithId = new Map<String,String>();
           List<Price_Authorization_Request__c> listPARToUpdate = new List<Price_Authorization_Request__c>();
           for(RecordType rec : [select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c'])
           {
               maprecTypewithId.put(rec.Name,rec.id);
           }

What is the best way to achieve this - without exceeding governor limits?
Hi Everyone, 
  So below I attached my code and what I believe needs to be done in order for that program to run. I was wondering if anyone can tell me what needs to be written or changed in order to get it executed. Also, the code works fine when I try to check out on the challenge and it passed, I am just trying to see the program compile and run. 

User-added imageUser-added image

 
Hello Developers!

I was wondering if anyone can help me finding good materials for learning process builder and visual workflow.
I am trying to learn this two topics from scratch and I am kinda watching video type of guy. So, if anyone has video series that they would like to share or link for books (Paid/unpaid)  etc.. much appreciated!
Thank You Guys for your help!
A user said at his old job that they have a image on the account page based off when the last closed won opportunity was.For example if it has been more than a year since the customer had a closed won opportunity, there would be a red image on the account page.

I am new to using forumla fields. I was wondering if someone could help me out please.
Hello Developers!

Need some advice on trigger testing. I had simple trigger 8 to 9 line worth. I wrote a test cases by passing single record (con.FirstName = 'Jon' rather than creating a for loop and add con.FirstName = 'Jon' + i). 
I am getting 87% of code coverage by this single record passing and testing.
Do you guys think that I would be able to deploy it into the production OR I need to test trigger with bulk records and then only be able to deploy it. (well, I can try to deploy and see it but I am still developing my app further)
Thank you!
I have two objects Speaker__c, Session__c. I want to create a single VF page which will includes fields from both objects. VF page will have inputField / inputText type of field. The class through error: Initial terms of field expression must be a concrete sObject: List
VF code through the error: Unknown property 'VFpageName.Session__c'
If I dont initiate objects with List<>, apex class will be fine, but VF page shows same error. How to fix this?
My code: 
Class 
public class SingleVFPagePullDataFromMultipleObjects {
    // MVC concept to data binding in VF page & controller
    public List<Speaker__c> objectSpeaker {get; set;}
    public List<Session__c> objectSession {get; set;}
    
    //define the function
    public SingleVFPagePullDataFromMultipleObjects(){
    // Initiate objects 
        List<Speaker__c> objectSpeaker = new List<Speaker__c>();
        List<Session__c> objectSession = new List<Session__c>();
    }
    // Save button
    public void save()
    {
    	try
        {
            insert objectSpeaker;
            objectSession.Speaker_Name__c = objectSpeaker.id;
            insert objectSession;
        }   
        catch(Exception ex)
        {
            System.debug('\n\nException ='+ex.getMessage()+'\n\n');
        }    
    }
    public void cancel(){}    
}

VF
<apex:page controller="SingleVFPagePullDataFromMultipleObjects" >
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection>

                <apex:inputText value="{!Session__c.Session_Date__c }" />
                <apex:inputText value="{!Session__c.Description__c }" />
                <apex:inputText value="{!Session__c.Level__c }" />
                <apex:inputText value="{!Speaker__c.Last_Name__c }" />
                <apex:inputText value="{!Speaker__c.Bio__c }" />                
            </apex:pageBlockSection>
            
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
  • October 24, 2016
  • Like
  • 0
Hi, I'm trying to calculate percentage complete on a case based on checkboxes getting done.
For example, if I have 4 checkboxes to mark on a case that gets me to completion, how do I write a formula field that would say if box 1 checked, 25% completed, if box 2 checked, 50% completed. And, there is no order to the 4 steps, so if the last one is the only box checked, it should still be at 25% complete.
Thanks,
Pete
Hello Developers!
I have a simple trigger which is working fine but I have little trouble in test cases:
Few things to consider:
Master Object: Volunteer_Project__c
Child Object: Participation__c
Trigger:
Trigger UniqueEmailCount On Volunteer_Project__c(before insert, before update)
{
    List<Participation__c> ParticipationList = new List<Participation__c>();
    Set<String> uniqueEmails = new Set<String>();
    
    ParticipationList = [SELECT Volunteer_Email__c FROM Participation__c where Volunteer_Project_Name__c IN :Trigger.New];

        for (Integer i = 0; i< ParticipationList.size(); i++)
        {
            uniqueEmails.add(ParticipationList[i].Volunteer_Email__c);
          
        }
        
        for(Volunteer_Project__c proj: Trigger.new)
        {
            proj.Total_Associated_Volunteers__c = uniqueEmails.size();
        }
}
Test Cases: (NOT GETTING ANY COVERAGE)
@isTest
Public class UniqueEmailCount_Test{
    Public Static TestMethod Void TestingUniqueEmailCount(){
        
        Set<String> uniqueEmails = new Set<String>();
        List<Participation__c> partiList = new List<Participation__c >();
        for(Integer I = 0; I < 200; I++)
        {
            Participation__c Parti = New Participation__c (Volunteer_Name__c = 'Person:' + i, Volunteer_Project_Name__c = 'Project:' + i
                                                , Devoted_Hours__c = 1);   
            partiList.add(Parti);
            
        }
       insert partiList;
        
        for (Integer k = 0; k< partiList.size(); k++)
        {
            uniqueEmails.add(partiList[k].Volunteer_Email__c);
          
        }
        
        List<Volunteer_Project__c> vp = new List<Volunteer_Project__c>();
        vp = [Select Total_Associated_Volunteers__c from Volunteer_Project__c];
         
         for (Volunteer_Project__c vp1: vp ){
          // system.assetEquls(vp1.Total_Associated_Volunteers__c, uniqueEmails.size());
         }
        
    }

}
Note: Volunteer_Email__c is a formula field on child Participation__c. This field is catching emails from contacts.

 
Hi, 
 Im new to visualforce and Im trying to understand why I cant iterate through the quote line items using the apex:repeat tag in the below SOQL:
 
<apex:page controller="myquote" showHeader="false" sidebar="false" >
  <apex:stylesheet value="{!URLFOR($Resource.advancedpdfresource, 'qstyles.css')}"/> 

    <apex:repeat value="{!quote}" var="qli">
        <apex:dataTable value="{!qli}" var="q" > 
            <apex:column style="border: 1px">
                <apex:facet name="header">Quote Line Item</apex:facet>
               <apex:outputText value="{!q.quotelineitems.description}"/> 

            </apex:column>
        </apex:dataTable>
    </apex:repeat>

</apex:page>

<!----Controller----->
public class myquote {

List <Quote> quote= [Select id, name, BillingAddress, BillingName, quotenumber,(SELECT id, Description, ListPrice, PricebookEntry.name, PricebookEntry.ProductCode, TotalPrice, Quantity FROM quotelineitems)  from QUOTE WHERE id=: ApexPages.CurrentPage().Getparameters().get('id')];
   
public List<Quote> getquote () {
      return quote;}          
      
                     }

 
  • October 19, 2016
  • Like
  • 0

User-added image

I am trying to update these numbers (sorting). If i provide the same number it should give me an error only when i click the update button. Please find my APEX Code as below

User-added image

I have defined the data type as integer but it is giving the error as above and it should message me that if it is true or false on the visual force page. Can you please suggest.

I have two custom picklist fields (both fields are a range of numbers). My customer wants a funnel graph of the product of the selected values of these two fields.
EX: Picklist 1 = 4 and Picklist 2 = 8, resulting product = 32

Can this be done? If so, how?

Thank you for your help!
Hi,

I created an apex class to delete Account List record which has no Account List Items when I execute the class, it's not deleting the Account List with no Account List Item records.

Objects involved.

Account_List_vod__c - is the master of object Account List Item (Account_List_Item_vod__c)

Affiliation_vod__c - this object has no relation at all to Account List and Account List Item objects.


Requirements:

1. Get all the active users with Profile name that contains Eisai_Epilepsy or Eisai_PrimaryCare then order by Profile name.
2. Put all the active result query to a set.
3. Query all Account List records where ownerId is in the Active user set.
4. Iterate or loop on the Account List records, check if the Account_List_Item_Count__c field is less than 1 (No account list item records), then add it to a list named accListToDelete.
5. Lastly, delete all the records inside accListToDelete.

I think my logic is partly correct but I am just new in apex coding. Actually, this is the first time I tried to code.

Below is the actual code
.Delete Class


Actual code:

public class Eisai_AccountListDeletion_cls {
    Set<Id> userIdsSet = new Set<Id>();
    List<User> activeUSerList;
    List<Account_List_vod__c> accListRecsList;
    List<Account_List_Item_vod__c> accListItem;
    List<Account_List_vod__c> accListToDelete = new List<Account_List_vod__c>();
   
    //1st block
    public Set<Id> getActiveUserIds(){
       
            activeUSerList = new List<User>([SELECT Id,Profile_Name_esi__c
                                             FROM User
                                             WHERE (Profile_Name_vod__c LIKE '%Eisai_Epilepsy%' OR Profile_Name_vod__c LIKE '%Eisai_PrimaryCare%') 
                                             AND IsActive = TRUE ORDER BY Profile_Name_vod__c]);
       
            for(User userIds : activeUSerList){
                userIdsSet.add(userIds.Id);
            }
        System.debug('User id: ' + userIdsSet);
        return userIdsSet;
    }//end of 1st block
   
    //2nd block
    public void getAccListRecords(){
       
    Integer count = 1; 
    accListRecsList = new List<Account_List_vod__c>([SELECT Id, Name, Icon_Name_vod__c, Account_List_Item_Count__c
                                                    FROM Account_List_vod__c
                                                    WHERE Name ='HO_RADY\'S CHILDREN\'S UCSD' AND OwnerId In: userIdsSet]); 
       
            for(Account_List_vod__c accListRec : accListRecsList){
                    if(Integer.valueOf(accListRec.Account_List_Item_Count__c) < count){
                        accListToDelete.add(accListRec);
                    }else{
                        System.debug('-----Cannot delete Account List record as it has Account List Item records-----');
                    }
            }
        delete accListToDelete;
    }//end of 2nd block
}
 
Thank you.
Marion
I am currently getting an error 'Unknown property 'Feature_Request__cStandardController.ofrJO'' on a visualforce page I am trying to implement. I followed a design I had from a wrapper class that worked for me prior but in this case I only want to have the command button be on a specific line. I don't think this is the issue but I would really love some help from the community on resolving the issue. Thanks in advance!

Visualforce Page:
 
<apex:page StandardController="Feature_Request__c" extensions="FeatReqOppJunctionExtension">
		<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="table"]').DataTable({
                    
                });
            });
    </script>            
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockButtons>
            </apex:pageBlockButtons>
            <!-- In our table we are displaying the cContact records -->
            <apex:pageBlockTable value="{!ofrJO}" var="ofr" id="table" style="tablesorter">
                <apex:column headerValue="Action">
                    <!-- This is our selected Boolean property in our wrapper class -->
                    <apex:commandButton value="{!ofr.selected}"/>
                </apex:column>
                <!-- This is how we access the contact values within our cContact container/wrapper -->
                <apex:column value="{!ofr.fr.Name}" />
                <apex:column value="{!ofr.fr.Description_of_Request__c}" />        
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Apex: 
 
public with sharing class FeatReqOppJunctionExtension {

        //Our collection of the class/wrapper objects cContact 
    public Opportunity theOpp {get; set;}
    public Feature_Request__c FeaReq {get; set;}
    public Opportunity_Feature_Request__c oppFR {get; set;}
    public List<ofrJO> featReqList {get; set;}
    
    public FeatReqOppJunctionExtension(ApexPages.StandardController controller) { 

        String oppId = ApexPages.currentPage().getParameters().get('oppId');
        theOpp = [select Id from Opportunity where Id =:oppId limit 1];
    }
    
    public List<ofrJO> getFeatReq() {
        if(featReqList == null) {
            featReqList = new List<ofrJO>();
            for(Feature_Request__c fr: [select Id, Name, Description_of_Request__c
                            from Feature_Request__c
                            ]) {
                featReqList.add(new ofrJO(fr));
            }
        }
        return featReqList;
    }
    
        public PageReference insertRec() {
        
        for(ofrJO freq: getFeatReq()) {
            if(freq.selected == true) {   
                Opportunity_Feature_Request__c OppFeatReq = new Opportunity_Feature_Request__c();


                OppFeatReq.Opportunity__c = theOpp.Id;
                OppFeatReq.Feature_Request__c = freq.oppFR.Id;
                //OppFeatReq.add(nal);
            	insert OppFeatReq;
            }
            
        }
            
        return new PageReference('/apex/quoteEditAssociatedSite?quoteId='+ApexPages.currentPage().getParameters().get('quoteId'));
    }
    
        public class ofrJO {
        public Feature_Request__c FeaReq {get; set;}
        public Opportunity opp {get; set;}
        public Opportunity_Feature_Request__c oppFR {get; set;}
		public Boolean selected {get; set;}
   		
        public ofrJO(Feature_Request__c fr){
            FeaReq = fr;
        }
            
       	public ofrJO(Opportunity o){
            opp = o;
        }        
        
        public ofrJO(Opportunity_Feature_Request__c ofr){
            oppFR = ofr;
    	}
         
    }   
}

 
Hi,

I have a page with checkbox included in it.When this checkbox is selected,it should run the validation rules and display the error messages accordingly.When this checkbox is not selected,it should skip the validation rules and the record should save without displaying errors.

How can i achieve this requirement using before triggers??

Your answers will be highly helpful.
I was adding in an additional section & I think I messed up the ending with the Catch exception.  It was working fine before I added in the section for Creative BQA & not it's not firing for any of the items. I think I erased some part of the catch exception & didn't get it correct.  I was able to get it to where it would save, but it doesn't seem to be firing to make the changes requested.  
ANY help would be greatly appreciated.
Thanks!
Here is my code: 

trigger TaskTrigger on Task (before insert) {

    try{
    boolean active = [Select Active__c from TriggerOptions__c where Name = 'DisplayTaskTrigger' limit 1].Active__c;
    
    
   
    if(active==true){
        for(Task t:Trigger.New){
            try{
                // if Subject = "AO - Advertiser Tagging & QA" then recordtype is "Ad Tag & QA"
                ID adTagQATypeID = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Ad Tag & QA').getRecordTypeId();
                if(t.Subject=='AO - Advertiser Tagging & QA'){
                    t.RecordTypeId=adTagQATypeID;
                    if(Schema.SObjectType.Task.isUpdateable()){
                         update t;
                    }
                   
                }
                
                // if Subject = "AO - Technical QA  " then recordtype is "Technical QA"
                ID technicalQATypeID = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Technical QA').getRecordTypeId();
                if(t.Subject=='AO - Technical QA'){
                    t.RecordTypeId=technicalQATypeID;
                    if(Schema.SObjectType.Task.isUpdateable()){
                         update t;
                    }
                   
                }
                
                // if Subject = "AO - Setup Network Pixels" then recordtype is "Pixel Setup"
                ID pixelSetupTypeID = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Pixel Setup').getRecordTypeId();
                if(t.Subject=='AO - Setup Network Pixels'){
                    t.RecordTypeId=pixelSetupTypeID;
                    if(Schema.SObjectType.Task.isUpdateable()){
                        update t;
                    }
                } 
                 // if Subject = "AM - Creative BQA" then recordtype is "Creative BQA"
                ID creativeBQATypeID = Schema.SObjectType.Task.getRecordTypeInfosByName().get('Creative BQA').getRecordTypeId();
                if(t.Subject=='AM - Creative BQA'){
                    t.RecordTypeId=creativeBQATypeID;
                    if(Schema.SObjectType.Task.isUpdateable()){
                        update t;
                   }                    
                }
 } catch(Exception e){
        system.debug(e);}  
    
    
    }
    }
    
} catch(Exception e){
        system.debug(e);}
}
IF(ISPICKVAL(StageName, "CLOSED_WON:_INACTIVE") , DATEVALUE(LastModifiedDate) - CloseDate, null)
I am attempting to create a Visualforce page that allows the user to select a contact from a lookup field on a custom object to the contacts object. I am surely missing something silly. Your help would be super.
 
<apex:page standardController="Contact_Plan__c">
    <apex:pageBlock >
        <apex:pageBlockSection>
            <apex:form>
            
                <apex:inputField value="{! Contact_Plan__c.name}"/>     
                <apex:inputField value="{! Contact_Plan__r.Contact.Name}"/>
            </apex:form>
       </apex:pageBlockSection>
</apex:page>

The page would allow for the individual to enter the Contact Plan Name and then Select a Contact from the Contact Object. I have created a custom object called Contact_Plan__c.

Your help is greatly appreciated in advance.

Robert
This test class is only getting 33% coverage, and I know it must have something to do with this line in the controller, but I am not sure how to get this covered.
list_of_accountmanagement = new List<string>{'Key (WIG)','Active Project','Active Opportunity > $50K','Partner-Managed','TAM-Managed','TSE-Managed (Tech Support)','Inactive'};

The bolded/underlined parts of the extension are what are not covered.
 
public final Account accounts;

    Public MAP<String,LIST<Account>> accsBucketedByType{get;set;} 
    public List<string> list_of_accountmanagement{get;set;}
    public ColumnControllerExt(ApexPages.StandardController stdController) {
    list_of_accountmanagement = new List<string>{'Key (WIG)','Active Project','Active Opportunity > $50K','Partner-Managed','TAM-Managed','TSE-Managed (Tech Support)','Inactive'};
    accsBucketedByType = new Map<String, List<Account>>();
    }
    public map<string,List<account>> getmap_values(){
        accsBucketedByType .put('Key (WIG)' ,[Select 

Id,name,Opportunity_Order_Status__c,NPS_Status__c,Case_Status_Stoplight__c,MSA_Status__c,Version_Status__c,Risk_Status__c,Team_Management_Status__c,Overall_Status__c,Total_RR_Converted_to_USD__c,Account_Management_Type__c,x3re__c from Account where 

Account_Management_Type__c =: 'Key (WIG)'order by Name]);

Here is the test class:
@isTest
private class TEST_ColumnController {
	
	static testMethod void ColumnController_test1() {

 Profile p = [SELECT Id FROM Profile WHERE Id='xx'];

//create dummy User
  User u = new User(Alias = 'testcc', Email='PopulateCountry@testorg.com', EmailEncodingKey='UTF-8', 
  LastName='Testing', LanguageLocaleKey='en_US', LocaleSidKey='en_US', Department = 'Some Department',
  ProfileId = p.Id, TimeZoneSidKey='America/Los_Angeles', UserName='PopulateCountry@testorg.com');       
  insert u;
  System.assert(u.Id != null);

//Create dummy accounts
    Account acc = new Account(Name = '1',Type = 'Customer',OwnerId = u.Id);
     
    insert acc; 

    Test.startTest();
    Test.setCurrentPage(Page.MyPage);

// create a new Account standard controller by passing it the account record
    ApexPages.StandardController controller = new ApexPages.StandardController(acc);

    // now pass it to the extension
    ColumnControllerExt stdController = new ColumnControllerExt(controller);

    system.assert(stdController != null); // controller has successfully been created

    
    Test.stopTest();
  }
}
Thanks for any help.
 
Hi,

We are in the process of migrating to Lightning and are building components in Lightning but since we are not yet completly ready to migrate, we are using Lightning out feature and visualforce to embed a Lightning component within a visualforce page and display in Classic. 
It works in Chrome and Firefox but is not displaying in IE11. 

- we have checked the box to extend the IE support for Lightning 
- Whitelisted both *.force.com and *.salesforce.com

When I check the dev logs in IE I see some java errors. 

What am I doing wrong? 

Thank you for all your help.
  • May 21, 2018
  • Like
  • 0
Hello Everyone,
Our users use Task with attachments all time and have an issue with Task notifications emails when task attachment size is over 10MB.
Users create a task and attach files to task and try to save it, if the attachments size is over 10 MB and "Send Notification Email" is checked. They get error "Cannot send email because the total attachment size is XXMB over 10MB".

Is there any way to just send email notifications without any attachments? 
  • June 30, 2017
  • Like
  • 0
Hello All,

We have created a lookup filter on a custom object. It works for all other users in a profile as expected , except for one user. The object permission is public read/write and there are no permission sets or field level security preventing user from viewing records. If we remove the lookup filter the same user can see all the records. 
Any idea what is going on and how to fix it? 
Thank you
  • February 27, 2017
  • Like
  • 0
We have implemented Salesforce IP based condition Two-factor Authentication with login flow. The flow bypasses two factor authentication if the user is logging in from our Corporate IP range and challenges user only if they are logging in from outside of the corporate IP range
 
While testing we noticed that when Profile is included in a login flow and Session Level Settings is set to “High Assurance” we cannot access Data Loader and Force.com IDE.
Force.com IDE gives the error “SESSION_INVALID_ID: Session is not valid to use with API -  two factor authentication and Force.com IDE”.
Workaround is to set the session level setting to “None”. But this will not challenge the user with Two-Factor Authentication with Salesforce Authenticator app every time.

Any suggestion is greatly appreciated. Thank you

 
  • January 12, 2017
  • Like
  • 0
Need some help to create a login flow which will force logout users logging in from outside of US. Any suggestions? thanks
  • January 04, 2017
  • Like
  • 0
Hi, 
I would like to force download a .tiff file on clicking a link.
Customer clicks on a link to make a call to external web service which returns .tiff file. I want to force the file to download in Visualforce page.
We do not want to save the file in Salesforce.

Thanks in advance
 
  • September 04, 2015
  • Like
  • 0
Hi,

We are in the process of migrating to Lightning and are building components in Lightning but since we are not yet completly ready to migrate, we are using Lightning out feature and visualforce to embed a Lightning component within a visualforce page and display in Classic. 
It works in Chrome and Firefox but is not displaying in IE11. 

- we have checked the box to extend the IE support for Lightning 
- Whitelisted both *.force.com and *.salesforce.com

When I check the dev logs in IE I see some java errors. 

What am I doing wrong? 

Thank you for all your help.
  • May 21, 2018
  • Like
  • 0
Hi

We have a visualforce section on all of our Opportortunity page layouts.
This section shows a particular image depending on what has been selected within the stage field.
Below is a sample of the code that we have in place.
Is it possible to split it up so that depending on which Opportunity Record Type is selected different images can be displayed against each stage?

For example if record type = X and the stage is Closed Won then show image A
If record type = Y and the Stage is closed Won then show image B

Thank you
 
<apex:page standardController="Opportunity" showHeader="true" sidebar="true">

<div align="center">

></apex:image> <apex:image id="won" value="{!$Resource.stageWon}" height="60" rendered="{!Opportunity.stageName = 'Closed Won'}"

 ></apex:image> <apex:image id="lost" value="{!$Resource.stageLost}" height="60" rendered="{!Opportunity.stageName = 'Closed Lost'}" 

</div>

</apex:page>

 
Hello awesome devs!

I am attempting to create a VF page with 4 fields for user inputting.  2 of these fields are Date fields which when filled in like MM/DD/YYY when I press the search button to call my custom controller the date in the field populated has its format changed to Tue Dec 26 00:00:00 GMT 2017 and doesnt seem to be being applied in the search itself as all records are returned and not ones just for the date entered. 

Can someone help me with gettign the format to stay as I think this is the cause of the date field not being used in the search criteria. 

Please see my VF Page and controller code below. 

Thank you very much for any help you can provide,

Shawn

VF Page Code - 
 
<apex:page controller="SubSearchController">
    
    <apex:form>
    	<apex:pageBlock id="pb">
        	<apex:pageBlockButtons>
                <apex:commandButton action="{!searchRecords}" value="Search" rerender="pb"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:outputLabel value="Account Id" />
                <apex:inputText value="{!AccId}"/>
                <apex:outputLabel value="Status" />
                <apex:inputText value="{!SubStatus}"/>
                <apex:outputLabel value="Service Activation date" />
                <apex:inputText value="{!SAD}"/>
                <apex:outputLabel value="Term End Date" />
                <apex:inputText value="{!TermEnd}"/>
            </apex:pageBlockSection>
            <apex:pageBlockTable var="record" value="{!records}" id="pbTable">
                <apex:column value="{!record.Name}" />
                <apex:column value="{!record.Zuora__Status__c}" />
                <apex:column value="{!record.Zuora__ServiceActivationDate__c}" />
                <apex:column value="{!record.Zuora__TermEndDate__c}" />
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
    
</apex:page>

Controller Code -

public class SubSearchController {

    public String AccId {get;set;}
    public String SubStatus {get;set;}
    public Date SAD {get;set;}
    public Date sadDate = Date.valueOf(SAD);
    public Date TermEnd {get;set;}
    public Date TermDate = Date.valueOf(TermEnd);
    
    public List<Zuora__Subscription__c> records {get; private set;}
    
    public SubSearchController(){
        records = new List<Zuora__Subscription__c>();   
    }
    
    public PageReference searchRecords() {
        
        records = [SELECT Zuora__Account__c, Zuora__Status__c, Zuora__ServiceActivationDate__c, Zuora__TermEndDate__c, OpportunityId__c, Total_Booking_Amount__c, Id, Name
                  FROM Zuora__Subscription__c WHERE Zuora__Account__c = : AccId AND Zuora__Status__c = : SubStatus AND (Zuora__ServiceActivationDate__c = : sadDate OR Zuora__TermEndDate__c = :TermDate)];
        return null;
        
    }
    
}

 
Hi Everyone,
 I'm trying a simple test
1. passing in a custom field (datetime) from my VF page to my apex controller.
2. take the datetime value passed and reassing it to a new datetime variable
3. convert datetime value in variable to string and have it re-rendered in my pagblocksection

When the action method is called, assigning that custom field datetime value seems to be throwing an exception. Pulling my hair out. Not sure where I've messed this up or misunderstood how this is suppose to work. Thanks in advance! 
 
<apex:page standardController="Booking__c" extensions="testing7">
    <apex:form>
        <apex:pageBlock>
        <apex:pageBlockSection>
            <apex:inputfield value="{!Records.Start_Date_Time__c}">
            <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
            </apex:inputfield>
        </apex:pageBlockSection>
            
        <apex:pageBlockSection columns="1" id="D1">          
            <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
            <apex:column value="{!sd}"/>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing7 {
    public Booking__c Records{get;set;}
    public String Sdate{get;set;}
    public Datetime DT{get;set;}
    public Boolean FlagH{get;set;}

    public PageReference UpdateSitter(){
        FlagH=true;
        try{ 
            DT = Records.Start_Date_Time__c;  //throwing an exception on this line
            Sdate=String.ValueOf(DT);
           }catch(System.NullPointerException e){
              Sdate='fail';
           }
        return null;
    }
    
    public testing7(ApexPages.StandardController controller)  {}
    
}

 
Hi,

Please can someone help with with an Apex scheduled trigger or guide me in the right direction.

I have the below custom fields in Salesforce :
Date field >> 'Renewal date'
Pick list  >>  'Account Type' 
Pick list  >>  'Contract Type' 
Text Field >> 'Product 1 Delivered'
Text Field >> 'Product 2 Delviered' 

The Trigger is to run daily

I've tried to explain the query logic as best as i can below.
 
IF 
     Renewal date = Today
              AND
      Contact Type = "Auto-Renew"
             AND
( Account Type = 'Active Client' - OR - 'On-Hold Client' )



THEN,
           UPDATE 'Product 1 Delivered' = 0,
           UPDATE 'Product 1 Delivered' = 0,
           UPDATE Renewal date = Renewal date + 365
. i.e next year



I'd also love if there was a way to send out an email alert or chatter post; however this is secondary.

I hope this make sense.....

I dont know enough APEX to do this yet. Any help will be highly appriciated.

Thank you
Hi,
I would like to figure out how to create a formula field that would evaluate stages and set a "phase" based on the stage.
Alternatively, I'd be OK with the Phase being a picklist, but updated from a workflow rule.

So if stages are Planning, Kick-off, Discovery, Software, Data, Training, & Closing, I would want the "phase" field to be set appropriately.

So if stage is in Planning OR Kick-off, then Phase is "Project Planning";
if stage is Discovery OR Software OR Data, then Phase is "Tech"; 
if Stage is Training OR Closing, then Phase is "Closing".

Does anyone have any suggestions?
Thanks!

Please help.

I have one field called "Installation Date" and another field called "Original Installation Date".
Currently the Original Installation Date field is mimicking the Installation date field, however need to now put something in place that makes the Original Installation Date field only update once no matter how many time the Installation Date field gets updated.

 


 

 

Trying to write a Validation Rule for a Custom Field on a Custom Object to handle this scenario --- If a Lookup Field is not populated, then a Picklist field and a Text field are required to be populated --- but not prevent this scenario --- If the Lookup Field is populated, then the Picklist may be updated (but is not required), and the Text Field should not be populated.

Tried coming at it a couple different angels and can't get it right. Any thoughts?
How can I get around the aggregrate query error? When I tried taking out the For loop- the execution then failed. Is there a better way to do it?

global class Batch_ExpDate_PricIn implements Database.Batchable<sObject>,Database.Stateful
{
   global Database.QueryLocator start(Database.BatchableContext BC)
   {
        string manualExpStr = 'Manually Expired'; //Correct Status -11/2/16 MT
        string expiredStr = 'Expired'; 
        
        string query= 'select Id,RecordTypeId,RecordType.Name,Par_Status__c,Effective_date__c,Expiration_Date__c,(select Id,Expiration_Date_Change_To__c,Effective_date__c from Pricing_Inputs__r) from Price_Authorization_Request__c where Par_Status__c !=:manualExpStr  and Par_Status__c !=:expiredStr';
             return Database.getQueryLocator(query);
   }

   global void execute(Database.BatchableContext BC, List<Price_Authorization_Request__c> Parlist) {
            
       if(Parlist != null && !Parlist.isEmpty())
       {
              Map<String,string> maprecTypewithId = new Map<String,String>();
           List<Price_Authorization_Request__c> listPARToUpdate = new List<Price_Authorization_Request__c>();
           for(RecordType rec : [select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c']) //-->system does not like this
           {
               maprecTypewithId.put(rec.Name,rec.id);
           }
           
           
           for(Price_Authorization_Request__c parObj : Parlist)
           {
            if(parObj.Pricing_Inputs__r != null && !parObj.Pricing_Inputs__r.isEmpty())
            {
                 Integer count = 0;
                 for(Pricing_Input__c PrcInputObj : parObj.Pricing_Inputs__r)
                 {
                    
                    if(PrcInputObj.Expiration_Date_Change_To__c != null && PrcInputObj.Expiration_Date_Change_To__c < system.today())
                    {
                        count = count + 1;
                    }
                 }
                 
                 if(count ==(parObj.Pricing_Inputs__r).size())  
                 {
                    parObj.Par_Status__c = 'Expired'; 
                  //  parObj.Expiration_Date__c=Date.valueOf(System.Today());
                    if(parObj.RecordType.Name == 'Standard PAR' && maprecTypewithId.get('ReadOnlyStandard PAR') != null)
                      parObj.RecordTypeId = maprecTypewithId.get('ReadOnlyStandard PAR');
                    else if(parObj.RecordType.Name == 'Formula PAR' && maprecTypewithId.get('ReadOnlyFormula PAR') != null)
                      parObj.RecordTypeId = maprecTypewithId.get('ReadOnlyFormula PAR');
                    listPARToUpdate.add(parObj);
                 }
            }
              
           }
           
           if(!listPARToUpdate.isEmpty())
               update listPARToUpdate;
       }
   }
    
    global void finish(Database.BatchableContext BC)
    {}
 }
 I've tried to put my query directly in a list and then loop through the list but I'm getting an error invalid value type list for list.

Map<String,string> maprecTypewithId = new Map<String,String>();
           List<Price_Authorization_Request__c> listPARToUpdate = new List<Price_Authorization_Request__c>([select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c']);
           for(RecordType rec : listPARToUpdate)
           {
               maprecTypewithId.put(rec.Name,rec.id);
           }

However, If I try it this way - I get the aggregrate query FOR loop error (due to large recrod set) 

Map<String,string> maprecTypewithId = new Map<String,String>();
           List<Price_Authorization_Request__c> listPARToUpdate = new List<Price_Authorization_Request__c>();
           for(RecordType rec : [select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c'])
           {
               maprecTypewithId.put(rec.Name,rec.id);
           }

What is the best way to achieve this - without exceeding governor limits?

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.