• txmapp
  • NEWBIE
  • -1 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 9
    Replies

hi 

i want to know how can i connect my app to twitter

i have one custom object and now i want to create a custom button on the top of details that send me to vfpage and get some fields and post this fields and more informacion that the user can write  on twitter

 

can you help me

  • August 31, 2012
  • Like
  • 0

hi

i hope that yoo can help me

 

im new in force.com

 

my problem is that i want to copy or move all the attachments records to file or copy and convert

 

the main topic is that i want to make a search into the file actually i can't search into because it's on attachment 

 

i not sure if i need to move to file or documents but the requirement is move from attachments

 

i don't know if i need to create a trigger or class 

can some body give and example 

  • April 06, 2012
  • Like
  • 0

hi

i have a problem i hope you can helpme

 

i have a custom button that send me to vf page

my custom object is Aspirante__c that has a select list with a list of status

i dont know how to pass the id of the record that  send me to the page, im actually link it by jscrip with onclick

 

my requirement is click button update status and show me the new page with a select list with the status permited

after select click on the button save or update 

 

but i can't pass the value to the controller , 

also i want to show differ values in the select list this depend of the actual status of the record else 

 

for example

New to On Hold
new to Rejected
Rejected to interview
interview to Rejected
interview to on hold
interview to offer
interest not to interview
not to offer interest
accepted offer to
accepted to hire

 

 

this is my code, that not run  show me this 

Id not specified in an update call
<apex:page standardController="Aspirante__c" extensions="SelectController">
     <apex:sectionHeader title="Estatus" />
     <apex:form >
     <apex:pageBlock title="Aspirante" mode="edit">
 
         <apex:outputText value="{!Aspirante__c.Estatus__c}" rendered="false"/>
         
 
          <apex:pageBlockButtons location="both">
               <apex:commandButton value="Save" action="{!save}" />
               <apex:commandButton value="Cancel" action="{!cancel}" />
          </apex:pageBlockButtons>
          <apex:pageMessages />       
 
          <apex:pageBlockSection title="Master Categories" columns="1">
 
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Estatus" for="cbxlevel1"/>
                    <apex:outputPanel styleClass="requiredInput" layout="block">
                    <apex:outputPanel styleClass="requiredBlock" layout="block"/>
                    <apex:selectList value="{!selectedLevel1}" id="cbxlevel1" size="1" required="true">
                        <apex:selectOptions value="{!level1items}"/>
                        <apex:actionSupport event="onchange" rerender="cbxlevel2"/>
                    </apex:selectList>
                    </apex:outputPanel>
                </apex:pageBlockSectionItem>
 
                
          </apex:pageBlockSection>
 
     </apex:pageBlock>
     </apex:form>   
 
</apex:page>
             

 

public class SelectController {
 
    // reference for the standard controller
    private ApexPages.StandardController controller {get; set;}
 
    // the record that is being edited
    private Aspirante__c opp;
 
    // the values of the selected items
    public string selectedLevel1 {get; set;}
 
 
    public List<selectOption> level1Items {
        get {
            List<selectOption> options = new List<selectOption>();
 
                options.add(new SelectOption('','-- Elige un Estatus --'));
                options.add(new SelectOption('Nuevo','Nuevo'));
                options.add(new SelectOption('En espera','En espera'));
                options.add(new SelectOption('Rechazado','Rechazado'));
                options.add(new SelectOption('Entrevista','Entrevista'));
                options.add(new SelectOption('No Interesado','No Interesado'));
                options.add(new SelectOption('Oferta','Oferta'));
                options.add(new SelectOption('Aceptado','Aceptado'));
                options.add(new SelectOption('Contratado','Contratado'));
                
 
            return options;           
        }
        set;
    }
 
  
   
 
    public MultiSelectController(ApexPages.StandardController controller) {
 
        //initialize the stanrdard controller
        this.controller = controller;
        // load the record
        this.opp = (Aspirante__c)controller.getRecord();
 
        // preselect the current values for the record
        selectedLevel1 = opp.Estatus__c;
     
 
    }          
 
