• Tommy Georgiou
  • NEWBIE
  • 160 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 94
    Replies
Hi all,


My business scenario that I am having problems to resolve is the following. I am sending quotes to our clients with various products(different product families). 
As soon as the client accepts the terms I create an order per each product family as I have suppliers per product family. As you understand this is a duplication of my work creating the opp and then the quote. 
Ideally with a hit of a button I could transfer lets say products a,b,c of product family A into the assigned order form layout for product family A. With another button the products d,e,f of product family B will go to the order form layout of pro fami. B.

I do not know if this can be done either by a custom button or a visualforce page. Anyhow I am seeking help from experts like you guys in the developer forum.

Thank you very much
Hi all,


Has anyone tried the 3CX integration for Salesforce. If yes can you please be kind and let me kow of advantages/disadvantages regarding this provider. If it's easy can you send some screenshots as well when you receive an incoming call how the interface looks.

Thank you in advance
Hello,


I am trying to insert new records into a custom object (production) via apex data loader. When I do so I get an error like
 
​ ReservationTrigger: execution of AfterInsert

caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)

Trigger.ReservationTrigger: line 11, column 1

My trigger is 
trigger ReservationTrigger on Reservations__c (after insert,after update) {
    // Get the IDs of related contacts
    Set<Id> contactIds = new Set<Id>();
    for(Reservations__c oneReservation:trigger.new){
        if(oneReservation.ReservationStatus__c == 'Confirmed'){
            contactIds.add(oneReservation.Email__c);
        }
    }
    // Count the distinct Reservation_Number__c from the Reservation objects of all related contacts
    Map<Id, Integer> countDistinctReservationMap = new Map<Id, Integer>();
    for (AggregateResult aggRes : [SELECT COUNT_DISTINCT(ReservationCode__c) resNum, Email__c conId FROM Reservations__c WHERE Email__c IN: contactIds GROUP BY Email__c ]) {
         Id conId = (Id) aggRes.get('conId');
         Integer resNum  = (Integer) aggRes.get('resNum');
         countDistinctReservationMap.put(conId, resNum);
    }
    // Now fetch the Contacts in a list
    List<Contact> listContacts = [Select Id, customRollupField__c from Contact Where Id IN:contactIds];
    if(listContacts.size()>0) {
         for(Contact con : listContacts) {
              // fetch or get the distinct count or rollup from the map and copy it to the contact's field
              con.customRollupField__c = countDistinctReservationMap.get(con.Id);
         }
    }
    // Update the contacts
    update listContacts;
}

Any Ideas why?
I have moved my custom object(Reservations) with the custom fields(near to 50 fields) created in Sandbox into Production but when i try and create a new res I can use only the standard field of that custom object. All the other fields are not visible. When I go to the edit of the page layout I can see them but when I preview the layout they are missing. Did I forgot something during the transition from Sandbox to Production?
Hi all,


Due to my poor knowledge on apex I am seeking for help in this forum. I am really new to this so please spare me.
With help from another Dev a trigger was created for a custom object where using the Count_Dinstinct it was reading the unique ReservationCode__c and rolling up the custom field on Contacts if the trigger was firing due to its rules. 
Trigger is : 
 
trigger ReservationTrigger on Reservations__c (after insert,after update) {
    // Get the IDs of related contacts
    Set<Id> contactIds = new Set<Id>();
    for(Reservations__c oneReservation:trigger.new){
        if(oneReservation.ReservationStatus__c == 'Confirmed'){
            contactIds.add(oneReservation.Email__c);
        }
    }
    // Count the distinct Reservation_Number__c from the Reservation objects of all related contacts
    Map<Id, Integer> countDistinctReservationMap = new Map<Id, Integer>();
    for (AggregateResult aggRes : [SELECT COUNT_DISTINCT(ReservationCode__c) resNum, Email__c conId FROM Reservations__c WHERE Email__c IN: contactIds GROUP BY Email__c ]) {
         Id conId = (Id) aggRes.get('conId');
         Integer resNum  = (Integer) aggRes.get('resNum');
         countDistinctReservationMap.put(conId, resNum);
    }
    // Now fetch the Contacts in a list
    List<Contact> listContacts = [Select Id, customRollupField__c from Contact Where Id IN:contactIds];
    if(listContacts.size()>0) {
         for(Contact con : listContacts) {
              // fetch or get the distinct count or rollup from the map and copy it to the contact's field
              con.customRollupField__c = countDistinctReservationMap.get(con.Id);
         }
    }
    // Update the contacts
    update listContacts;
}

My problem is how to get the custom object onto the test class. 

Due to my poor knowledge I think that a test class should include  

Account a = new Account(Name = 'Test');
        insert a;     

     Contact c = new Contact(AccountId=a.Id, lastname='testing', firstname='apex', Email= 'xxxxx');
        insert c;

but here is where I stuck. How to get the custom object onto the test class with the count dinstinct??

Thank you in advance
 
Hi all,


I have a custom text field that I want to include into a workflow where my end result will be a field update(checkbox). What I want as a rule is when this custom text field is the same then the update won't take place. ie. when abc1234 = abc 1234 then nothing will happen. 

My question is how can I create this rule? (For a contact I have a custom object where it has records. In some cases two records have the same custom text field.)