• Axel Duhême
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi,

I'm trying to set up a trigger so that when a user deletes a contact, it is updated (with a True value in the Inactive__c checkbox) instead of being deleted.

The use case here is that when a user deletes a contact from their Outlook address book, I want it to remain in the database as inactive after Salesforce for Outlook / Lightning Sync triggers the delete.

Of course, I would include an excpetion in the trigger sor that User with the admin profile can properly delete records.

Hope someone can help!

Axel.
 
Hi,

I'm trying to set up a trigger so that when a user deletes a contact, it is updated (with a True value in the Inactive__c checkbox) instead of being deleted.

The use case here is that when a user deletes a contact from their Outlook address book, I want it to remain in the database as inactive after Salesforce for Outlook / Lightning Sync triggers the delete.

Of course, I would include an excpetion in the trigger sor that User with the admin profile can properly delete records.

Hope someone can help!

Axel.
 
Hi, I'm new in Salesforce and I'm making a visualforce:
I have this summarized visualforce code:
<!--The code is summarized, this is not my complete code-->

<div>
<apex:form id="tabla2">
        <apex:pageBlock >
          <apex:pageBlockTable value="{!lstCitas}" var="citas" styleClass="table table-hover">
            <apex:column value="{!citas.Name}"/>
            <apex:column value="{!citas.CloseDate}"/>
            <apex:column >
              <apex:commandButton value="My button" styleClass="btn btn-primary" action="{!mostrarCitaIndividualDoctor}" rerender="p1">
                  <apex:param name="nombre" value="{!citas.Name}" assignTo="{!nombre}"/>
                  <apex:param name="fecha" value="{!citas.CloseDate}" assignTo="{!fecha}"/>
              </apex:commandButton>
            </apex:column>
          </apex:pageBlockTable>
        </apex:pageBlock>
</apex:form>
</div>

<!--More code-->

<div id="p1">
<apex:form >
              <label>Nombre: {!nombreC}</label>
              <label>Fecha de cierre: {!fechaC}</label>
</apex:form>
</div>

And my summarized controller code:
 
public class controlador{

    public String nombre {get; set;}
    public String fecha {get; set;}
    public String nombreC {get; set;}
    public String fechaC{get; set;}
   
    /*More code*/

    public void mostrarCitaIndividualDoctor(){
        nombreC = this.nombre;
        fechaC = this.fecha;
    }

    /*More code*/
}
The table shows the values properly, when I click the button, I get the name and the date, and I show this values in the other div(p1). It works for the name but in the date I always get a null value.
I have tried to change to Date the varaible in the controller but it still doesn't work for me.

How can I get the date?

Thanks in advance.