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


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
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?

 

I am trying to create a field dependency where the Opportunity field: Sector has drop down options that are dependent on the Account field: Industry (Group). We attach Opportunities to Accounts so this would be helpful.

On the Account Object, I have 2 fields:

  • Industry - Picklist
  • Industry (Group) - Picklist with field dependency controlled by Industry

On the Opportunity Object, I have 1 field:

  • Sector - Multipicklist
I would like the Sector multipicklist on the Opportunity Object to display options depending on what the Industry (Group) field on the Account Object is.

Can anyone help me with this?
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
Field:Business_Status__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
Hello,
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:component>

<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}"/>
            
</aura:component>