Got to be honest I used the netsuite functionality to gain the cost price or average cost via the cost estimate type on the line items on the transactions but created my own margin field for a percentage so that it could be used on a client script and not on a before submit script netsuite standard functionality is that the gross profit gets populated after saving the record