• HiteshP
  • NEWBIE
  • 5 Points
  • Member since 2018
  • Technical Architect
  • SFTPL


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies
I'm unable to complete the Trailhead >> Salesforce Connect >> Integrate External Data badge 

Error: 

Challenge not yet complete in My Trailhead Playground 1
There was an unexpected error in your org which is preventing this assessment check from completing: System.ExternalObjectException: This data isn't available because the phones object's "Phone_UUID__c" field has an external column name that can't be found on the external system. Contact your admin for help.

User-added image
Hello Experts,

I'm getting below error on setup # 7. 

Challenge Not yet complete... here's what's wrong:
Couldn’t find the correct values. Please check your work.

User-added image

Json:
{
  "Add Temp Class": {
    "action": "computeExpression",
    "parameters": {
      "source": "Filter 2015",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "TempClass",
          "label": "TempClass",
          "type": "Text",
          "saqlExpression": "case when Temperature < 25 then \"Polar\" when Temperature >= 25 and Temperature <= 50 then \"Cool\" when Temperature >= 51 and Temperature <= 85 then \"Continental\" when Temperature > 85 then \"Tropical\" end",
          "defaultValue": "\"Continental\""
        }
      ]
    }
  },
  "Load Seed Orders": {
    "action": "edgemart",
    "parameters": {
      "alias": "Seed_Bank_Orders"
    }
  },
  "Create Order History": {
    "action": "sfdcRegister",
    "parameters": {
      "name": "Order History",
      "alias": "order_history",
      "source": "Add Seed Orders"
    }
  },
  "Augment Temp Class": {
    "action": "augment",
    "parameters": {
      "left": "Add Temp Class",
      "right": "Load Account",
      "relationship": "AugmentTempClass",
      "operation": "LookupSingleValue",
      "left_key": [
        "Country"
      ],
      "right_key": [
        "ShippingCountry"
      ],
      "right_select": [
        "AccountNumber",
        "Name",
        "Phone",
        "ShippingCity",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingState",
        "ShippingStreet"
      ]
    }
  },
  "Load Climate": {
    "action": "edgemart",
    "parameters": {
      "alias": "Global_Climates"
    }
  },
  "Add Seed Orders": {
    "action": "augment",
    "parameters": {
      "left": "Load Seed Orders",
      "right": "Filter Agency Records",
      "relationship": "SeedOrders",
      "operation": "LookupSingleValue",
      "left_key": [
        "Agency_ID"
      ],
      "right_key": [
        "Climate.AccountNumber"
      ],
      "right_select": [
        "AugmentTempClass.AccountNumber",
        "AugmentTempClass.Name",
        "AugmentTempClass.Phone",
        "AugmentTempClass.ShippingCity",
        "AugmentTempClass.ShippingCountry",
        "AugmentTempClass.ShippingPostalCode",
        "AugmentTempClass.ShippingState",
        "AugmentTempClass.ShippingStreet"
      ]
    }
  },
  "Filter 2015": {
    "action": "filter",
    "parameters": {
      "filter": "Date_Year:EQ:2015",
      "source": "Load Climate"
    }
  },
  "Add Agency Detail Fields": {
    "action": "augment",
    "parameters": {
      "left": "Load Account",
      "right": "Load Agency",
      "relationship": "AgencyDetail",
      "operation": "LookupSingleValue",
      "left_key": [
        "AccountNumber"
      ],
      "right_key": [
        "AccountNumber"
      ],
      "right_select": [
        "AccountNumber",
        "Acres",
        "Currency",
        "Latitude",
        "Longitude",
        "Region",
        "SubRegion"
      ]
    }
  },
  "ID Agency Records": {
    "action": "computeExpression",
    "parameters": {
      "source": "Add Agency Detail Fields",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "IsAgency",
          "label": "IsAgency",
          "type": "Text",
          "saqlExpression": "case when Phone is not null then \"TRUE\" else \"FALSE\" end"
        }
      ]
    }
  },
  "Load Agency": {
    "action": "edgemart",
    "parameters": {
      "alias": "Agency_Detail"
    }
  },
  "Filter Agency Records": {
    "action": "filter",
    "parameters": {
      "filter": "Climate.IsAgency:EQ:TRUE",
      "source": "Add Agency Fields"
    }
  },
  "Load Account": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "AccountNumber"
        },
        {
          "name": "Name"
        },
        {
          "name": "Phone"
        },
        {
          "name": "ShippingCity"
        },
        {
          "name": "ShippingCountry"
        },
        {
          "name": "ShippingPostalCode"
        },
        {
          "name": "ShippingState"
        },
        {
          "name": "ShippingStreet"
        }
      ],
      "object": "Account"
    }
  },
  "Add Agency Fields": {
    "action": "augment",
    "parameters": {
      "left": "Augment Temp Class",
      "right": "ID Agency Records",
      "relationship": "Climate",
      "operation": "LookupSingleValue",
      "left_key": [
        "AugmentTempClass.AccountNumber"
      ],
      "right_key": [
        "AccountNumber"
      ],
      "right_select": [
        "AccountNumber",
        "IsAgency",
        "Name",
        "Phone",
        "ShippingCity",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingState",
        "ShippingStreet"
      ]
    }
  }
}
 
  • September 02, 2018
  • Like
  • 0
