• Nejib Essouri
  • NEWBIE
  • 50 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 10
    Replies
I work on custom object named "Team". I want my users to be able to send emails to any team. I have enabled activities, and add it to the page layout of "Team" but when selecting the Send Email button, the only field available is Contact and not the Email field of the Team record. Is there a way to send email to the appropriate Team ?

User-added image
 
Hello everyone,
I am ISV partner and I have a client who wants to buy the Sales cloud of salesforce and wants the setting and implementation according to his need. I want to know the monthly price percent against our company / salesforce. And I want to know the required documents in this procedure (Contract ...).
Thanks..
Hi guys,
I want to register for a new certification exam : Salesforce Certified Plateform Developer 1 (SU15) but this error appears for 4 days now.
Can I have an explication please.
User-added image
Hi guys, I would asign the old value of "stock_actuel__c" to the new field when a record is created. I develop this trigger. The problem is that when I insert a record I have an exception nullpointer:
MyTigger:
trigger InvoiceStock on Tissus__c (after insert, after update, after delete) {
   for(Tissus__c tnew : Trigger.New)
       for(Tissus__c told : Trigger.Old){
           if(tnew.Name == told.Name)
               tnew.stock_actuel__c = told.stock_actuel__c ;
       }
}
the Exception:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger InvoiceStock caused an unexpected exception, contact your administrator: InvoiceStock: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.InvoiceStock: line 3, column 1
 
Hi everyone, I am beginner  of trigger development. I have 2 custom object 'Vente_c' & 'Tissus__c'. I would calculate the total stock of tissues after passing the sale. My code has no errors but nothing happens. Would you help me please..
trigger StockUpdateTissu on Vente__c (after delete, after insert, after update) {
    set<Id> set_Id = new set<Id>();
       
    if(trigger.isInsert || trigger.isUpdate)
    for(Vente__c v : Trigger.new)
    set_Id.add(v.Tissus__c);
    
    if(trigger.isDelete)
    for(Vente__c v : Trigger.old)
    set_Id.add(v.Tissus__c);
    
    List<Tissus__c> listTissus = new List<Tissus__c>([SELECT ID FROM Tissus__c WHERE ID IN :set_Id]);
    List<Vente__c> listVente = new List<Vente__c>([SELECT ID FROM Vente__c WHERE ID IN :set_Id]);
    
    for(Tissus__c t : listTissus ){
        t.Stock_actuel__c=500;
        
        for(Vente__c v : listVente ) 
       
        t.Stock_actuel__c -= v.Metrage_tissus_vendu__c;
     }
     update listTissus;
}

 
I create a custom object "Vente". This custom object have 2 lookups relation with 2 others custom objects "Mousse" and "Fourniture".
In my custom tab "Ventes" i need to create a picklist related to "Mousse" and "Fourniture". After that I can choose any field from the custom object selected.
For example: Related to [Mousse/Fourniture] [Fields]
Simple question : How can i hide the sidebar from my custom tab who contain a custom object layout ?
My page bloc section :
<apex:pageblockSection title="Organisme audité">
                     <apex:pageblockSection >
                     <apex:pageblockSection >
                          <apex:inputField value="{!customObj1.Name}"/>
                      </apex:pageblockSection>
                  
                      <apex:pageblockSection >
                          <apex:inputField value="{!customObj1.Date_debut__c}"/>
                      </apex:pageblockSection>
                      
                      <apex:pageblockSection >
                          <apex:inputField value="{!customObj1.Date_fin__c}"/>
                      </apex:pageblockSection>
                     
                      <apex:pageblockSection >
                          <apex:commandButton value="save" action="{!save}"/>
                      </apex:pageblockSection>
 my controller :
public with sharing class controller_audit {
    
     public Mission__c customObj1 {get;set;}
public controller_audit()
{
     customObj1= [select Name, Date_debut__c, Date_fin__c from Mission__c LIMIT 1];
}

public void save()
{
    
     insert customObj1;
   
}
}

Error: 
System.DmlException: Insert failed. First exception on row 0 with id a0P24000000GPkhEAG; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
help ?
Hi guys, I would asign the old value of "stock_actuel__c" to the new field when a record is created. I develop this trigger. The problem is that when I insert a record I have an exception nullpointer:
MyTigger:
trigger InvoiceStock on Tissus__c (after insert, after update, after delete) {
   for(Tissus__c tnew : Trigger.New)
       for(Tissus__c told : Trigger.Old){
           if(tnew.Name == told.Name)
               tnew.stock_actuel__c = told.stock_actuel__c ;
       }
}
the Exception:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger InvoiceStock caused an unexpected exception, contact your administrator: InvoiceStock: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.InvoiceStock: line 3, column 1
 
Hi everyone, I am beginner  of trigger development. I have 2 custom object 'Vente_c' & 'Tissus__c'. I would calculate the total stock of tissues after passing the sale. My code has no errors but nothing happens. Would you help me please..
trigger StockUpdateTissu on Vente__c (after delete, after insert, after update) {
    set<Id> set_Id = new set<Id>();
       
    if(trigger.isInsert || trigger.isUpdate)
    for(Vente__c v : Trigger.new)
    set_Id.add(v.Tissus__c);
    
    if(trigger.isDelete)
    for(Vente__c v : Trigger.old)
    set_Id.add(v.Tissus__c);
    
    List<Tissus__c> listTissus = new List<Tissus__c>([SELECT ID FROM Tissus__c WHERE ID IN :set_Id]);
    List<Vente__c> listVente = new List<Vente__c>([SELECT ID FROM Vente__c WHERE ID IN :set_Id]);
    
    for(Tissus__c t : listTissus ){
        t.Stock_actuel__c=500;
        
        for(Vente__c v : listVente ) 
       
        t.Stock_actuel__c -= v.Metrage_tissus_vendu__c;
     }
     update listTissus;
}

 
My page bloc section :
<apex:pageblockSection title="Organisme audité">
                     <apex:pageblockSection >
                     <apex:pageblockSection >
                          <apex:inputField value="{!customObj1.Name}"/>
                      </apex:pageblockSection>
                  
                      <apex:pageblockSection >
                          <apex:inputField value="{!customObj1.Date_debut__c}"/>
                      </apex:pageblockSection>
                      
                      <apex:pageblockSection >
                          <apex:inputField value="{!customObj1.Date_fin__c}"/>
                      </apex:pageblockSection>
                     
                      <apex:pageblockSection >
                          <apex:commandButton value="save" action="{!save}"/>
                      </apex:pageblockSection>
 my controller :
public with sharing class controller_audit {
    
     public Mission__c customObj1 {get;set;}
public controller_audit()
{
     customObj1= [select Name, Date_debut__c, Date_fin__c from Mission__c LIMIT 1];
}

public void save()
{
    
     insert customObj1;
   
}
}

Error: 
System.DmlException: Insert failed. First exception on row 0 with id a0P24000000GPkhEAG; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
help ?
This challenge seems simple enough but I'm stuck and any help would be appreciated. 

So the Challenge is Create a validation rule to check that a contact is in the zip code of its account. here is the question below:
To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account (hint: you can use the ISBLANK function for this check) can be added with any MailingPostalCode value

Here is my  work.. Any help would be appreciated.. thanks, 

Rule Name Contact_must_be_in_Account_ZIP_Code Active [Checked]
Error Condition Formula AND( BillingPostalCode = ShippingPostalCode )
Error Message Billing zipcode does not match the Shipping Zipcode Error Location Billing Zip/Postal Code