• Andrew Morales 1
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies
How can we set field history tracking for an already existing custom field on a custom object? Is it possible?
Im sure this is super basic for some of you so hoping I can save some hours in my day by asking the larger community. 

The question I am trying to answer is: How many Contacts have made a Donation with the Opportunity Name = "Foundation Donation" in 2017?

The nuance is:
  • We dont use Accounts
  • We dont use Contact Roles for Opportunities
  • We use a custom lookup field on the Opportunity Object called 'Donor_Contact'
  • I dont need to return dollar amount (although would be helpful)
  • I dont need to return any Contact meta data, strictly 'number of donors'. 
A lot of the solutions I have found are looking up the Contact via the Account which we dont use and/or go through the Contact Role which we dont use. I have not found a solution that utilizes a custom field lookup on the Opportunity Object to get to the Contact. I am looking for some tips on structuring the query. Everything I have tried has returned 'malformed' errors. 

Any help would be appreciated. Thank you!
 
Hello Brililant People,

I am hoping that you can help me with what I am thinking is a easy(ish) question.

I am using a 3rd party data-tool that rhymes with betamoader.io and I am trying to sched a query > export to a sFTP site so we can collect metrics to do trend analysis. We have a very large data set (6M+ Contacts) that I have to query and I am just interested in the total num of records based on GROUPBy, not the PII of our Contacts. So think -'Total Num of Signups by Country and Language'

The query I wrote:
SELECT Email_Language__c, MailingCountry, COUNT(Id)
FROM Contact
WHERE SubscriberMaster__c = True AND (Double_Opt_In__c = True AND HasOptedOutOfEmail = False)
GROUP BY Email_Language__c, MailingCountry

Error from betamoader.io:
InvalidBatch : Failed to process query: FUNCTIONALITY_NOT_ENABLED: Aggregate Relationships not supported in Bulk Query

Kickers:
- After 100K records are queried, the tool will not allow me to choose to do it in Batch Mode. so that is not an option.
- I (have) successfully completed an extract with the query above to an sFTP with the tool by fudging the system by rerunning an old job and replacing the query. But it bricks again when it runs at the selected scheduled time.

Question
Is there a way to better optimize my query?

I dont understand the error of Aggregating Relationships, I am just trying to Group data on the Contact object. I am not trying to pull related data tables.





 
Hello Brilliant People,

This may be a simple question with a complex answer.

Is there a way to update fields that are ONLY blank/null on update or upsert?

I am uploading a set of Contact records and I only want to update the field if it is blank or null. I dont want it to overwrite it if a value exists, if it is a blank value I want it to populate. If the Contact doesnt exist, I want it to create the record with all metadata.

And I dont think this matters, but I dont have the ContactID's so will be keying off of the email address.

Thank you as always for the help!
Hello.
I would like to write a SOQL query in Data Loader that would include a list of 100 specific Contact record ID's to export (only) those records.
This is as close as I came but it is not returning the expected results.

SELECT Id,
FROM Contact
WHERE ID IN ('a4fa0000000KzbV','a4fa0000000KzbW',...........)

Any help would be greatly appreciated.
 
Hi All.

I am getting the following error on my trigger:
ERROR: AddOnTrigger: execution of AfterInsertcaused by: System.StringException: Invalid id: 9 External entry point
Any thoughts? Code is below. You can see my Objects are Contact(Standard), AddOn(Custom), Dev_AddOn(CustomJunction)

I am trying to write a trigger that will create the junction records from the Contact object and the AddOn object after the AddOn objects are created and edited. There are custom ID fields that I created as well so I will not be using the 

I am not a developer by trade and I got this far with the code because of the help from someone from the Community. Would appreciate any help in pointing me in the right direction. At this point, based on the error Im getting, I am not sure what next investigatory steps to take to rectify the code/problem.

Thank you very much for your time.
 
