• Izzy Developer
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Hi everyone,

I am currently experiencing an issue with the "Action" dialog's "Object Search" on the "Knowledge" object in the Einstein Bot.

I have an action dialog set up where the:

1.  Action Type:          Object Search
2.  Object:             Knowledge
3.  Search Criteria:    [System] Last Customer Input
4.    Selected Fields:    Title, Answer

When I click on the "Save" button, it throws the following error:
Custom Field Definition ID: bad value for restricted picklist field: Knowledge__kav.Answer__c

The data type of the "Answer" field of the "Knowledge" object is "Rich Text Area(32768).

I tried searching around and looking to see why this error is occurring and where I could fix it.  Unfortunately, I wasn't able to find a solution to this issue.  I'm currently stuck on this problem.  Out of the box, this should work.  The "Answer" field and its data type was created automatically by the Salesforce system when I went through the Knowledge Setup flow.

Any help is greatly appreciated.

Thank you very much

User-added image
Can't find apex class with invocable method in Process Builder on production org. On develop org it works fine.
User-added image
I tryed recompile all classes, it did not help. Class successfuly pass test. Please, what can be wrong?
 
global class SearchObjectWhenCreate {

global class Request {
    @InvocableVariable
    public String objectId;
    @InvocableVariable
    public String searchType;
}

@InvocableMethod
public static void searchObject(List<Request> requests) {

    SearchButtonsController searchButtonsCtrl = new SearchButtonsController();
    List<verf__VF_Search__c> listOfSearches = new List<verf__VF_Search__c>();

    if (Schema.sObjectType.VF_Search__c.fields.Id.isAccessible()){
        listOfSearches = [SELECT Id
                        FROM verf__VF_Search__c
                        WHERE Name =: requests[0].searchType
                        LIMIT 1];
    }
    if(!listOfSearches.isEmpty()){
        searchButtonsCtrl.vf_searchId = listOfSearches[0].Id;
        searchButtonsCtrl.strObjectId = requests[0].objectId;
        searchButtonsCtrl.getObjectInfo();
        searchButtonsCtrl.isCalledFromProcessBuilder = true;
        searchButtonsCtrl.searchRequest();
        request(searchButtonsCtrl.xmlStringxmlRes, searchButtonsCtrl.vf_searchName);
    }
}

@future(callout=true)
public static void request(String xmlStringxmlRes, String searchName) {
    Http httpProtocol = new Http();
    HttpRequest request = new HttpRequest();
    HttpResponse response = new HttpResponse();
    String body = 'request=' + xmlStringxmlRes;

    String endpoint = 'https://viqzrh5hp3.execute-api.us-east-1.amazonaws.com/verified_first';
    request.setEndPoint(endpoint);
    request.setBody(body);
    request.setMethod('POST');

    try {
         if(!Test.IsRunningTest()){
            response = httpProtocol.send(request);
            parseXMLResponce(response.getBody(), searchName);
        }
    } catch(System.CalloutException e) {
    }
}

 

I have an app that does stuff with OpptyTeamMembers, but that app can't be installed in orgs that dont' have it turned on, and I don't want to have to create 2 versions of the app.

 

My solution to this is to make all the opptyTemMember references dynamic using sObjects, but I'm stuck on how to create new records as I get an error trying to do this:

sObject ot=new sObject();

 Error: Type cannot be constructed:sObject

 

I can't simply copy & update an existing opptyTeamMember as the ID fields aren't updatable.  

 

I realize the Apex guide says this isn't possible:

The new operator still requires a concrete sObject type, so all instances are specific sObjects.

 

...but an old thread on the partner API hints that it should be possible:

http://boards.developerforce.com/t5/NET-Development/getting-error-when-using-create-with-the-Partner-wsdl/m-p/27483/highlight/true