Utimately I'm trying to create a Created From fiel...
# suitescript
w
Utimately I'm trying to create a Created From field on a custom record. The custom record is created in an AfterSubmit on the Item Fulfillment record. I have created a Free-Form Text field, set the Display type to Inline Text. Also in Validation & Defaulting I have checked the Formula box. This is the bit of code that sets the value.
Copy code
objRecord.setText({
fieldId: 'custrecord_created_from_so',
text: '<a href=' + salesOrderUrl + '>' + salesOrderText + '</a>',
});
I have tried with .setValue and .setText. With this bit of code it just drops in the value but when you view the record you can see the <a href> If I use the console window with the custom record in edit mode and type
nlapiSetFieldValue('custrecord_created_from_so','<a href=https://{url to sales order}>SO10487</a>')
it give me the hyperlink with just the SO10487.
c
You're going about this the hard way. Why don't you just use a List/Record field of type Transaction? That way you get native controls, and when you're in view mode it automatically hyperlinks the transaction, plus it's really easy to set the value. Obviously I'm talking crap if you need to use multiple other record types
w
I think that will do exactly what I want. Thanks for looking at this from a different angle. I'll give it a try in the morning.
@CD Thanks, That worked perfectly.
c
Good to hear 😉