If I wanted to default some fields on a customers ...
# suitescript
b
If I wanted to default some fields on a customers address subrecord when they are adding a new one, how would I do that? I added the custom field to the address subrecord and I am able to populate it during Customer record beforeSubmit, but I've been asked to set a field on create of a new address subrecord. Any ideas?
b
not really enough information given, the address subrecord is created at the same time as the parent record
you would need to better explain why beforesSbmit is not fulfilling your needs
b
@battk I had it working in beforeSubmit beautifully but then came the request to have it populated on create and I'm not sure it's possible but thought I'd ask the community. What information did I leave out?
b
you would need to better explain why beforesSbmit is not fulfilling your needs
beforeSubmit is on create
b
so the request is that the user is creating a new address and they want the field to be populated before they start filling the rest of the fields out
b
thats usually the role of client script
with the tip here being that a client script deployed to the customer record will also trigger while creating the address subrecord
b
Yes, I should of mentioned I'm working in a client script and just figuring out how to get access to the newly created address subrecord when it has not been saved and doesn't have an ID yet. In this environment each customer has multiple ship to addresses
b
same answer, the client script entry points for a customer will also trigger for the address subrecord
b
no dice for me, tried pageInit, lineInit, validateInsert, none of them fired when adding a new address to a customer. Anyone else have any ideas?
b
b
Thanks for the help @battk not looking possible, unless there is a way when attaching a script to the custom address form you can get information from the customer record, users are looking to have the logic based on the customer's subsidiary