does url,resolveTaskLink not pass values to custom...
# suitescript
p
does url,resolveTaskLink not pass values to custom fields? I see the url has the custom fields and values I am trying to pass but the fields themselves are not being populated. I do have the native fields populated though (subsidiary, entity, sales rep). Code is here:
Copy code
var redirectUrl = url.resolveTaskLink({
    id: 'EDIT_TRAN_OPPRTNTY',
    isEditMode: true,
    params: {
        'e': true,
        'subsidiary': erSubsidiary,
        'entity': erCustomer,
        'custbody_eym_contact': erContact,
        'custbody_eym_standno': erStand,
        'salesrep': erSalesRep,
        'custbody131': erCallRep
    }
});

window.open(redirectUrl);
}
and the params part of the url is here:
Copy code
&e=true&subsidiary=2&entity=86623&custbody_eym_contact=86624&custbody_eym_standno=1234&salesrep=48911&custbody131=48911
b
every record has a set list of default values which work as query parameters
for opportunities, that list includes subsidiary and entity
it doesnt include the custom ones
the ui allows you to default body fields using the record.{script_id} syntax
p
thanks. i actually see the issue. When I am creating the params - for the custom fields I need to add 'record.' before the field id. For the text fields that works. but the field custbody_eym_contact and custbody131 are list/record fields and I am passing the id. those are now not populating.
b
so instead of using
custbody_eym_contact
as the key, you can use
record.custbody_eym_contact
you probably want to check if those are valid ids for the fields you are trying to set
p
they are valid. For example the salesrep field and custbody131 both are list/record of employees and both have the same value but only the salesrep is populating. adding
record.
before the id works for the text fields but not for the list/records.
b
no known restriction on lists/records i know of beyond being able to set that field normally in the ui
p
if i go into browser console in that record and do
nlapiSetFieldValue('custbody131', 48911)
the field does set. I even tried hardcoding the params for that field as a test but still did not populate.
got it to work. i added a field to the oppoortuntiy of the list/record type of the custom record I am creating it from and then added that record id to the params to pass that (ie. link the 2) and now it works.