I'm stucked with below error:

Challenge Not yet complete... here's what's wrong: 
Couldn’t find the 'Create Seed Bank Agencies' node or required fields are missing. Check the challenge and confirm the node name, alias, and required fields.

My Json:
/*/*/*

{
  "Add Agency Fields": {
    "action": "augment",
    "parameters": {
      "right_key": [
        "AccountNumber"
      ],
      "left": "Load Account",
      "left_key": [
        "AccountNumber"
      ],
      "right_select": [
        "Acres",
        "Currency",
        "Latitude",
        "Longitude",
        "Region",
        "SubRegion"
      ],
      "right": "Load Agency Detail",
      "relationship": "AgencyDetail",
      "operation": "LookupSingleValue"
    }
  },
  "Filter Agency Records": {
    "action": "filter",
    "parameters": {
      "filter": "IsAgency:EQ:TRUE",
      "source": "ID Agency Records"
    }
  },
  "Load Account": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "AccountNumber"
        },
        {
          "name": "Name"
        },
        {
          "name": "Phone"
        },
        {
          "name": "ShippingCity"
        },
        {
          "name": "ShippingCountry"
        },
        {
          "name": "ShippingState"
        },
        {
          "name": "ShippingPostalCode"
        },
        {
          "name": "ShippingStreet"
        }
      ],
      "object": "Account",
      "filterConditions": [
        {
           "field": "Phone",
           "operator": "!=",
           "value": ""
       }
      ]
    }
  },
  "Create Seed Bank Agencies": {
    "action": "sfdcRegister",
    "parameters": {
      "name": "Seed Bank Agencies",
      "alias": "seed_bank_agencies",
      "source": "Filter Agency Records"
    }
  },
  "ID Agency Records": {
    "action": "computeExpression",
    "parameters": {
      "source": "Add Agency Fields",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "IsAgency",
          "saqlExpression": "case when Phone is not null then \"TRUE\" else \"FALSE\" end\n\n",
          "label": "IsAgency",
          "type": "Text"
        }
      ]
    }
  },
  "Load Agency Detail": {
    "action": "edgemart",
    "parameters": {
      "alias": "Agency_Detail"
    }
  }
}

Please advice
  • September 01, 2018
  • Like
  • 0
I have written Java utility which download salesforce attachments but i'm stucked, my utility is downloading only one attachment. 

Can someone please look into the code and help?

File Name :ExportAttachments.java

package extractordaemon;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sforce.soap.partner.Connector;
import com.sforce.soap.partner.PartnerConnection;
import com.sforce.soap.partner.QueryResult;
import com.sforce.soap.partner.sobject.SObject;
import com.sforce.ws.ConnectionException;
import com.sforce.ws.ConnectorConfig;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import javax.mail.util.ByteArrayDataSource;
import sun.misc.BASE64Decoder;

/**
 *
 * @author hitesh.patel
 */
public class ExportAttachments {

    static final String USERNAME = "<USERNAME>";
    static final String PASSWORD = "<PASSWORD>";
    static final String autURL = "https://login.salesforce.com/services/Soap/u/34.0";
    //static EnterpriseConnection connection;
    static PartnerConnection connection = null;
    static final String ATTACHIDS = "00P50000007HYMJEA4,00P50000007HmAjEAK,00P50000004CmZ3EAK";
    static final String AccountIds = "5007F00000Klxio,5007F00000KlxiS";

    static List<String> str = new ArrayList<String>();
    static List<String> stracct = new ArrayList<String>();
    static Map<String, String> idMap = new HashMap<String, String>();
    static Map<String, String> csvMap = new HashMap<String, String>();

