Here are sample scripts that can accomplish this. User can opt to deploy it as user-event script and use nlapiGetNewRecord() API instead to get the instance of nlobjRecord.
var wlead = rec.getFieldValue('weblead');
To check if the value returned is correct:
Navigate to Lists > Relationships > Customer > View Customer record > Marketing tab> Web Lead field
- This field is not editable in the User Interface and returns Yes if this lead, prospect, or customer record was created as a result of registering through the Web site.
var source = rec.getFieldValue('source');