I'm new to scripting and I'm creating a script that grabs the courier ticket number from the Sales Order/(Shipping Tab)/ Tracking #.
If there is a value in that field I want my script to take that value and append that value to the courier's website url for tracking.
So when our sales people check the above field, they can click on the field which would take them to the couriers website to check on the progress of the sales from time of dispatch.
(We're assuming that the product has been sent and the courier ticket number has been put into the Tracking # field).
Picture below...
Here is the following script I wrote, I uploaded this to the file cabinet, attached it to the appropriate transaction form and then wrote my function name in the PageInit field etc...
I just need a bit of help to steer me in the right direction on this.
Cheers - Bruce
function clientPageInit(){ // Create var which takes value from the Tracking # field var trackField = nlapiGetFieldValue('linkedtrackingnumbers'); // if Tracking # is not empty take that value and append that to the couriers tracking //url if (nlapiGetFieldText('linkedtrackingnumbers') == "") or (nlapiGetFieldText('linkedtrackingnumbers') == 0); { // then set tracking number field to the appropriate entry for tracking on the fastway website nlapiSetFieldText('linkedtrackingnumbers', nlapiGetFieldText("http://www.fastway.co.nz/courier-services/track-your-parcel?l="+trackField)); } }