    public PageReference save() {
 
        // set the selected values to the record before saving
        opp.Estatus__c =selectedLevel1;
       
        try {
            //upsert(opp);
            update(opp);
        } catch(System.DMLException e) {
            ApexPages.addMessages(e);
            return null;
        }
        return ( new ApexPages.StandardController(opp).view());
    }        
 
}

 

 

  • March 28, 2012
  • Like
  • 0

hi

i have a error in this trigger

is for 2 objects that is related by a lookup filed or a master detail

Vacante__c , and Asignados __c here is the lookup field that search a Vacante__c

that i want to do is prevent delete a Vacante__c when there is one or more records of the object Asignados__c related to the record that i want to delete

 

trigger preventDelete on Vacante__c(before delete){

Set<ID> vacant = New Set<ID>();

For(Asignados__c a : [Select Vacante__c From Asignados__c Where Vacante__c IN :trigger.old])
     vacant.add(a.Vacante__c);

For(Vacante__c v : trigger.old){

   If(vacant.containsKey(v.ID))
      v.addError('You cannot delete this');

}





}

 but i get this error Method does not exist or incorrect signature: [SET<Id>].containsKey(Id)  

can somebody help me???

  • March 14, 2012
  • Like
  • 0

i have a trigger after delete

but it is not doing anything

i have 2 custom objects

Vacante__c  and Asignados __c

on the Asignados__c ithere is a master detail to the Vacante__c

 

i want to check when i want to delete a Record of Vacante__c if there are/is someone record Asignados__c that is related to my record that i want to delete

 

trigger deleteVacante on Vacante__c (before delete) {

  for(Vacante__c vac1 : Trigger.old){

   Vacante__c vac=[Select v.Id From Vacante__c v WHERE v.Id=:vac1.Id];

  String idvac=vac.Id;
  Asignados__c con = [Select a.Vacante__c From Asignados__c a WHERE a.Vacante__c=:idvac];

   if(con==null)
   delete con;

}

}

  • March 13, 2012
  • Like
  • 0

hi
i have a problem, with a vfp
recently i created a custom object Aspirante__c
then in the interface of this object add anew button that send me to one vfp
in this page a will update a loockup field
but i don't know how to pass the id od the record that i want to delete

the way that link the button with the page is with

window.location.href = "/apex/MyCustomLookup" when i created the button and then add on the format page

another problem is that i want to return to the prior page exactly of the record after that i click the button save
actually this redirect me but not update

this is my code

 

public with sharing class MyCustomLookupController1 {
    public String nombre {get;set;}
    public String vacante {get; set;}
    public String vacantebusqueda{get;set;}
   
     public Aspirante__c aspirante1 {get;set;}
    
     
    public Vacante__c oVacante{get;set;}
    
    public MyCustomLookupController1() {
    aspirante1= new Aspirante__c();
   

    }
    
    
    public void save() 
                {  
                    //consulta objeto aspirante al que voy actualizar  
                    Aspirante__c aspirante2 = [Select id, Name, Vacante__c from Aspirante__c where Id='a04d0000001phczAAA' Limit 1];//i want to take the id of the record
                 
                             
                  aspirante2.Vacante__c=aspirante1.Vacante__c; 
                 // aspirante2.Name=nombre;

                  update aspirante2; 
                 }  
    
}

 

<apex:page controller="MyCustomLookupController1" id="Page" tabstyle="Contact">
<apex:sectionHeader title="Aspirante"  subtitle="Asignar vacante" />

    <apex:form id="myForm">  
        <apex:PageBlock id="PageBlock">     
            <apex:pageBlockSection columns="1" title="Asignar vacante">
        <apex:inputField id="Vacante__c" value="{!aspirante1.Vacante__c}"  />
        
          
       <apex:commandButton action="{!save}" 
                value="Guardar"  onclick="history.go(-1);return false;"/>
            </apex:pageBlockSection>
        </apex:PageBlock>
    </apex:form>
       
</apex:page>

 

  • March 12, 2012
  • Like
  • 0

