Gurudeep Naik
11/09/2023, 5:09 AMfunction _post(context) {
try {
var rec = record.create({ type: context.recordtype, isDynamic: true });
for (var fldName in context) {
if (context.hasOwnProperty(fldName)) {
if (fldName !== "recordtype" && fldName !== "sublists") {
if (fldName.indexOf("date") !== -1) {
rec.setValue(fldName, new Date(context[fldName]));
} else {
rec.setValue(fldName, context[fldName]);
}
}
}
}
var recordId = rec.save();
return JSON.stringify(recordId);
} catch (err) {
return JSON.stringify(err);
}
}
And this is my object which i am sending data
const data = {
recordtype: "opportunity",
entity: entity,
custbodyreceiveddate:applicationData.createdOn,
entitystatus: "10",
salesrep: 8,
custbodyactionstatus: 4,
department: 4,
cseg_property: property,
custbodytransactionunit: unit,
custbody_ncrr_opp_orig_portal_num: applicationTitle,
custbody_ncrr_opp_hntb_num: HNTBFileNumber,
custbodyportal_link:link,
externalid: `${applicationID}_OPPORTUNITY`,
};
here custbodyreceiveddate is a date field so i am converting it to Date Object in the Reselet Function like this
rec.setValue(fldName, new Date(context[fldName]));
But the Date Field is not adding and it doesnt give any error as well The Received Date is Empty any solution for this?erictgrubaugh
11/09/2023, 5:14 AMapplicationData.createdOn
?Gurudeep Naik
11/09/2023, 5:16 AMwbermudo
11/09/2023, 5:32 AMGurudeep Naik
11/09/2023, 6:27 AM