maybe someone else has done it that way, id have t...
# suitescript
v
maybe someone else has done it that way, id have to go test it out
m
How did you do this? Using client scirpt?
v
yeah, i did a client script on the address form. here's what i did:
function saveRecord(){ if (nlapiGetFieldValue('defaultshipping') == 'T') { nlapiSetFieldValue('defaultshipping', 'F'); } }
m
Let me try the same thing and check if it works?
Is this working on transaction or on customer record?
Because this opens another address record once I save it, but nohting happens
v
its works on the address book, anywhere you use an addr
it's its own table im pretty sure
m
Okay, I added the code on address form the same code you sent.
Once I save the address for an existing sales order, it doesnt uncheck it.
v
did you forget to reference your saveRecord function on the form customization options?
m
No I didnt. I put the save record function
Finally Go it done.
This is what I have used
var customer = nlapiLoadRecord('customer',83713,{recordmode: 'dynamic'}); var dfltBillgAddrList = customer.findLineItemValue('addressbook','defaultshipping', 'T'); nlapiLogExecution('DEBUG','aftersubmit()','dfltBillgAddrList ='+dfltBillgAddrList); var dftshippadress = customer.getLineItemValue('addressbook','defaultshipping',dfltBillgAddrList); nlapiLogExecution('DEBUG','aftersubmit()','dftshippadress ='+dftshippadress); customer.selectLineItem('addressbook', dfltBillgAddrList); customer.setCurrentLineItemValue('addressbook', 'defaultshipping', 'F'); customer.commitLineItem('addressbook'); var id = nlapiSubmitRecord(customer);