i want to update a lookup in my visual force page

 

i can search the parent record,but i can't save o update this values in the lookup field

i don't know how to get the value from de vfp 

 

My parent object Vacante__c

Child  Aspirante__c

 

public with sharing class MyCustomLookupController1 {
    public String nombre {get;set;}
    public String vacante {get; set;}
    String nameVacante;
   
  
    public Aspirante__c aspirante1 {get;set;}
    
     
    public Vacante__c oVacante{get;set;}
    
    public MyCustomLookupController1() {
    aspirante1= new Aspirante__c();
    oVacante=new Vacante__c();
    }
    
    
    public void save() 
                {
                    nameVacante=//VALUE THAT I SELECT FROM LOOKUP FIELD

                     Vacante__c oVacante=[Select Id,Name from Vacante__c where Name=:nameVacante];    
                      
                       
                   	Aspirante__c aspirante1 = [Select Name, Vacante__c from Aspirante__c where Name='Thomas'];
                             vacante =aspirante1.Vacante__c ;
                             nombre= aspirante1.Name;
                  
                   
                  
                           
                            aspirante1.Vacante__c=oVacante.Id;
                    //This will update the custom object
                   update aspirante1;
                 }  
    
}

 

   <apex:form id="myForm">  
        <apex:PageBlock id="PageBlock">     
            <apex:pageBlockSection columns="1" title="Asignar vacante">
        <apex:inputField id="Vacante__c" value="{!aspirante1.Vacante__c}"  />
         <P>Name: 
               <apex:inputText value="{!nombre}"/></P>
        <P>Vacante : 
               <apex:inputText value="{!vacante}"/></P>
          
        <P><apex:commandButton action="{!save}" 
                value="Guardar"/></P>
            </apex:pageBlockSection>
        </apex:PageBlock>
    </apex:form>

 

 

  • March 05, 2012
  • Like
  • 0

i created 2 custom objects ,the parent is Vacante__c, and the child es Aplicante__c, both are related by a lookup field .
on the related list that shows all the childs for the parent i want to create a new button or override the new button, when i click send me to other page, that show me a label with the name of the parent and a lookup field for search a child ,in this case Aplicante__c, i have created a VFP BUT the icon of lookup not appear ,

i want to make a select by name of the aplicante__c, and when i have the child required update this child, only the field Vacante__c on the object aplicaante__c, with the name or id of the actual parent, i dont know how is the lookup search if save the name of parent or id

im new in VF and apex

here is my code can someboby helpme?

 

actually  it run when i work with the field that is a lookup field, when i work with otre field example Name, not show me the lookup icon

only want search by a lookpup, of parent to child, and no like me code thar search of child to parent

 

public with sharing class MyCustomLookupController1 {
   
    public Aspirante__c aspirante {get;set;}

    public MyCustomLookupController1() {
    aspirante= new Aspirante__c();
    
    }
      
}

 my vfp

<apex:page controller="MyCustomLookupController1" id="Page" tabstyle="Contact">

  <script type="text/javascript"> 
  function openLookup(baseURL, width, modified, searchParam){
    var originalbaseURL = baseURL;
    var originalwidth = width;
    var originalmodified = modified;
    var originalsearchParam = searchParam;
    
    var lookupType = baseURL.substr(baseURL.length-3, 3);
    if (modified == '1') baseURL = baseURL + searchParam;
    
    var isCustomLookup = false;
    
    // Following "001" is the lookup type for Account object so change this as per your standard or custom object
    if(lookupType == "001"){
  
      var urlArr = baseURL.split("&");
      var txtId = '';
      if(urlArr.length > 2) {
        urlArr = urlArr[1].split('=');
        txtId = urlArr[1];
      }
      
      // Following is the url of Custom Lookup page. You need to change that accordingly
      baseURL = "/apex/CustomAccountLookup1?txt=" + txtId;
      
      // Following is the id of apex:form control "myForm". You need to change that accordingly
      baseURL = baseURL + "&frm=" + escapeUTF("{!$Component.myForm}");
      if (modified == '1') {
        baseURL = baseURL + "&lksearch=" + searchParam;
      }
      
      // Following is the ID of inputField that is the lookup to be customized as custom lookup
      if(txtId.indexOf('Name') > -1 ){
        isCustomLookup = true;
      }
    }
    
    
    if(isCustomLookup == true){
      openPopup(baseURL, "lookup", 350, 480, "width="+width+",height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no", true);
    }
    else {
      if (modified == '1') originalbaseURL = originalbaseURL + originalsearchParam;
      openPopup(originalbaseURL, "lookup", 350, 480, "width="+originalwidth+",height=480,toolbar=no,status=no,directories=no,menubar=no,resizable=yes,scrollable=no", true);
    } 
  }