    public static void main(String[] args) {

        ConnectorConfig config = new ConnectorConfig();
        config.setAuthEndpoint(autURL);
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        //config.setTraceMessage(true);
        str = Arrays.asList(ATTACHIDS.split(","));
        stracct = Arrays.asList(AccountIds.split(","));
        for (String s : stracct) {
            idMap.put(s, s);
        }
        try {

            connection = Connector.newConnection(config);
            // display some current settings
            System.out.println("Auth EndPoint: " + config.getAuthEndpoint());
            System.out.println("Service EndPoint: " + config.getServiceEndpoint());
            System.out.println("Username: " + config.getUsername());
            System.out.println("SessionId: " + config.getSessionId());

          
            queryAttachments();
          

        } catch (ConnectionException e1) {
            e1.printStackTrace();
        }

    }
    

    
    private static void queryAttachments() {
        try {
            //for(String s:idMap.keySet()){
            QueryResult queryResults = connection.query("Select Id, ParentId, Name, ContentType, Body "
                    + "From Attachment limit 10");

            if (queryResults.getSize() > 0) {
                for (int i = 0; i < queryResults.getRecords().length; i++) {
                    // cast the SObject to a strongly-typed Contact
                    SObject a = (SObject) queryResults.getRecords()[i];
                    String blob = a.getField("Body").toString().trim();

                    BASE64Decoder decoder = new BASE64Decoder();
                    byte[] imgBytes = decoder.decodeBuffer(blob);
                    writeOnDisk(a.getId() + "-" + a.getField("Name").toString().trim(), imgBytes);
                    System.out.println("I: " + i);
                }
            }
            //}
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    private static void writeOnDisk(String fileName, byte[] bdy) {
        try {
            String filePath = "C://Users//hitesh.patel//Desktop//AUTH//att//" + fileName;

            ByteArrayDataSource rawData = new ByteArrayDataSource(bdy, "application/octet-stream");
            BufferedInputStream reader = new BufferedInputStream(rawData.getInputStream(), 4096);

            FileOutputStream fos = new FileOutputStream(filePath);//File OutPutStream is used to write Binary Contents like pictures

            BufferedOutputStream writer = new BufferedOutputStream(fos, 4096);

            byte[] buf = new byte['?'];
            int byteRead;
           // reader.read(buf, 0, 4096))
            System.out.println("reader : "+reader.read());
            while ((byteRead = reader.read()) >= 0) {
                //writer.write(buf, 0, byteRead);
                writer.write(byteRead);
            }
            reader.close();

            writer.flush();

            writer.close();

        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }
}
Hello Experts,

I'm getting below error on setup # 7. 

Challenge Not yet complete... here's what's wrong:
Couldn’t find the correct values. Please check your work.

User-added image

Json:
{
  "Add Temp Class": {
    "action": "computeExpression",
    "parameters": {
      "source": "Filter 2015",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "TempClass",
          "label": "TempClass",
          "type": "Text",
          "saqlExpression": "case when Temperature < 25 then \"Polar\" when Temperature >= 25 and Temperature <= 50 then \"Cool\" when Temperature >= 51 and Temperature <= 85 then \"Continental\" when Temperature > 85 then \"Tropical\" end",
          "defaultValue": "\"Continental\""
        }
      ]
    }
  },
  "Load Seed Orders": {
    "action": "edgemart",
    "parameters": {
      "alias": "Seed_Bank_Orders"
    }
  },
  "Create Order History": {
    "action": "sfdcRegister",
    "parameters": {
      "name": "Order History",
      "alias": "order_history",
      "source": "Add Seed Orders"
    }
  },
  "Augment Temp Class": {
    "action": "augment",
    "parameters": {
      "left": "Add Temp Class",
      "right": "Load Account",
      "relationship": "AugmentTempClass",
      "operation": "LookupSingleValue",
      "left_key": [
        "Country"
      ],
      "right_key": [
        "ShippingCountry"
      ],
      "right_select": [
        "AccountNumber",
        "Name",
        "Phone",
        "ShippingCity",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingState",
        "ShippingStreet"
      ]
    }
  },
  "Load Climate": {
    "action": "edgemart",
    "parameters": {
      "alias": "Global_Climates"
    }
  },
  "Add Seed Orders": {
    "action": "augment",
    "parameters": {
      "left": "Load Seed Orders",
      "right": "Filter Agency Records",
      "relationship": "SeedOrders",
      "operation": "LookupSingleValue",
      "left_key": [
        "Agency_ID"
      ],
      "right_key": [
        "Climate.AccountNumber"
      ],
      "right_select": [
        "AugmentTempClass.AccountNumber",
        "AugmentTempClass.Name",
        "AugmentTempClass.Phone",
        "AugmentTempClass.ShippingCity",
        "AugmentTempClass.ShippingCountry",
        "AugmentTempClass.ShippingPostalCode",
        "AugmentTempClass.ShippingState",
        "AugmentTempClass.ShippingStreet"
      ]
    }
  },
  "Filter 2015": {
    "action": "filter",
    "parameters": {
      "filter": "Date_Year:EQ:2015",
      "source": "Load Climate"
    }
  },
  "Add Agency Detail Fields": {
    "action": "augment",
    "parameters": {
      "left": "Load Account",
      "right": "Load Agency",
      "relationship": "AgencyDetail",
      "operation": "LookupSingleValue",
      "left_key": [
        "AccountNumber"
      ],
      "right_key": [
        "AccountNumber"
      ],
      "right_select": [
        "AccountNumber",
        "Acres",
        "Currency",
        "Latitude",
        "Longitude",
        "Region",
        "SubRegion"
      ]
    }
  },
  "ID Agency Records": {
    "action": "computeExpression",
    "parameters": {
      "source": "Add Agency Detail Fields",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "IsAgency",
          "label": "IsAgency",
          "type": "Text",
          "saqlExpression": "case when Phone is not null then \"TRUE\" else \"FALSE\" end"
        }
      ]
    }
  },
  "Load Agency": {
    "action": "edgemart",
    "parameters": {
      "alias": "Agency_Detail"
    }
  },
  "Filter Agency Records": {
    "action": "filter",
    "parameters": {
      "filter": "Climate.IsAgency:EQ:TRUE",
      "source": "Add Agency Fields"
    }
  },
  "Load Account": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "AccountNumber"
        },
        {
          "name": "Name"
        },
        {
          "name": "Phone"
        },
        {
          "name": "ShippingCity"
        },
        {
          "name": "ShippingCountry"
        },
        {
          "name": "ShippingPostalCode"
        },
        {
          "name": "ShippingState"
        },
        {
          "name": "ShippingStreet"
        }
      ],
      "object": "Account"
    }
  },
  "Add Agency Fields": {
    "action": "augment",
    "parameters": {
      "left": "Augment Temp Class",
      "right": "ID Agency Records",
      "relationship": "Climate",
      "operation": "LookupSingleValue",
      "left_key": [
        "AugmentTempClass.AccountNumber"
      ],
      "right_key": [
        "AccountNumber"
      ],
      "right_select": [
        "AccountNumber",
        "IsAgency",
        "Name",
        "Phone",
        "ShippingCity",
        "ShippingCountry",
        "ShippingPostalCode",
        "ShippingState",
        "ShippingStreet"
      ]
    }
  }
}
 
  • September 02, 2018
  • Like
  • 0
