• Dev Angel
  • NEWBIE
  • 19 Points
  • Member since 2013
  • Director, Developer Evangelism
  • salesforce.com

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 7
    Replies
I am exploring Metamind Einstein api. I set it up I followed all the steps from refernece link -
Salesforce Codex - Create OCR App (https://salesforcecodex.com/salesforce/create-ocr-app-using-salesforce-einstein-ocr-api/" target="_blank)
This worked perfectly fine untill yesterday it stopped working. I debugged the code and found in the getAccessToken() method while making a rest callout to https://api.einstein.ai/v2/oauth2/token  the response is getting returned as - 
{"message": "Invalid EAI Principal. Principal was not found based on assertion."}
Is there some depreaction happened? Is this no longer valid for token generation. I have the pem file stored correctly and it's getting returned successfully. What does the error mean?
 
#Integration  #New Releases  #Analytics
I know that there is limited "community knowledge" associated with LiveMessage (formerly LiveText from Heywire), but I'm hoping someone (including LiveMessage engineers) can shed some light on an issue I am experiencing.

By way of background - I am attempting to call the LiveText global methods directly (vs. using Process Builder based processes) because I need to do a callout first to shorten a dynamic URL (I am calling bit.ly's URL Shortener API to shorten a Sites based URL that includes dynamic parameters).

If I execute my code synchronously (i.e. via Anonymous Apex) I receive the expected SMS/text message to my mobile phone; however, if I execute the exact same code asynchonously (i.e. via an @future based class) nothing happens, and I don't receive an exception or anything in the 'ActionResult' return.

Here is an applicable code snippet (the last portion is all about sending the results via an email message):

Case cj = [Select Id, AccountId, CaseNumber, CJDT_Exp_Offer_SMS__c, CJDT_Std_Offer_SMS__c, CJDT_Time_Change_SMS__c, 
     Clean_Date__c,  Clean_Job_Date_Time__c, Cleaner_Source__c, Cleaning_Offer_Expiration__c, CleanJobOffers_URL__c, ContactId, 
     Contact.MobilePhone, ContactMobilePhone__c,Disable_Clean_Job_SMS__c, Earliest_Clean_Start__c,  Earliest_Clean_Start_local__c, 
     Hours_Until_Clean__c, IsClosed, Latest_Clean_End__c, Latest_Clean_End_local__c, Next_Reservation__c, Reservation__c, 
     SMS_Cancellation__c, SMS_Clean_Not_Started__c, SMS_Expedited_Offer__c, SMS_Outbound_CJ_Number__c, 
     SMS_Reclean_Request__c,  SMS_Standard_Offer__c, SMS_Time_Change__c, SMS_URL_Accept__c, SMS_URL_Decline__c, Status,
     Subject, Type, Unit__c, Unit_Email__c, Unit__r.Building__r.TimeZone__c, Unit__r.City__c, Unit__r.Cleaner_Primary__c,
     Unit__r.Cleaner_Secondary__c, Unit__r.Unit_Email__c, Unit__r.Name, Unit__r.PostalCode__c, Unit__r.State_Province__c, Unit__r.Street__c,
     Unit__r.UnitNumber__c from Case where Id = '5000m00000310PaAAI'];

list<LiveText.ScheduleItem> schedMsgs = new list<LiveText.ScheduleItem>();

LiveText.ScheduleItem schedItem = new LiveText.ScheduleItem();
schedItem.ObjectId =cj.Id;
schedItem.ReferenceId = cj.Id + ' - Standard Offer';
schedItem.LiveTextNumber = cj.SMS_Outbound_CJ_Number__c;
schedItem.ToPhoneNumber = cj.ContactMobilePhone__c;
schedItem.Message = cj.SMS_Standard_Offer__c;
schedItem.BypassOptinCheck = true;
schedMsgs.add(schedItem);

//send SMS Messages
if(schedMsgs.size()>0){
    String htmlBody = 'Scheduled Messages: '+schedMsgs;
    list<LiveText.ActionResult> results = new list<LiveText.ActionResult>();
    try{
          results = LiveText.ScheduleMessageAction.scheduleMessages(schedMsgs);
          htmlBody += '<BR></BR><BR></BR>Results: ' + results;
    }
    catch(Exception e){
          htmlBody += '<BR></BR><BR></BR>Exception: ' + e.getMessage();
    }
String subject = '** LiveMessage Schedule Messages Result **';
for(LiveText.ActionResult ar:results){
htmlBody += '<BR></BR>Results: ' +  ar.ErrorMessage + ' | IsSuccess: ' + ar.IsSuccess;
}
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(new String[] {'gary@paralleltravel.co'});
mail.setReplyTo('gary@paralleltravel.co');
mail.setSenderDisplayName('Gary Triassi');
mail.setSubject(subject);
mail.setBccSender(false);
mail.setUseSignature(false);
mail.setHtmlBody(htmlBody);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}

The email I receive via Anonymous Apex is:

Scheduled Messages: (ScheduleItem:[BypassOptinCheck=true, EnforceObjectPresence=null, IsAlterScheduleBasedOnReferenceId=null, LiveTextNumber=(209) 418-0548, Message=STANDARD OFFER 00001118/Regular 03/01/18 11:00-23:59 DALVPL1210 Accept (00001118):http://bit.ly/2ETjOhX Decline (00001118): http://bit.ly/2ETjPm1, MessageSource=null, ObjectId=5000m00000310PaAAI, ReferenceId=5000m00000310PaAAI - Standard Offer, ScheduleDate=null, ToPhoneNumber=(925) 699-4740, UseQueueable=null])

Results: (ActionResult:[ErrorMessage=null, IsSuccess=true, Tag=5000m00000310PaAAI])
Results: null | IsSuccess: true

The result received via the @future call is:

Scheduled Messages: (ScheduleItem:[BypassOptinCheck=true, EnforceObjectPresence=null, IsAlterScheduleBasedOnReferenceId=null, LiveTextNumber=(209) 418-0548, Message=STANDARD OFFER 00001118/Regular 03/01/18 11:00-23:59 DALVPL1210 Accept (00001118):http://bit.ly/2ETjOhX Decline (00001118): http://bit.ly/2ETjPm1, MessageSource=null, ObjectId=5000m00000310PaAAI, ReferenceId=5000m00000310PaAAI - Standard Offer, ScheduleDate=null, ToPhoneNumber=(925) 699-4740, UseQueueable=null])

Results: ()

All thoughts and suggestions are greatly welcomed!!
Hi there I'm new to salforce integration and I'm working on an integration with C#. I have been able get the upsertResult- transfer data from my SQL database to SF. The problem is: I have a field in my database that contains the Owners of an account and i want it to populate the Owner field which is a picklist field. I get this error when I try to. Please see screenshot below.

error

Any ideas please?
Hi,
How can I get Javascript log messages (console.log) to appera in the XCode system log (or elsewhere) ?
Whe I run my app in the Safari browser on my Mac, console.log messages appear in the web browser developer console.
However, when running in the (Apple) iOS SImulator, they do not appear in XCode's console.

ANyone had this problem ? 

BTW the Cordova Logger and DebigConsole are declared in the confix.xml : any way to check whether they are active ?

Hope you can help,
Rup
Hi, I am receiving the following message when trying to create an Event fields throught the mobilesdk REST API:

{"errorCode":"JSON_PARSER_ERROR","message":"Cannot deserialize instance of date from VALUE_STRING value  at [line:1, column:32]"}]

It is using a patch call with the following payload:

Date__c: ""
Date_time__c: ""
EndDateTime: "2014-03-19T13:04:34.00Z"
OwnerId: "005E0000000eHwWIAU"
StartDateTime: "2014-03-19T13:04:30.00Z"
Subject: ""
WhatId: ""
WhoId: ""

Is this normal? How can I save a record with a date or datetime field with empty value?

Thanks for replying

Maurizio
Hi all,

to start off, I'm not a coder but just a Salesforce Admin. And I think I'll need to do what I want using a trigger. So if anybody could help me achieve this I would greatly appreciate it.

On and opportunity I've got a custom checkboxfield called Guarantee__c (true or false), I would like that this checkbox is checked whenever I add a product to the opportunity that has in a custom productfield Product_Code__c the word "GUAR". offcourse the checkbox should also be unchecked whenever I remove all products containing the word GUAR.

Just to be clear:

custom field on opportunity: Guarantee__c (checkbox)
custom field on product: Product_Code__c
some products have in the product code the word GUAR  exemple: GUAR-5, GUAR-3, GUAR-7

Whenever adding one or more products to the opportunity which have the word GUAR in their Product_Code__c I want the checkbox on the opportunity Guarantee__c set to TRUE and if the opportunity is not containing any of those products it should be false.

Can anybody help me with how I can get this done?

Thanks in advance
Before '14 release there was a invaluable feature in salesforce to check the covered/uncovered code segments of a particular class or trigger. They were clearly showed with pink and red color so that developers can easily manage the code coverage. But recently forums say it has been moved into developer console. But I can't find that feature even in the console. Please help if anyone know the job.
Hello people,

can someone help me, with the following problem.
I have following code in my Lightning component
<lightning:tabset >
    <aura:iteration items="{!v.Items}" var="item">
        <lightning:tab label="{!item}" onactive="{!c.tabClick}">
            <ui:outputtext value="{!item}" />
        </lightning:tab>
    </aura:iteration>
</lightning:tabset>
The problem is the "onactive" attribute of the lightning:tab, Salesforce says: 
Failed to save undefined: The attribute "onactive" was not found on the COMPONENT markup://lightning:tab: Source

But the sfdc documentation states, that the attribute exists
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_tab.htm?search_text=lightning:tab

Is it, because tabs are still beta or have I done something wrong?

The Lightning inspector shows me this when I save without onactive:
<lightning:tab onfocus="null" onblur="null"

Thanks and Regards