Hello people, I am working with ClientScript for t...
# suitescript
a
Hello people, I am working with ClientScript for the first time. I want to use fieldChanged event only. Can I use it to populate a sublist field upon any change in a dependent field? Thanks
a
yes but you have to be able to identify the line of the sublist somehow, or loop through all of them I guess?
a
Is there any other entry point in Client Script to be able to do that?
I want to populate a line field, upon change in the dependent line field.
a
you probably do want field change just exit early if the context sublist doesn't equal your sublist
Copy code
function fieldChange (context){

    if (context.sublistId !== "item") return;

    if(context.fieldId !== "myDependentFieldId") {
        //set field here
    }
}
a
I'll try it. Thanks.
👍 1