• Swapnil Gurav
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I am going through Process Automation Specialist Superbadge. I am completing this Superbadge on completely new Playground. I have created a flow which iterates through Product2 object and add Product2 names in Collection variable. I want to diplay all Product2 names after loop but my flow goes back to input screen instead of diplaying results.

1. Input screen : User selects type of bot (from Radio button) and choice is stored in Select_a_Bot field.
2. Fast Lookup : This lookup searches Select_a_Bot field in Product2 object and store list of products in ProductList SObject collection variable of type Product2. If I try to diplay ProductList variable it displays only Product IDs not names. So I used loop to fetch names.
3 and 4. Loop and Assignment : Loop iterates through ProductList SObject Collection variable and Assignment operation addsProduct name in OutputCollection which is Collection variable of type Text.
5. Output Screen : Here I'm displaying Output Collection values.

My flow doesn't go to Output screen. When I make selection on Input screen and click on next it goes back to Input screen. Please provide your suggestions to solve this.

Thank you.
Issue in Flow
There was an unhandled exception. Please reference ID: UWWDNKUY. Error: Faraday::ClientError. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2
I am going through Process Automation Specialist Superbadge. I am completing this Superbadge on completely new Playground. I have created a flow which iterates through Product2 object and add Product2 names in Collection variable. I want to diplay all Product2 names after loop but my flow goes back to input screen instead of diplaying results.

1. Input screen : User selects type of bot (from Radio button) and choice is stored in Select_a_Bot field.
2. Fast Lookup : This lookup searches Select_a_Bot field in Product2 object and store list of products in ProductList SObject collection variable of type Product2. If I try to diplay ProductList variable it displays only Product IDs not names. So I used loop to fetch names.
3 and 4. Loop and Assignment : Loop iterates through ProductList SObject Collection variable and Assignment operation addsProduct name in OutputCollection which is Collection variable of type Text.
5. Output Screen : Here I'm displaying Output Collection values.

My flow doesn't go to Output screen. When I make selection on Input screen and click on next it goes back to Input screen. Please provide your suggestions to solve this.

Thank you.
Issue in Flow
There was an unhandled exception. Please reference ID: UWWDNKUY. Error: Faraday::ClientError. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2
I'm trying to complete the Apex Specialist Superbadge.  I have created my WarehouseCalloutService apex class and it seems to match how others have created their class.  However when I run my code and then try and check the challenge, I'm getting the error that seems many others are getting about the Challenge Not Yet Complete.... "The runWarehouseEquipmentSync method does not appear to have run successfully. Could not find a successfully completed @future job for this method. Make sure that you run this method at least one before attempting this challenge. Since this method is annotated with the @future method, you may want to wait for a few seconds to ensure that it has processed successfully."

Here is my code:
public with sharing class WarehouseCalloutService {

    private static final String endpoint = 'https://th-superbadge-apex.herokuapp.com/equipment';

    @future(callout = true)	//need this so that it knows to call to external source
    public static void runWarehouseEquipmentSync(){
        Http http = new Http();
        HttpRequest httpRequest = new HttpRequest();
        httpRequest.setEndpoint(endpoint);
        httpRequest.setMethod('GET');
        HttpResponse httpResponse = http.send(httpRequest);
        
        //if successfully get the JSON file, need to parse out to different equipment objects
        if (httpResponse.getStatusCode() == 200){ //status = "OK" (this is for GET or HEAD requests)
            List<Object> equipmentList = (List<Object>) JSON.deserializeUntyped(httpResponse.getBody());
            List<Product2> products = new List<Product2>();
            
            for(Object item: equipmentList){
                Map<String, Object> productMap = (Map<String,Object>) item;	//map of item(s) in JSON file
                Product2 product = new Product2();	//list of products to insert/update in system
                
                product.Replacement_Part__c = (Boolean) productMap.get('replacement');
                product.Cost__c = (Integer) productMap.get('cost');                
                product.Current_Inventory__c = (Integer) productMap.get('quantity');
                product.Lifespan_Months__c = (Integer) productMap.get('lifespan');
                product.Maintenance_Cycle__c = (Integer) productMap.get('maintenanceperiod');
                product.Warehouse_SKU__c = (String) productMap.get('sku');
                product.Name = (String) productMap.get('name');
                product.ProductCode = (String) productMap.get('_id');
                products.add(product);
            }
            
            if(products.size() > 0){	//only need to upsert if items actually exist
                System.debug(products);
                upsert products;
            }
        }
    }
}

According to some other strings I have found on this error (https://developer.salesforce.com/forums/?id=906F0000000kE7DIAU), this is what I've looked at and the current status of it:
  • Field Level Security for Lifespan_Months__c field on Equipment (Product2) object: Visible for All profiles
  • User-added image
  • Remote Site Settings: Added this URL as a Remote Site and confirmed it is active - https://th-superbadge-apex.herokuapp.com
  • User-added image
  • Apex Jobs: Confirmed it is listed in Apex Jobs log and that it's listing as a "Future" job type and a "Completed" status.
  • User-added image
  • Execution Log: Confirmed that it shows that 1 of 50 Future classes were executed.
  • User-added image
  • SOQL Query: Confirmed that the job was placed into the system.
  • User-added image

Any assistance as to why I am not getting a complete on this task would be much appreciated!
I have tried Creating New Position I got following error and mail.Can any one help to Resolve the Problem

The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID XXXXXX. Contact your administrator for help. 

An error occurred at element myPreWaitDecision_myWait_myRule_1 (FlowDecision).
The flow failed to access the value for myVariable_current.CreatedBy.UserRole.Name because it hasn't been set or assigned.

This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.

Flow Details
Flow Name: Assign_Position_to_Recruiter
Type: Workflow
Version: 1
Status: Active

Flow Interview Details
Interview Label: Assign_Position_to_Recruiter-1_Position__c
Current User: SATHEESH P (00528000002XqSP)
Start time: 3/16/2016 11:42 PM
Duration: 0 seconds

How the Interview Started
SATHEESH P (00528000002XqSP) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = a0628000005Xlz2AAC

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "3/16/2016 11:42 PM"

 
This makes absolutely no sense to me. I am trying to insert two OpportunityLineItems that are exactly the same but I get this exception. What good reason is there to stop the insertion of two Records that are the same?

I understand if this was an upsert operation as you can't insert and update and the same time but I am inserting two brand new OpportuntiyLineItem records.

Thanks,
Jason


Message Edited by TehNrd on 09-24-2008 04:48 PM
  • September 24, 2008
  • Like
  • 0