I'm stucked with below error:

Challenge Not yet complete... here's what's wrong: 
Couldn’t find the 'Create Seed Bank Agencies' node or required fields are missing. Check the challenge and confirm the node name, alias, and required fields.

My Json:
/*/*/*

{
  "Add Agency Fields": {
    "action": "augment",
    "parameters": {
      "right_key": [
        "AccountNumber"
      ],
      "left": "Load Account",
      "left_key": [
        "AccountNumber"
      ],
      "right_select": [
        "Acres",
        "Currency",
        "Latitude",
        "Longitude",
        "Region",
        "SubRegion"
      ],
      "right": "Load Agency Detail",
      "relationship": "AgencyDetail",
      "operation": "LookupSingleValue"
    }
  },
  "Filter Agency Records": {
    "action": "filter",
    "parameters": {
      "filter": "IsAgency:EQ:TRUE",
      "source": "ID Agency Records"
    }
  },
  "Load Account": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "AccountNumber"
        },
        {
          "name": "Name"
        },
        {
          "name": "Phone"
        },
        {
          "name": "ShippingCity"
        },
        {
          "name": "ShippingCountry"
        },
        {
          "name": "ShippingState"
        },
        {
          "name": "ShippingPostalCode"
        },
        {
          "name": "ShippingStreet"
        }
      ],
      "object": "Account",
      "filterConditions": [
        {
           "field": "Phone",
           "operator": "!=",
           "value": ""
       }
      ]
    }
  },
  "Create Seed Bank Agencies": {
    "action": "sfdcRegister",
    "parameters": {
      "name": "Seed Bank Agencies",
      "alias": "seed_bank_agencies",
      "source": "Filter Agency Records"
    }
  },
  "ID Agency Records": {
    "action": "computeExpression",
    "parameters": {
      "source": "Add Agency Fields",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "IsAgency",
          "saqlExpression": "case when Phone is not null then \"TRUE\" else \"FALSE\" end\n\n",
          "label": "IsAgency",
          "type": "Text"
        }
      ]
    }
  },
  "Load Agency Detail": {
    "action": "edgemart",
    "parameters": {
      "alias": "Agency_Detail"
    }
  }
}

