Get the address sub record from the field.

The getSubrecord() method is used to get the address book fields from a specific field subrecord.

The script code is used as below.

 let subRec = record.getSubrecord({ // Here the record must be the record obj of the required record

                        fieldId: ‘billingaddress’

                    });

                    let addLabel = subRec.getValue({ fieldId: ‘label’ });

                    let addressee = subRec.getValue({ fieldId: ‘addressee’ });

                    let addressOne = subRec.getValue({ fieldId: ‘addr1’ });

                    let addressTwo = subRec.getValue({ fieldId: ‘addr2’ });

                    let country = subRec.getText({ fieldId: ‘country’ });

                    let city = subRec.getValue({ fieldId: ‘city’ });

                    let state = subRec.getValue({ fieldId: ‘state’ });

                    let zipCode = subRec.getValue({ fieldId: ‘zip’ });

We can handle these data as per our requirement.

Leave a comment

Your email address will not be published. Required fields are marked *