• Scual
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 4
    Replies
Hello all,
i need to create a validationRule on a Custom Metadata Type
Custom Metadata Type : ConfigMatchingPhone__mdt, 
Field : ObjetType__c (EntityDefinition)
Field :LookupField__c(FieldDefinition).

Value on my Record are :
ObjetType__c : Contact
LookupField__c : Account

SOQL query: select ObjetType__r.QualifiedAPIName,LookupField__r.DataType from ConfigMatchingPhone__mdt

Result :
ObjetType__r.QualifiedAPIName: Contact
LookupField__r.DataType : Lookup(Account)

i want to check data LookupField__c is a lookup of Account.

ValidationRule :
NOT(CONTAINS(LookupField__r.DataType,"Lookup(Account)"))
this is not work!
How i can do that?
Please help
  • January 10, 2020
  • Like
  • 0
Hello all,
i need to create a validationRule on a Custom Metadata Type
Custom Metadata Type : ConfigMatchingPhone__mdt, 
Field : ObjetType__c (EntityDefinition)
Field :LookupField__c(FieldDefinition).

Value on my Record are :
ObjetType__c : Contact
LookupField__c : Account

SOQL query: select ObjetType__r.QualifiedAPIName,LookupField__r.DataType from ConfigMatchingPhone__mdt

Result :
ObjetType__r.QualifiedAPIName: Contact
LookupField__r.DataType : Lookup(Account)

i want to check data LookupField__c is a lookup of Account.

ValidationRule :
NOT(CONTAINS(LookupField__r.DataType,"Lookup(Account)"))
this is not work!
How i can do that?
Please help
  • January 10, 2020
  • Like
  • 0

On my developer edition I am able to use the /services/data/v38.0/composite composite API. I seriously LOVE this API, it cuts down on network time and makes life easy.

There is problem however, recently I was trying to integrate with a new customer and to my surprise the composite REST endpoint was 404 not found. The response from SFDC was:

[
  {
    "errorCode": "NOT_FOUND",
    "message": "The requested resource does not exist"
  }
]
Other REST requests on this domain with the same authentication work great... I thought that the composite API was Generally Available. Any ideas? Thanks in advance for the help.
Hi,

OBjects:
1.EVENTS
2.CUSTOM_OBJECT__c

I am trying to write a soql query to relate Events Object And Custom Object.

Query I Have written:
ev = [select id,what.id,what.type,IsRecurrence,RecurrenceEndDateOnly  from Event where 
     WhatId = :pu.id
    AND What.Type = 'CUSTOM_OBJECT__c' ];

Problem:
It is creating event but not relating that event to that custom object.Pls help me with the query to relate this.

Correct me If i am writing the query in wrong way.

Thanks,
I have a extension contrlloer for a visualforce page that i need to create a simple text class, but i'm not sure how to accomplish this. Any help would be greatly appreciated. My apex controller is below.
 
Public Class AccountExtensionController{
   private Account acct;
   public List<Bids_Sent__c> bidsList {get;set;}
   public Map<String,List<Site_Bid_Details__c>>  bidsMap {get;set;}
   public AccountExtensionController(ApexPages.StandardController sc){
       acct = (Account)sc.getRecord();
       bidsList = new List<Bids_Sent__c>();
       bidsList = [SELECT Id,IsAddedToPDF__c,Customer__r.Service_Agreement_Verbiage__c,Site__c,Site__r.Contract_Start_Date__c,Site__r.Contract_End_Date__c,Site__r.Customer_Location_ID__c,Service_Year__c,Customer__r.Contract_Start_Date__c,Name,Customer__r.Contract_End_Date__c,Site__r.Name,Customer__r.Name,Primary_Contact__r.FirstName,Site__r.BillingCity,Site__r.BillingState,Site__r.BillingStreet,Site__r.BillingPostalCode  FROM Bids_Sent__c WHERE Awarded__c =: acct.Id AND IsAddedToPDF__c=true];
    
    Set<Id> bidId = new  Set<Id>();  
    for(Bids_Sent__c bs : bidsList){
     bidId.add(bs.Id);
    }
     
    bidsMap = new Map<String,List<Site_Bid_Details__c>> ();
    for(Site_Bid_Details__c bd : [SELECT Id, Bid_Name__r.Name,Site__c,Site__r.Customer_Location_ID__c,Cost__c,Increment__c,Total__c,Price__c,Scope__c,Bid_Name__r.Service_Type__c,Number_of_Months__c,Retainer_Fee__c,Monthly_Payment__c,UOM__c  FROM Site_Bid_Details__c WHERE Bid_Name__c IN : bidId]){
        
    if(bidsMap.containsKey(bd.Bid_Name__r.Name)){
    System.debug('CONTAINS KEY: ' + bd.Bid_Name__r.Name);
    bidsMap.get(bd.Bid_Name__r.Name).add(bd);
    } 
  
    else { 
    System.debug('CREATE: ' + bd.Bid_Name__r.Name);
    bidsMap.put(bd.Bid_Name__r.Name,new List<Site_Bid_Details__c>{bd}); 
   }
 } 

}

}

 
  • January 10, 2020
  • Like
  • 1