</script>

<apex:sectionHeader title="Demo"  subtitle="Custom Lookup1" />

    <apex:form id="myForm">  
        <apex:PageBlock id="PageBlock">     
            <apex:pageBlockSection columns="1" title="Custom Lookup">
        <apex:inputField id="Aspirante__c" value="{!aspirante.Vacante__c}"  /> <!--i dont know how to work with other field that isn't lookup-->
            </apex:pageBlockSection>
        </apex:PageBlock>
    </apex:form>
       
</apex:page>

 

 

 

  • February 29, 2012
  • Like
  • 0

hi

i have 2 customs objects, job__c and applicant__c, in the applicant object is a lookup field to job object there is a relation one to many,

all of this is ok

but in the object job apear a list with all the applicants that has register on this job,here there is a button new, i want to override this button, when a click  show me a new window with the id of this job, and a lookup for search an applicant

and update the field job on applicant__c, and in the list that is show in the object job__c apear the applicant that i update

 

i need to create a visualforcepage

a class

 

i have problems to override the button, and to when i create new button, when i select  source of content in the piklist not apear my visualforcepages

 

 

can somebody helpme?

  • February 27, 2012
  • Like
  • 0

Hi

 i  have custom object winth a status field it 's a picklist with the values (new,on hold,rejected,interview,hire), i want to show only the values depend of the actual value,

or validate 

 

 

Possiblity to change the Status

 

From    To

new-  on hold

new-rejected

on hold-interview

interview-hire

interview-rejected

 

System should not allow to change the Status

 

From                To

on hold- new

rejected-new

interview-new

hire-new

hire-onhold

hire-rejected

 

 

i hear about state model but i don't know how ,can somebody help me??

 

  • February 27, 2012
  • Like
  • 0

i have a problem, i have 2 custom objects
job & applicant , the object job have wiht a lookup field that search one applicant object
and the object applicant also have another lookup field that search a job object
the problem is that i want to prevent delete a job if there are an
applicant that have a reccord with this job

i want to create a trigger
my idea is
1.- get the id of the job that i want to delete
2.- select all the applicant that have the same job in the field job of the applicant
3.- if the result of this select, like a count is >0 generate error "this job can't be delete because
there are applicants that is related with this job"
4.- if the result of the select , like a count is ==0 do nothing, allow to delete

the lookup fields aren't master details , is only a field that is not necesary and can be null when i insert a new record
im new in this topic and i don't know how to create this trigger

 

can somebody help me??

 

 

 

  • February 23, 2012
  • Like
  • 0

 i have 2 custom objects  Vacante__c and Aspirante__c, there are 2 lookup fields from Vacante__c to Aspirante__c and Aspirante__c to Vacante__c

 

i want to prevent delete a record of Vacante__c that is related with a Aspirante__c

this olny can be deleted when nobody Aspirante is related with a Vacante that i want to delete

 

i want to create a trigger but im new and i dont know how to do this, can yuo help me?

 

Aspirante__c is like a Applicant

Vacante __is is like a Job

  • February 22, 2012
  • Like
  • 0

hi

i hope that yoo can help me

 

im new in force.com

 

my problem is that i want to copy or move all the attachments records to file or copy and convert

 

the main topic is that i want to make a search into the file actually i can't search into because it's on attachment 

 

