You need to sign in to do that
Don't have an account?
Meena25
date format issue YYYY/MM to MM/YYYY
BillAndPayWrapper(BillingHistoryServiceSet__x billPay, String companyCode) {
this.postDate = billPay.PostingDate__c;
this.invoice = billPay.InvoiceNo__c;
this.amount = billPay.TotalDueAmt__c.setScale(2);
this.billPeriod = billPay.BillPeriod__c;
billPeriod is string and BillPeriod__c field under external object is data type text . It is external data and i get it as YYYY/MM. But i need to format it to MM/YYYY
this.postDate = billPay.PostingDate__c;
this.invoice = billPay.InvoiceNo__c;
this.amount = billPay.TotalDueAmt__c.setScale(2);
this.billPeriod = billPay.BillPeriod__c;
billPeriod is string and BillPeriod__c field under external object is data type text . It is external data and i get it as YYYY/MM. But i need to format it to MM/YYYY
Hope that your day is off to an amazing start. Below is a way to format your data. Hope this helps and may God bless you abundantly.
Best Regards,
Anthony McDougald
All Answers
Hope that your day is off to an amazing start. Below is a way to format your data. Hope this helps and may God bless you abundantly.
Best Regards,
Anthony McDougald
setScale(2) doesn't work for me. Any thoughts?
Hope that your day is off to an amazing start. Is the amount field of type currency or number? Looking forward to helping you and may God bless you abundantly.
Best Regards,
Anthony McDougald
@AuraEnabled public DateTime postDate;
@AuraEnabled public String billPeriod;
@AuraEnabled public Boolean showSuccess;
@AuraEnabled public String invoice;
@AuraEnabled public Decimal amount;
@AuraEnabled public String amount_formatted;
@AuraEnabled public String docType;
@AuraEnabled public String pdfDocURL;
BillAndPayWrapper(BillingHistoryServiceSet__x billPay, String companyCode) {
this.postDate = billPay.PostingDate__c;
this.invoice = billPay.InvoiceNo__c;
this.amount = billPay.TotalDueAmt__c.setScale(2);
this.billPeriod = billPay.BillPeriod__c;
this.billPeriod = this.billPeriod.right(2) + '/' + this.billPeriod.left(4);
if (amount<0) {
amount=amount*-1;
this.amount_formatted = '($' + String.valueOf(amount.format()) + ')';
showSuccess=true;
}
else this.amount_formatted = '$' + String.valueOf(amount.format());
please note: Amount field in external object datatype is number