• Antonio Jesús Criado Manzaneque
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 3
    Replies
*/trigger FirstContactResolution on Case(before insert,before update){/*
/*	*/for(case c:Trigger.New){//Trigger.New grabs updated information/* 
/*    	*/dateTime now=System.Now();//Assess current time to be used throughout this trigger/*
/*//Phone/Chat-First Contact Resolution Logic/*
* 		*/if(c!=null){
/*			*/if((c.Origin.contains('Phone')||c.Origin.contains('Chat'))&&(!c.Origin.contains('CP')))/*
 *			*/{/*
 *				*/if(c.Status=='Solved'){/*
 *	    			*/if(Trigger.isUpdate){/*
 *						*/c.ElapsedTime__c=/*
 * 	   					*/(Double.valueOf(now.getTime())-Double.valueOf(c.createddate.getTime()))/1000/60;/*
 * 	   					//Current datetime minus createdDate, convert to minute format from milliseconds
 * 	   					*/if(c.ElapsedTime__c<61){/*
 *      	    			*/c.First_Contact_Resolution__c=True;/*
 *          	    		*/c.First_Solve_DateTime__c=now;/*
 *          			*/}else{c.First_Contact_Resolution__c=False;}/*
 *					*/}/*                                                            
 *      			*/if(Trigger.isInsert){/*
 *						*/c.ElapsedTime__c=0;/*
 *						*/c.First_Contact_Resolution__c=True;/*
 *    					*/c.First_Solve_DateTime__c=now;/*
 *					*/}/*	  
 *				*/}else{c.First_Contact_Resolution__c=False;}/*
 *	 	 	*/}/*
 *		*/}/*
 *	*/}/*

 
My code is something like that:
<apex:page renderAs="pdf" standardController="Account" extensions="CNT_Generar_InfoAbante" sidebar="false" showHeader="false" applyBodyTag="false" >
    
    <head>
        <style type="text/css" media="print">
            #contenedorBody {
                column-count: 2;
                column-width: 100px;
                column-gap: 20px;
                text-align: justify;
                width: 100%;
                height: 1018px;
                max-width: 100%;
                max-height: 1018px;
            }

            .contenedorFooter {
                width: 100%;
                height: 48px;
                max-height 48px;
                /* background: rgb(255, 220, 206); */
            }
        </style>
    </head>
    <div id="contenedorBody">
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div>
    <div class="contenedorFooter">
        <table>
            <tr>
                <td class="width70">&nbsp;</td>
                <td class="width30"><apex:image styleclass="imgFooter" width="145" height="46" value="{!$Resource.imgLogo}"/></td>
            </tr>
        </table>
    </div>
</apex:page>

But still displaying this:
User-added image

But this is what I want:
User-added image

Thank you all.
My object Case has two picklist fields:
  • Entidad__c with three possible values: Customer, Reservation and Program.
  • Tipo__c with six possible values: Customer A, Customer B, Reservation A, Reservation B, Program A and Program B. This field depends on Entidad__c value.
I am getting both field values in my Controller but I want to get Tipo__c values filtered by Entidad__c.
Schema.DescribeFieldResult fieldResult = Case.Tipo__c.getDescribe();
List<Schema.PicklistEntry> plv = fieldResult.getPicklistValues();
		
for( Schema.PicklistEntry f : plv){
      system.debug(f.getLabel() + ' - ' + f.getValue());
}
This code give me all the values, regardless of the value of field type__c. How can I get its values filtered?

Thank you all.
I am developing a VF for a Quick Action button (Salesforce Classic Publisher) and I am using standardController to load my inputfield (possible picklist values with the '--None--' value as default).
<apex:page standardController="Case" extensions="Apex_Controller__c"/>
<apex:inputField value="{!Case.MiCampo__c}" required="true" id="entidad"/>
It works properly but when I access to my VF from another Case object the inputField take its value from the parent object as default.
How can I prevent this?

Thank you all.
Hi, I'm trying to print a search field on a Visualforce Page that allows the user to choose any account he wants. Something like that:

http://salesforce.stackexchange.com/questions/66583/create-visualforce-input-that-uses-lookup-popup
User-added image

The problem is that I could not see all the accounts because I'm reusing a Contact field (AccountId). Does anyone know any way to print a input/search field that could allow me to do this? Thank you all!
Hi! There is a bug with the lookup filters in Salesforce when you mix two objects. For example, I am using Account and Contact to describe a personal account but when I search results for the lookup fields of Contact they don't work so the user could pick whatever he wants. Does somebody know some way to avoid this situation and let them work? Thank you all.
I'm trying to get an outputlabel to change its value but it's turning me crazy, somebody could help? thanks
 
