• Jeremy Thomas 15
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

I'm creating a custom lightning-datatable component. As part of it I can edit a field of type "Time". When I do though and click save, I get the following error: "alue for field 'Start_Time__c' is not in ISO 8601 format, Value: 1970-01-01T15:00:00.000Z, Runtime class: java.lang.String"

My save handler looks like this:

const fields = {};
         fields[ID_FIELD.fieldApiName] = event.detail.draftValues[0].Id;
         fields[START_TIME.fieldApiName] = event.detail.draftValues[0].Start_Time__c;

         const recordInput = {fields};
         
          updateRecord(recordInput).then(() => {
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Success',
                    message: 'Contact updated',
                    variant: 'success'
                })
            );

            // Display fresh data in the datatable
            return refreshApex(this.agendaItems).then(() => {
                // Clear all draft values in the datatable
                this.draftValues = [];
            });
          }).catch(error => {
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Error updating or reloading record',
                    message: error.body.message,
                    variant: 'error'
                })
            );
          });
This seems like it should be so simple, but I can't get it to work.

What should I be doing to the value I get from event.detail.draftValues[0].<Time field that was updated> when adding it to the list of fields to update?
I am trying to set up a flow to run an Apex method after an Account gets created.

I can create an InvocableMethod and have it show up as an Action in a Flow.

The issue I'm having is understanding how to connect the dots. InvocableMethod requires you send in a List of items (so List of Accounts in my case?), but I want to be able to run my method every time an Account gets created, so not a List of Accounts but an individual account.

The Flow trigger for record creation obviously returns only one Account, so how do I set up my Flow so that I can run an Apex class on an Account after it gets created?
I am trying to set up a flow to run an Apex method after an Account gets created.

I can create an InvocableMethod and have it show up as an Action in a Flow.

The issue I'm having is understanding how to connect the dots. InvocableMethod requires you send in a List of items (so List of Accounts in my case?), but I want to be able to run my method every time an Account gets created, so not a List of Accounts but an individual account.

The Flow trigger for record creation obviously returns only one Account, so how do I set up my Flow so that I can run an Apex class on an Account after it gets created?