Please advice
  • September 01, 2018
  • Like
  • 0
I have written Java utility which download salesforce attachments but i'm stucked, my utility is downloading only one attachment. 

Can someone please look into the code and help?

File Name :ExportAttachments.java

package extractordaemon;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sforce.soap.partner.Connector;
import com.sforce.soap.partner.PartnerConnection;
import com.sforce.soap.partner.QueryResult;
import com.sforce.soap.partner.sobject.SObject;
import com.sforce.ws.ConnectionException;
import com.sforce.ws.ConnectorConfig;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import javax.mail.util.ByteArrayDataSource;
import sun.misc.BASE64Decoder;

/**
 *
 * @author hitesh.patel
 */
public class ExportAttachments {

    static final String USERNAME = "<USERNAME>";
    static final String PASSWORD = "<PASSWORD>";
    static final String autURL = "https://login.salesforce.com/services/Soap/u/34.0";
    //static EnterpriseConnection connection;
    static PartnerConnection connection = null;
    static final String ATTACHIDS = "00P50000007HYMJEA4,00P50000007HmAjEAK,00P50000004CmZ3EAK";
    static final String AccountIds = "5007F00000Klxio,5007F00000KlxiS";

    static List<String> str = new ArrayList<String>();
    static List<String> stracct = new ArrayList<String>();
    static Map<String, String> idMap = new HashMap<String, String>();
    static Map<String, String> csvMap = new HashMap<String, String>();

    public static void main(String[] args) {

        ConnectorConfig config = new ConnectorConfig();
        config.setAuthEndpoint(autURL);
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        //config.setTraceMessage(true);
        str = Arrays.asList(ATTACHIDS.split(","));
        stracct = Arrays.asList(AccountIds.split(","));
        for (String s : stracct) {
            idMap.put(s, s);
        }
        try {

            connection = Connector.newConnection(config);
            // display some current settings
            System.out.println("Auth EndPoint: " + config.getAuthEndpoint());
            System.out.println("Service EndPoint: " + config.getServiceEndpoint());
            System.out.println("Username: " + config.getUsername());
            System.out.println("SessionId: " + config.getSessionId());

          
            queryAttachments();
          

        } catch (ConnectionException e1) {
            e1.printStackTrace();
        }

    }
    

    
    private static void queryAttachments() {
        try {
            //for(String s:idMap.keySet()){
            QueryResult queryResults = connection.query("Select Id, ParentId, Name, ContentType, Body "
                    + "From Attachment limit 10");

            if (queryResults.getSize() > 0) {
                for (int i = 0; i < queryResults.getRecords().length; i++) {
                    // cast the SObject to a strongly-typed Contact
                    SObject a = (SObject) queryResults.getRecords()[i];
                    String blob = a.getField("Body").toString().trim();

                    BASE64Decoder decoder = new BASE64Decoder();
                    byte[] imgBytes = decoder.decodeBuffer(blob);
                    writeOnDisk(a.getId() + "-" + a.getField("Name").toString().trim(), imgBytes);
                    System.out.println("I: " + i);
                }
            }
            //}
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    private static void writeOnDisk(String fileName, byte[] bdy) {
        try {
            String filePath = "C://Users//hitesh.patel//Desktop//AUTH//att//" + fileName;

            ByteArrayDataSource rawData = new ByteArrayDataSource(bdy, "application/octet-stream");
            BufferedInputStream reader = new BufferedInputStream(rawData.getInputStream(), 4096);

            FileOutputStream fos = new FileOutputStream(filePath);//File OutPutStream is used to write Binary Contents like pictures

            BufferedOutputStream writer = new BufferedOutputStream(fos, 4096);

            byte[] buf = new byte['?'];
            int byteRead;
           // reader.read(buf, 0, 4096))
            System.out.println("reader : "+reader.read());
            while ((byteRead = reader.read()) >= 0) {
                //writer.write(buf, 0, byteRead);
                writer.write(byteRead);
            }
            reader.close();

            writer.flush();

            writer.close();

        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }
}
I'm doing the simple lightning components challenge and have hit this problem in my existing trailhead org and a brand new dev org that I've just created:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: QVWBQHAG