• Manish U
  • NEWBIE
  • 35 Points
  • Member since 2017


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hello developers,

I have created a custom metadata type called 'Geolocation__mdt' with 2 custom fields: Distance__c and Limit__c

What I am (unsuccessfully) trying to achieve is to use the values stored in Distance__c and Limit__c as parameters for my SOQL query:
String queryString =
           'SELECT Id, Name,AD_JobAds_Anz__c,Vollst_ndiger_Name__c,ShippingStreet,LocateCity__longitude__s, LocateCity__latitude__s  ' +
           'FROM Account ' +
           'WHERE DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') <  3 and Kundenstatus_Direktvertrieb__c = \'Bestandskunde\' and Id != :theaccId ' +
           'ORDER BY DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') ' +
'LIMIT 50';
But instead of: 
WHERE DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') <  3
I want to use:
WHERE DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') <  Geolocation__mdt.Distance__c
and instead of :
'LIMIT 50';
I want to use 
'LIMIT = Geolocation__mdt.Limit__c';

The main goal is to stay flexible since the values may change over the course of time and I don't want to touch my code every time.
 

Thanks!


 

Hi,
Want to know if possible that multiple insteaces/threads of a Trigger can run simultaneously (in parallel)?
 
Let us say, we have a Trigger on an Object, and an external process keeps upserting records into the Object (using obj API). Not sure how SF manages trigger run if continueous data ops are occurring on the object. 

Is it possible that the trigger runs multiple instances/thread if first trigger run still busy with processing and subsequent DML ops performed?  

Note: This question is not related to whether should I have muliple Triggers on a object or not. 

Thank you!
Hi,
Want to know if possible that multiple insteaces/threads of a Trigger can run simultaneously (in parallel)?
 
Let us say, we have a Trigger on an Object, and an external process keeps upserting records into the Object (using obj API). Not sure how SF manages trigger run if continueous data ops are occurring on the object. 

Is it possible that the trigger runs multiple instances/thread if first trigger run still busy with processing and subsequent DML ops performed?  

Note: This question is not related to whether should I have muliple Triggers on a object or not. 

Thank you!
how to write a trigger on task, only system admin user should be able to delete the task.
Hello developers,

I have created a custom metadata type called 'Geolocation__mdt' with 2 custom fields: Distance__c and Limit__c

What I am (unsuccessfully) trying to achieve is to use the values stored in Distance__c and Limit__c as parameters for my SOQL query:
String queryString =
           'SELECT Id, Name,AD_JobAds_Anz__c,Vollst_ndiger_Name__c,ShippingStreet,LocateCity__longitude__s, LocateCity__latitude__s  ' +
           'FROM Account ' +
           'WHERE DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') <  3 and Kundenstatus_Direktvertrieb__c = \'Bestandskunde\' and Id != :theaccId ' +
           'ORDER BY DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') ' +
'LIMIT 50';
But instead of: 
WHERE DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') <  3
I want to use:
WHERE DISTANCE(LocateCity__c, GEOLOCATION('+lat+','+lon+'), \'km\') <  Geolocation__mdt.Distance__c
and instead of :
'LIMIT 50';
I want to use 
'LIMIT = Geolocation__mdt.Limit__c';

The main goal is to stay flexible since the values may change over the course of time and I don't want to touch my code every time.
 

Thanks!