trigger AddOnTrigger on AddOn__c (after insert, after edit) {
    List<Dev_AddOn__c> aOBList = new List<Dev_AddOn__c>();
    
    
    Set<String> accIdSet = new Set<String>();
    
    for(AddOn__c obj: Trigger.new) {
        if(obj.ContactID_Values__c != null && obj.ContactID_Values__c != '') {
            List<String> accIdList = obj.ContactID_Values__c.split(',');
            accIdSet.addAll(accIdList);
        }
    }
    
    if(!accIdSet.isEmpty()) {
        Map<Id, Contact> accMap = new Map<Id, Contact>([Select Id, Name from Contact where Id IN: accIdSet]);
        for(AddOn__c obj: Trigger.new) {
            if(obj.ContactID_Values__c != null && obj.ContactID_Values__c != '') {
                List<String> accIdList = obj.ContactID_Values__c.split(',');
                
                for(String accId: accIdList)  {
                    if(accMap.get(accId) != null) {
                        Contact acc = accMap.get(accId);
                        Dev_AddOn__c aOB = new Dev_AddOn__c();
                        aOB.Name = obj.Name+' '+acc.Name;
                        aOB.AddOn__c = obj.Id;
                        aOB.Contact__c = acc.Id; 
                        aOBList.add(aOB);
                    }
                }
            }
        }
        
        if(!aOBList.isEmpty()) {
            insert aOBList;
        }
    }
}



 
Creating Many to Many Relationships from a CSV
Hello!

I created the schema below with (two) Master Detail Fields on the Junction-Object-AB pointing to both A and B. I believe the schema is sound for my application since this is a Many to Many relationship.

Schema:
Standard Object A
Custom Object B
Junction Object AB

My question is related to uploading the data via csv. The data is coming from an internal database and each record has a unique ID (unique to the table) already so I dont have to worry about pulling back the SFDC ID after upload from the success file.

Where I am stuck is - on object B, within one record/line I have multiple record ID's in one cell pointing to the data in Object A. So an example would be:

Object A - Developer Contact
-- Tom Jones - ID - 1
-- Johnny Depp - ID - 2
-- Christina Aguilera - ID - 3

Object B - Applications
-- Angry Birds - Dev ID - 1,2,3
-- Tetris - Dev ID - 2,3

So I would need to create 3 junction records for Angry Birds and 2 junction records for Tetris based on the Developers that worked on them.
QUESTIONS
How can I create the junction records if all the ID's are in one cell?
Do all the ID's have to be loaded in a custom field and it has to be created via a trigger? (If so, some help articles or specific search topics would be appreciated. I am not a developer by trade)

I will be working with about 30K records for Object A and 30K for object B so this cannot be done manually. I would appreciate any suggestions and/or pointing me to some help articles so I can work through it.

THANK YOU!!!
Hello!

I created the schema below with (two) Master Detail Fields on the Junction-Object-AB pointing to both A and B. I believe the schema is sound for my application since this is a Many to Many relationship.

Schema:
Standard Object A
Custom Object B
Junction Object AB


My question is related to uploading the data via csv. The data is coming from an internal database and each record has a unique ID (unique to the table) already so I dont have to worry about pulling back the SFDC ID after upload from the success file.

Where I am stuck is - on object B, within one record/line I have multiple record ID's in one cell pointing to the data in Object A. So an example would be:

Object A - Developer Contact
-- Tom Jones - ID - 1
-- Johnny Depp - ID - 2
-- Christina Aguilera - ID - 3

Object B - Applications
-- Angry Birds - Dev ID - 1,2,3
-- Tetris - Dev ID - 2,3

So I would need to create 3 junction records for Angry Birds and 2 junction records for Tetris based on the Developers that worked on them.
QUESTIONS
How can I create the junction records if all the ID's are in one cell?
Can I manipulate the data within CSV and then upload?
Do all the ID's have to be loaded in a custiom field and it has to be done Programatically?

I will be working with about 30K records for Object A and 30K for object B so this cannot be done manually. I would appreciate any suggestions and/or pointing me to some help articles so I can work through it.