i not sure if i need to move to file or documents but the requirement is move from attachments

 

i don't know if i need to create a trigger or class 

can some body give and example 

  • April 06, 2012
  • Like
  • 0

hi

i have a problem i hope you can helpme

 

i have a custom button that send me to vf page

my custom object is Aspirante__c that has a select list with a list of status

i dont know how to pass the id of the record that  send me to the page, im actually link it by jscrip with onclick

 

my requirement is click button update status and show me the new page with a select list with the status permited

after select click on the button save or update 

 

but i can't pass the value to the controller , 

also i want to show differ values in the select list this depend of the actual status of the record else 

 

for example

New to On Hold
new to Rejected
Rejected to interview
interview to Rejected
interview to on hold
interview to offer
interest not to interview
not to offer interest
accepted offer to
accepted to hire

 

 

this is my code, that not run  show me this 

Id not specified in an update call
<apex:page standardController="Aspirante__c" extensions="SelectController">
     <apex:sectionHeader title="Estatus" />
     <apex:form >
     <apex:pageBlock title="Aspirante" mode="edit">
 
         <apex:outputText value="{!Aspirante__c.Estatus__c}" rendered="false"/>
         
 
          <apex:pageBlockButtons location="both">
               <apex:commandButton value="Save" action="{!save}" />
               <apex:commandButton value="Cancel" action="{!cancel}" />
          </apex:pageBlockButtons>
          <apex:pageMessages />       
 
          <apex:pageBlockSection title="Master Categories" columns="1">
 
                <apex:pageBlockSectionItem >
                    <apex:outputLabel value="Estatus" for="cbxlevel1"/>
                    <apex:outputPanel styleClass="requiredInput" layout="block">
                    <apex:outputPanel styleClass="requiredBlock" layout="block"/>
                    <apex:selectList value="{!selectedLevel1}" id="cbxlevel1" size="1" required="true">
                        <apex:selectOptions value="{!level1items}"/>
                        <apex:actionSupport event="onchange" rerender="cbxlevel2"/>
                    </apex:selectList>
                    </apex:outputPanel>
                </apex:pageBlockSectionItem>
 
                
          </apex:pageBlockSection>
 
     </apex:pageBlock>
     </apex:form>   
 
</apex:page>
             

 

public class SelectController {
 
    // reference for the standard controller
    private ApexPages.StandardController controller {get; set;}
 
    // the record that is being edited
    private Aspirante__c opp;
 
    // the values of the selected items
    public string selectedLevel1 {get; set;}
 
 
    public List<selectOption> level1Items {
        get {
            List<selectOption> options = new List<selectOption>();
 
                options.add(new SelectOption('','-- Elige un Estatus --'));
                options.add(new SelectOption('Nuevo','Nuevo'));
                options.add(new SelectOption('En espera','En espera'));
                options.add(new SelectOption('Rechazado','Rechazado'));
                options.add(new SelectOption('Entrevista','Entrevista'));
                options.add(new SelectOption('No Interesado','No Interesado'));
                options.add(new SelectOption('Oferta','Oferta'));
                options.add(new SelectOption('Aceptado','Aceptado'));
                options.add(new SelectOption('Contratado','Contratado'));
                
 
            return options;           
        }
        set;
    }
 
  
   
 
    public MultiSelectController(ApexPages.StandardController controller) {
 
        //initialize the stanrdard controller
        this.controller = controller;
        // load the record
        this.opp = (Aspirante__c)controller.getRecord();
 
        // preselect the current values for the record
        selectedLevel1 = opp.Estatus__c;
     
 
    }          
 
    public PageReference save() {
 
        // set the selected values to the record before saving
        opp.Estatus__c =selectedLevel1;
       
        try {
            //upsert(opp);
            update(opp);
        } catch(System.DMLException e) {
            ApexPages.addMessages(e);
            return null;
        }
        return ( new ApexPages.StandardController(opp).view());
    }        
 
}

 

 

  • March 28, 2012
  • Like
  • 0

