function getMonthName() { try { const monthNames = [‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’]; let currentDate = new Date(); … Continue reading How to get the names of next two months
Author: Linu Paul
How to get the last working day of the current month
/** * @description This function is used to find the last day of each month * @param {*} year * @param {*} month * @returns lastDay */ function getLastWorkingDayOfMonth(year, month) {… Continue reading How to get the last working day of the current month
How to create an Email-template through script
/** * @description – This function is used to create the email template * @returns string */ function createEmailTemplate(requestBodyJSON, fileId) { try { let fileUrl… Continue reading How to create an Email-template through script
How to create a bar graph using D3 library
function embedChart(barDetails, cusName) { barDetails = barDetails.map(value => parseFloat(value)); let chartScript = `<!DOCTYPE html> <html lang=”en”> <head> <style> … Continue reading How to create a bar graph using D3 library
How to create a PDF of the custom record based on the designed PDF template.
function generatePdf(newRecord) { try { let customId = newRecord.id let xmlTmplFile = file.load({ id: TEMPLATE_ID }); let myFile = render.create(); … Continue reading How to create a PDF of the custom record based on the designed PDF template.
How to attach the PDF file into a custom record
function customerPdfAttachment(newRecord, cusId) { try { let fileId = generatePdf(newRecord); if (checkForParameter(cusId) && checkForParameter(fileId)) { record.attach({ … Continue reading How to attach the PDF file into a custom record
How to identify the exact color from a picture
Click on the below link. Color Picker – Color from Image, HEX, RGB, HTML | RedKetchup take the screenshot of a picture and paste it here. Then the color-picker tool will pick the exact color
How can one verify the presence of a specific value within a given range?
yearExp = parseFloat(yearExp); // Loop through the ranges object to find the range for the given number let result = Object.keys(searchResult).find(range => { … Continue reading How can one verify the presence of a specific value within a given range?
How to find out the index of a particular field value from an array of object
let a = resultArrayDiscount.findIndex(item => item[“Item Category List”].value === resultArrayItem[i][“Item Category”][“value”]); let discount = 0; let discountCodePercentage = ”… Continue reading How to find out the index of a particular field value from an array of object
How to check the file size before creating the file
let renderAsString = renderObj.renderAsString(); let strXmlEncoded = encode.convert({ string: renderAsString, inputEncoding: encode.Encoding.UTF_8, … Continue reading How to check the file size before creating the file