mg2017
10/06/2022, 6:14 PMmg2017
10/06/2022, 6:14 PMMike Robbins
10/06/2022, 6:18 PMcolumns: [
{
"name": "formulatext_0",
"formula": "'<a href=\"/app/site/hosting/scriptlet.nl?script=customscript_custom&deploy=customdeploy_deploy&' || 'recordType=' || {recordtype} || '&recordId=' || {internalid} || '\">' || {tranid} || '</a>'"
}
]
mg2017
10/06/2022, 6:46 PMreptar
10/06/2022, 6:52 PMmg2017
10/06/2022, 6:52 PMreptar
10/06/2022, 6:53 PMconst createRecordLink = (recordId, recordType) => {
const searchToRecordMap = {
CustInvc: record.Type.INVOICE,
CustCred: record.Type.CREDIT_MEMO,
VendBill: record.Type.VENDOR_BILL,
ExpRept: record.Type.EXPENSE_REPORT,
VendCred: record.Type.VENDOR_CREDIT
};
const domain = url.resolveDomain({hostType: url.HostType.APPLICATION});
const recordPath = url.resolveRecord({
isEditMode: false,
recordId: recordId,
recordType: searchToRecordMap[recordType]
});
return `https://${domain}${recordPath}`;
};
mg2017
10/06/2022, 10:52 PMreptar
10/06/2022, 11:22 PMreptar
10/06/2022, 11:23 PMmg2017
10/07/2022, 11:55 AMvar doc_number_url = nsfResolveRecordUrl(record_type, internal_id)
var doc_number_url_link = result.getValue({
name: "formulatext",
formula: '<a href=' || {doc_number_url} || ' target=_blank>Link</a>'
});
sublist.setSublistValue({
id: 'custpage_doc_number',
line: counter,
value: doc_number_url_link
});
Mike Robbins
10/07/2022, 1:20 PMsearch.create({
type: '',
filters: [],
columns: [
{
"name": "formulatext_0",
"formula": "'<a href=\"/app/site/hosting/scriptlet.nl?script=customscript_custom&deploy=customdeploy_deploy&' || 'recordType=' || {recordtype} || '&recordId=' || {internalid} || '\">' || {tranid} || '</a>'"
}
]
);
After you run the search and get the results, you can put this value in a TEXT field in your sublist like this:
sublist.setSublistValue({
fieldId: 'your_field_id',
value: result.getValue({ name: 'formulatext_0' }),
line: I
});
If you need multiple formulas, you can change the _0
in the name to _1
for however many you need.reptar
10/07/2022, 1:24 PMreptar
10/07/2022, 1:24 PMconst val = `<a href=${doc_number_url_link}>Whatever Text</a>`;
sublist.setSublistValue({
id: 'custpage_doc_number',
line: counter,
value: val
});
reptar
10/07/2022, 1:27 PMreptar
10/07/2022, 1:30 PMmg2017
10/07/2022, 3:41 PM