• Sunil Khuwal
  • 15 Points
  • Member since 2015
  • Director
  • Acumencog Private Limited

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 3
I have a requirement, where first API callout call is made and its checking the response if the desired result is retreived, if the result is not expected, then apex code wait for 30 sec or 1 min and then again makes the api call and check again. Once the expected result is received in the API callout call. Then process stops.  All this is being happening in the background.

Solutions till now I have seen are which are currently either not working or are not correct way to do.

1. Put a while loop somewhat like this
Long startingTime = System.now().getTime(); // Num milliseconds since Jan 1 1970
            Integer delayInMilliseconds = 6000; // One-second delay
            while (System.now().getTime() - startingTime < delayInMilliseconds)  {
                // Do nothing until desired delay has passed

But this has very much chances of CPU time limit issues or it might get fail.

2. Thought of using combination of schedular and batch job, but I am unsure how to make use of this.

Can any one pls guide, how to achieve this problem statement?


Hi Guys,

I am new to salesforce and coding, need your help on below query:

I want to write a trigger to update the child record on the basis of parent record.

Parent Object: Account
Field: External_system__c

Child Object(Custom object): Classification__c

Whenever a account is created with external_system__c=123 then the classification Business_Status__c should get updated to 'Active' and it should run only once on classification creation time.

Any help will be highly appreciated!!
  • January 02, 2019
  • Like
  • 0
Can someone help me with module Metadata API, unit Build Admin Tools for Automated Configuration Changes?

The error I'm getting is:
Line 12: Method does not exist or incorrect signature; void add(Metadata.CustomMetadataValue) from the type List

Below is my code:
public class MetadataExample {

    public void updateMetadata () {
        Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata();
        customMetadata.fullName = 'MyNamespace__MyMetadataTypeName.MyMetadataRecordName';
        Metadata.CustomMetadataValue customField = new Metadata.CustomMetadataValue();
        customField.field = 'customField__c';
        customField.value = 'New value';
        List <Metadata.CustomMetadata> mdtlist = new List<Metadata.CustomMetadata>();
        mdtlist.add(customField);  // Line 12


I feel like I'm missing something very basic but I can't find any documentation specific to what I'm trying to do and the challenge is not similar (to me) to the example. Can someone please explain where I went wrong?
The following won't validate, but won't pass the validation in this trail.  Quantity field is howver using the correct field.  Thoughts?

User-added image


<aura:attribute name="item" type="Camping_Item__c" required="true"/>    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    <ui:outputCurrency value="{!v.item.Price__c}"/>
      <ui:outputNumber value="{!v.item.Quantity}"/>