CHALLENGE :: I have a client script on my Estimate...
# suitescript
j
CHALLENGE :: I have a client script on my Estimate record. I need to be able to fire a function to "do stuff" on address change. Issue I'm running into now is when someone adds a “Custom” Ship to address. I am listening for field change on postSourcing() (see snippet screen shot) My approach is flawed? When the New Address Form pops-up. (It fails because the pop up occurs when the user selects “CUSTOM” in the drop down, then when they submit – nothing changes on the form.). What could / should I be triggering on? Thanks!
a
do you HAVE to do this client side? why not just check on before submit in a UE what the address is and set the territory segment then?
you can probably just use another field instead of shipaddresslist though... not 100% on estimates but I think there's just a ship address text field, you could look at and parse... but not sure if that's populated immediately in a client context. uncomment your log for the fieldname and see what if anything else is triggering in postSourcing... add a fieldChanged entry piont and just log that too so you see what events are happening and work back from there to determine what combination of triggers will work for you
umm i guess make your comments explicit console.log('FC fieldname = ' + fieldName); console.log('PS fieldname = ' + fieldName);
you're literally checking the shipstate and shipcountry fields already to figure out which territory to set? so can you not just check those fields for a change instead of the shipaddresslist?