+ Start a Discussion
Bret Fisherkeller 9Bret Fisherkeller 9 

Einstein Predictive Vision Service - Create the Visualforce page

I pasted the apex code exactly as is shown in the lesson, but when I run preview I get the error:

List has no rows for assignment to SObject

Here is the code, which I think is fine, but I'm thinking there is a dependency that is preventing a result.

<apex:page Controller="VisionController">
  <apex:form >
  <apex:pageBlock >
      <apex:image url="http://metamind.io/images/generalimage.jpg">
      </apex:image>
      <br/>
      <apex:repeat value="{!AccessToken}" var="accessToken">
          Access Token:<apex:outputText value="{!accessToken}" /><br/>
    </apex:repeat>
      <br/>
      <apex:repeat value="{!callVisionUrl}" var="prediction">
          <apex:outputText value="{!prediction.label}" />:<apex:outputText value="{!prediction.probability}" /><br/>
      </apex:repeat>
  </apex:pageBlock>
<!--  <apex:pageBlock > -->
<!--      <apex:repeat value="{!callVisionContent}" var="prediction"> -->
<!--          <apex:outputText value="{!prediction.label}" />:<apex:outputText value="{!prediction.probability}" /><br/> -->
<!--    </apex:repeat> -->
<!--  </apex:pageBlock> -->
  </apex:form>
</apex:page>

 
Amit Singh 1Amit Singh 1
Share the apex code in which line it is giving Error so that we can resolve the error.

Thanks!
Dima 8Dima 8
Code in the example is very poorly written, error handling is absent. I wonder if this entire service is written in a similar way. I wonder if the rest is the same I mean if Salesforce paid $32 million for that kind of code.
BozidarBozidar
I had same issue - found error in VisionController apex class line 6. 
Changed code from where Title='einstein_platform'  to where Title='einstein_platform.pem' 
Worked fine after that.