hi

i have a error in this trigger

is for 2 objects that is related by a lookup filed or a master detail

Vacante__c , and Asignados __c here is the lookup field that search a Vacante__c

that i want to do is prevent delete a Vacante__c when there is one or more records of the object Asignados__c related to the record that i want to delete

 

trigger preventDelete on Vacante__c(before delete){

Set<ID> vacant = New Set<ID>();

For(Asignados__c a : [Select Vacante__c From Asignados__c Where Vacante__c IN :trigger.old])
     vacant.add(a.Vacante__c);

For(Vacante__c v : trigger.old){

   If(vacant.containsKey(v.ID))
      v.addError('You cannot delete this');

}





}

 but i get this error Method does not exist or incorrect signature: [SET<Id>].containsKey(Id)  

can somebody help me???

  • March 14, 2012
  • Like
  • 0

i have a trigger after delete

but it is not doing anything

i have 2 custom objects

Vacante__c  and Asignados __c

on the Asignados__c ithere is a master detail to the Vacante__c

 

i want to check when i want to delete a Record of Vacante__c if there are/is someone record Asignados__c that is related to my record that i want to delete

 

trigger deleteVacante on Vacante__c (before delete) {

  for(Vacante__c vac1 : Trigger.old){

   Vacante__c vac=[Select v.Id From Vacante__c v WHERE v.Id=:vac1.Id];

  String idvac=vac.Id;
  Asignados__c con = [Select a.Vacante__c From Asignados__c a WHERE a.Vacante__c=:idvac];

   if(con==null)
   delete con;

}

}

  • March 13, 2012
  • Like
  • 0

i want to update a lookup in my visual force page

 

i can search the parent record,but i can't save o update this values in the lookup field

i don't know how to get the value from de vfp 

 

My parent object Vacante__c

Child  Aspirante__c

 

public with sharing class MyCustomLookupController1 {
    public String nombre {get;set;}
    public String vacante {get; set;}
    String nameVacante;
   
  
    public Aspirante__c aspirante1 {get;set;}
    
     
    public Vacante__c oVacante{get;set;}
    
    public MyCustomLookupController1() {
    aspirante1= new Aspirante__c();
    oVacante=new Vacante__c();
    }
    
    
    public void save() 
                {
                    nameVacante=//VALUE THAT I SELECT FROM LOOKUP FIELD

                     Vacante__c oVacante=[Select Id,Name from Vacante__c where Name=:nameVacante];    
                      
                       
                   	Aspirante__c aspirante1 = [Select Name, Vacante__c from Aspirante__c where Name='Thomas'];
                             vacante =aspirante1.Vacante__c ;
                             nombre= aspirante1.Name;
                  
                   
                  
                           
                            aspirante1.Vacante__c=oVacante.Id;
                    //This will update the custom object
                   update aspirante1;
                 }  
    
}

 

   <apex:form id="myForm">  
        <apex:PageBlock id="PageBlock">     
            <apex:pageBlockSection columns="1" title="Asignar vacante">
        <apex:inputField id="Vacante__c" value="{!aspirante1.Vacante__c}"  />
         <P>Name: 
               <apex:inputText value="{!nombre}"/></P>
        <P>Vacante : 
               <apex:inputText value="{!vacante}"/></P>
          
        <P><apex:commandButton action="{!save}" 
                value="Guardar"/></P>
            </apex:pageBlockSection>
        </apex:PageBlock>
    </apex:form>

 

 

  • March 05, 2012
  • Like
  • 0

 i have 2 custom objects  Vacante__c and Aspirante__c, there are 2 lookup fields from Vacante__c to Aspirante__c and Aspirante__c to Vacante__c

 

i want to prevent delete a record of Vacante__c that is related with a Aspirante__c

this olny can be deleted when nobody Aspirante is related with a Vacante that i want to delete

 

i want to create a trigger but im new and i dont know how to do this, can yuo help me?

 

Aspirante__c is like a Applicant

Vacante __is is like a Job

  • February 22, 2012
  • Like
  • 0