New answers tagged

2

I don't think that using an aggregate query on Agent is the right approach here. Aggregate functions and the GROUP BY keyword are meant to aggregate data about a group of records (what is the maximum value of field X for this group of records?) rather than pull out a single record from a group. What you're looking for here, assuming that CaseId is a lookup ...


-1

You are trying to write Aggregate query which cannot be assigned to list AggregateResult[] lstAggregareResult = [SELECT WorkItemId, Id, CaseId, MAX(CreatedDate) FROM Agent GROUP BY WorkItemId]; and then you can iterate over aggregate list for further computation as: for(AggregateResult objAggre: lstAggregareResult ){ }


2

The issue is here this.CurrentDate.getMonth(). The month starts with 0 and not 1. 0 -> Jan 1 -> Feb . . 10 -> Nov 11 -> Dec Src: https://www.w3schools.com/jsref/jsref_getmonth.asp Thus to fix your code, you have to add 1 in your month when you create full date. this.fulldate = this.CurrentDate.getFullYear() +'-'+(this.CurrentDate.getMonth()+...


6

event.target.values a string, not a date. You need to convert the value to date first then you need to subtract it. import { LightningElement, track } from 'lwc'; export default class LightningExampleInputDate extends LightningElement { @track date1; @track date2; @track result; datehandler1(event) { this.date1 = new Date(event....


Top 50 recent answers are included