• Shyamala Varadharajan
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
When deploying a Custom app with profileOverrides present, the profile names contain symbols like '-' the deployment is getting failed with 'invalid cross-reference id' as the error.
       This is the place I face error.
       
       <profileActionOverrides>
        <actionName>Tab</actionName>
        <content>Title_Dashboard</content>
        <formFactor>Large</formFactor>
        <pageOrSobjectType>standard-home</pageOrSobjectType>
        <type>Flexipage</type>
        <profile>XXX - Librarian Profile</profile>
        </profileActionOverrides>
        
        How to sort it out. Please Help.
Hello,
 
I have a Custom Object with 4 fields and 1 Date Field. If I try to create a new record with same values I need to check the old records and if the record persists then need to update the old Record with new Date . This is the code I have tried but the issue is it's updating old record as well as creating new record with same values which cause duplicates.I have written this in before Insert. please help.
 
public class duplicateHandler {
 
   public static void triggertocheckDuplicateBeforeInsert(list(List<CustObject> custList){
 Set <String> agencySet = new Set<String>();
Set <String> agencyTypeSet = new Set<String>();
Set <String> advetiserSet = new Set<String>();
Set <String> platformSet = new Set<String>();
Set <Date> startDateSet = new Set<Date>();
 
List<CustObject> oldList = new List<CustObject>();
 
        for (CustObject custMap : custList){
             agencySet.add(custMap.Agency__c);
             agencyTypeSet.add(custMap.Agency_Type__c);
             advetiserSet.add(custMap.Advertiser__c);
             platformSet.add(custMap.Platform__c);
        }
 
        List<CustObject> oldcustList = [SELECT Agency__c,Agency_Type__c,Advertiser__c,Platform__c,Start_Date__c FROM CustObject WHERE Agency__c IN :agencySet AND Agency_Type__c IN :agencyTypeSet AND Advertiser__c IN :advetiserSet AND Platform__c IN :platformSet];
for (CustObject custMap : custList){
  for( CustObject oldCust : oldcustList){
    if(oldcustList.size() > 0){
       if (custMap.Start_Date__c != oldCust.Start_Date__c) {
          oldcustList.Start_Date__c = custMap.Start_Date__c;
oldList.add(oldCust);
}
}
}
update oldList;
}
}
Hello,

I have a Custom Object with 4 fields  and 1 Date Field. If I try to create a new record with same values  I need to check the old records and if the record persists then need to update the old Record with new Date . How can we achieve this. Please help
Hello,

I have a Custom Object with 3 text fields  and 1 Date Field. If I try to create a new record with same values for all 4 fields then need to throw Duplicate Error else if I have same values in Text Field and  Date is different then need to update the existing record with new Date value. How can I achieve this . Please help
When deploying a Custom app with profileOverrides present, the profile names contain symbols like '-' the deployment is getting failed with 'invalid cross-reference id' as the error.
       This is the place I face error.
       
       <profileActionOverrides>
        <actionName>Tab</actionName>
        <content>Title_Dashboard</content>
        <formFactor>Large</formFactor>
        <pageOrSobjectType>standard-home</pageOrSobjectType>
        <type>Flexipage</type>
        <profile>XXX - Librarian Profile</profile>
        </profileActionOverrides>
        
        How to sort it out. Please Help.
Hello,
 
I have a Custom Object with 4 fields and 1 Date Field. If I try to create a new record with same values I need to check the old records and if the record persists then need to update the old Record with new Date . This is the code I have tried but the issue is it's updating old record as well as creating new record with same values which cause duplicates.I have written this in before Insert. please help.
 
public class duplicateHandler {
 
   public static void triggertocheckDuplicateBeforeInsert(list(List<CustObject> custList){
 Set <String> agencySet = new Set<String>();
Set <String> agencyTypeSet = new Set<String>();
Set <String> advetiserSet = new Set<String>();
Set <String> platformSet = new Set<String>();
Set <Date> startDateSet = new Set<Date>();
 
List<CustObject> oldList = new List<CustObject>();
 
        for (CustObject custMap : custList){
             agencySet.add(custMap.Agency__c);
             agencyTypeSet.add(custMap.Agency_Type__c);
             advetiserSet.add(custMap.Advertiser__c);
             platformSet.add(custMap.Platform__c);
        }
 
        List<CustObject> oldcustList = [SELECT Agency__c,Agency_Type__c,Advertiser__c,Platform__c,Start_Date__c FROM CustObject WHERE Agency__c IN :agencySet AND Agency_Type__c IN :agencyTypeSet AND Advertiser__c IN :advetiserSet AND Platform__c IN :platformSet];
for (CustObject custMap : custList){
  for( CustObject oldCust : oldcustList){
    if(oldcustList.size() > 0){
       if (custMap.Start_Date__c != oldCust.Start_Date__c) {
          oldcustList.Start_Date__c = custMap.Start_Date__c;
oldList.add(oldCust);
}
}
}
update oldList;
}
}
Hello,

I have a Custom Object with 4 fields  and 1 Date Field. If I try to create a new record with same values  I need to check the old records and if the record persists then need to update the old Record with new Date . How can we achieve this. Please help
Hello,

I have a Custom Object with 3 text fields  and 1 Date Field. If I try to create a new record with same values for all 4 fields then need to throw Duplicate Error else if I have same values in Text Field and  Date is different then need to update the existing record with new Date value. How can I achieve this . Please help