THANK YOU!!!
Im sure this is super basic for some of you so hoping I can save some hours in my day by asking the larger community. 

The question I am trying to answer is: How many Contacts have made a Donation with the Opportunity Name = "Foundation Donation" in 2017?

The nuance is:
  • We dont use Accounts
  • We dont use Contact Roles for Opportunities
  • We use a custom lookup field on the Opportunity Object called 'Donor_Contact'
  • I dont need to return dollar amount (although would be helpful)
  • I dont need to return any Contact meta data, strictly 'number of donors'. 
A lot of the solutions I have found are looking up the Contact via the Account which we dont use and/or go through the Contact Role which we dont use. I have not found a solution that utilizes a custom field lookup on the Opportunity Object to get to the Contact. I am looking for some tips on structuring the query. Everything I have tried has returned 'malformed' errors. 

Any help would be appreciated. Thank you!
 
Hello.
I would like to write a SOQL query in Data Loader that would include a list of 100 specific Contact record ID's to export (only) those records.
This is as close as I came but it is not returning the expected results.

SELECT Id,
FROM Contact
WHERE ID IN ('a4fa0000000KzbV','a4fa0000000KzbW',...........)

Any help would be greatly appreciated.
 
Creating Many to Many Relationships from a CSV
Hello!

I created the schema below with (two) Master Detail Fields on the Junction-Object-AB pointing to both A and B. I believe the schema is sound for my application since this is a Many to Many relationship.

Schema:
Standard Object A
Custom Object B
Junction Object AB

My question is related to uploading the data via csv. The data is coming from an internal database and each record has a unique ID (unique to the table) already so I dont have to worry about pulling back the SFDC ID after upload from the success file.

Where I am stuck is - on object B, within one record/line I have multiple record ID's in one cell pointing to the data in Object A. So an example would be:

Object A - Developer Contact
-- Tom Jones - ID - 1
-- Johnny Depp - ID - 2
-- Christina Aguilera - ID - 3

Object B - Applications
-- Angry Birds - Dev ID - 1,2,3
-- Tetris - Dev ID - 2,3

So I would need to create 3 junction records for Angry Birds and 2 junction records for Tetris based on the Developers that worked on them.
QUESTIONS
How can I create the junction records if all the ID's are in one cell?
Do all the ID's have to be loaded in a custom field and it has to be created via a trigger? (If so, some help articles or specific search topics would be appreciated. I am not a developer by trade)

I will be working with about 30K records for Object A and 30K for object B so this cannot be done manually. I would appreciate any suggestions and/or pointing me to some help articles so I can work through it.

THANK YOU!!!
Hello!

I created the schema below with (two) Master Detail Fields on the Junction-Object-AB pointing to both A and B. I believe the schema is sound for my application since this is a Many to Many relationship.

Schema:
Standard Object A
Custom Object B
Junction Object AB


My question is related to uploading the data via csv. The data is coming from an internal database and each record has a unique ID (unique to the table) already so I dont have to worry about pulling back the SFDC ID after upload from the success file.

Where I am stuck is - on object B, within one record/line I have multiple record ID's in one cell pointing to the data in Object A. So an example would be:

Object A - Developer Contact
-- Tom Jones - ID - 1
-- Johnny Depp - ID - 2
-- Christina Aguilera - ID - 3

Object B - Applications
-- Angry Birds - Dev ID - 1,2,3
-- Tetris - Dev ID - 2,3

So I would need to create 3 junction records for Angry Birds and 2 junction records for Tetris based on the Developers that worked on them.
QUESTIONS
How can I create the junction records if all the ID's are in one cell?
Can I manipulate the data within CSV and then upload?
Do all the ID's have to be loaded in a custiom field and it has to be done Programatically?

I will be working with about 30K records for Object A and 30K for object B so this cannot be done manually. I would appreciate any suggestions and/or pointing me to some help articles so I can work through it.

THANK YOU!!!
How can we set field history tracking for an already existing custom field on a custom object? Is it possible?