• CarnVanBeck
  • NEWBIE
  • 5 Points
  • Member since 2016
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 1
    Replies
I'm trying to parse a Time field from my lightning component to my apex controller by using JSON and deserializing it in apex into an existing Object.
But unfortunately I'm always getting the error
Cannot deserialize instance of time from VALUE_STRING value 10:30:00.000Z

I already tried different Time formats and with/without quotes "" in my JSON
  • 10:30
  • 10:30:00
  • 10:30:00.000
  • 10:30:00.000Z
  • T10:00:00.000Z
  • 2018-06-07T10:00:00.000Z
But nothing works.
My Org is on Spring 18 API Version 42
I have an SObject (Event__c) with a Time Field
The problem is reproducable in anonymous apex with following code
Event__c workingObject = new Event__c();
workingObject.Name = 'Lorem';
workingObject.Public_Start_Time__c = Time.newInstance(10,10,10,10);

String serializedObject = JSON.serialize(workingObject);
String mixedObject = '{"Public_Start_Time__c": "' + workingObject.Public_Start_Time__c + '", "name": "Ipsum"}';
String manualObject = '{"Public_Start_Time__c": "2018-06-07T10:00:00.000Z", "name": "Dolor"}';
try {
   Event__c banana = (Event__c)JSON.deserialize(serializedObject, Event__c.class);
}
catch(Exception ex) {
    System.debug(ex.getMessage());
}

try {
   Event__c banana = (Event__c)JSON.deserialize(mixedObject, Event__c.class);
}
catch(Exception ex) {
    System.debug(ex.getMessage());
}

try {
   Event__c banana = (Event__c)JSON.deserialize(manualObject, Event__c.class);
}
catch(Exception ex) {
    System.debug(ex.getMessage());
}
which results in the 3 following messages
Cannot deserialize instance of time from VALUE_STRING value 10:10:10.010Z or request may be missing a required field
Cannot deserialize instance of time from VALUE_STRING value 10:10:10.010Z or request may be missing a required field
Cannot deserialize instance of time from VALUE_STRING value 2018-06-07T10:00:00.000Z or request may be missing a required field

Everything I found so far was for dates or datetimes but not time only.

I made a Post at stackexchange:
https://salesforce.stackexchange.com/questions/220809/cannot-deserialize-instance-of-time-from-value-string-value

As a workaround I have build my own time parser, but it would be great if this could be fixed
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

 
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

 
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

 
Hello

I am stuck on the  Improve your Classic App by Moving to Lightning Experience module
It refers to Dreamhouse Classic app
Where is it to be found ? several project relies on this but I only have DreamHouse app, not the Classic one
thanks