<apex:page>
<apex:form id="theForm">
        <apex:pageBlock id="thePageBlock">
            <apex:repeat value="{!servicios}" var="servicio" id="theRepeat">
            
            <script type="text/javascript">
				//alert('Cliente: {!servicio.id}');
				document.getElementById('page:theForm:thePageBlock:theRepeat:0:motivo').value = 'PROBANDO';
				
			</script>
                <table>
                    <tr> 
                        <th><apex:outputText value="{!servicio.mel_rel_proveedor__r.name}" id="theValue"/></th>
                        <th></th>
                        <th><apex:commandButton value="Boton 'Interesado'" action="{!prueba}"/></th>
                    </tr> 
                    <tr>
                        <th class="cabeceraServicio">{!servicio.name}</th>
                        <th class="cabeceraServicio"></th>
                        <th style="display:none;" class="cabeceraServicio"><apex:commandButton value="Boton 'Interesado'"/></th>
                    </tr>
                    <tr>
                        <td>Ofrecido</td>
                        <td><input type="checkbox" id="cbox1" value="ofrecido"/></td>
                    </tr>
                    <tr>
                        <td>Cliente interesado</td>
                        <td><apex:outputLabel value="" id="interesado"/></td>
                    </tr>
                    <tr> 
                        <td>Motivo No Interesado</td>
                        <td><apex:outputLabel value="" id="motivo"/></td>
                    </tr>
                </table>
            </apex:repeat>
	       		     
          
        </apex:pageBlock>
        
    </apex:form>
</apex:page>



 
I am working with some input fields (apex:inputField) and I want to show an standard error message ('You must enter a value') but I want it with its translation, so I would like to introduce this error as a parameter in my Apex class.

eg. currently using: 
Apexpages.addMessage(new ApexPages.Message (ApexPages.Severity.ERROR, Case.MEL_SEL_Subtipo__c.getDescribe().getLabel()+': You must enter a value'));

I would like to use something like this: 
Apexpages.addMessage(new ApexPages.Message (ApexPages.Severity.ERROR, Case.MEL_SEL_Subtipo__c.getDescribe().getLabel()+ ***ApexPages.NoDataError.getContent()***));


Thank you.
Hello, 
I have been reading a post (https://developer.salesforce.com/forums/?id=906F0000000AualIAC) and actually Im having the same problem with the wsc-v37.0.3. I tried to solve this error with a lot of versions but I'm still having the same problem.
     1. "The method create(CustomObject[]) is undefined for the type MetadataConnection" at line 58
     2. "The method checkStatus(String[]) is undefined for the type MetadataConnection" at line 76

This is my class: github - (https://github.com/ajcriado/Metadata/blob/master/Metadata.java)
Thank you!
My code is something like that:
<apex:page renderAs="pdf" standardController="Account" extensions="CNT_Generar_InfoAbante" sidebar="false" showHeader="false" applyBodyTag="false" >
    
    <head>
        <style type="text/css" media="print">
            #contenedorBody {
                column-count: 2;
                column-width: 100px;
                column-gap: 20px;
                text-align: justify;
                width: 100%;
                height: 1018px;
                max-width: 100%;
                max-height: 1018px;
            }

            .contenedorFooter {
                width: 100%;
                height: 48px;
                max-height 48px;
                /* background: rgb(255, 220, 206); */
            }
        </style>
    </head>
    <div id="contenedorBody">
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
        tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
        quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
        consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
        cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
        proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div>
    <div class="contenedorFooter">
        <table>
            <tr>
                <td class="width70">&nbsp;</td>
                <td class="width30"><apex:image styleclass="imgFooter" width="145" height="46" value="{!$Resource.imgLogo}"/></td>
            </tr>
        </table>
    </div>
</apex:page>

But still displaying this:
User-added image

But this is what I want:
User-added image

Thank you all.
*/trigger FirstContactResolution on Case(before insert,before update){/*
/*	*/for(case c:Trigger.New){//Trigger.New grabs updated information/* 
/*    	*/dateTime now=System.Now();//Assess current time to be used throughout this trigger/*
/*//Phone/Chat-First Contact Resolution Logic/*
* 		*/if(c!=null){
/*			*/if((c.Origin.contains('Phone')||c.Origin.contains('Chat'))&&(!c.Origin.contains('CP')))/*
 *			*/{/*
 *				*/if(c.Status=='Solved'){/*
 *	    			*/if(Trigger.isUpdate){/*
 *						*/c.ElapsedTime__c=/*
 * 	   					*/(Double.valueOf(now.getTime())-Double.valueOf(c.createddate.getTime()))/1000/60;/*
 * 	   					//Current datetime minus createdDate, convert to minute format from milliseconds
 * 	   					*/if(c.ElapsedTime__c<61){/*
 *      	    			*/c.First_Contact_Resolution__c=True;/*
 *          	    		*/c.First_Solve_DateTime__c=now;/*
 *          			*/}else{c.First_Contact_Resolution__c=False;}/*
 *					*/}/*                                                            
 *      			*/if(Trigger.isInsert){/*
 *						*/c.ElapsedTime__c=0;/*
 *						*/c.First_Contact_Resolution__c=True;/*
 *    					*/c.First_Solve_DateTime__c=now;/*
 *					*/}/*	  
 *				*/}else{c.First_Contact_Resolution__c=False;}/*
 *	 	 	*/}/*
 *		*/}/*
 *	*/}/*

 
Hello, 
I have been reading a post (https://developer.salesforce.com/forums/?id=906F0000000AualIAC) and actually Im having the same problem with the wsc-v37.0.3. I tried to solve this error with a lot of versions but I'm still having the same problem.
     1. "The method create(CustomObject[]) is undefined for the type MetadataConnection" at line 58
     2. "The method checkStatus(String[]) is undefined for the type MetadataConnection" at line 76

This is my class: github - (https://github.com/ajcriado/Metadata/blob/master/Metadata.java)
Thank you!