Hello there, I have a custom field associated with...
# suitecommerce
g
Hello there, I have a custom field associated with an address form. I was wondering if I can access it on the site without having to perform a search. I took a look inside the Address object at the getUserProfile method, but it wasn't there. Is it possible to add it to a Field Set or something in order to retrieve the data?
e
@Gaston Mosteiro you need to perform your own logic. Address module is limited to use only standard fields, at least it was like that the last time I worked on it.
g
Thanks @eminero, I have already made an extension to get the custom field, but I was wondering if there's an easier way to do it.
1
g
@Gaston Mosteiro could you shed any light on how your extension can get a value of a custom entity field?
g
@GWilliams I have a SS2 service on my extension performing a search, like this:
Copy code
var filters = [
                    ["internalidnumber", "equalto", customerId]
                ];

                var join = "shippingAddress";
                var columns = [
                    search.createColumn({
                        name: "addressinternalid",
                        join: join,
                        label: "Address Internal ID"
                    }),
                    search.createColumn({
                        name: "custrecord_....",
                        join: join,
                        label: "Freight Tier"
                    }),
                ];

                var defaultShipAddrSearch = search.create({
                    type: search.Type.CUSTOMER,
                    filters: filters,
                    columns: columns
                });