api.customer()

The method api.customer() has been deprecated in 14.0 version.

Deprecated Usage

api to get customerId

Groovy
def customerId = ...

api.customer()

Groovy
def customerId = api.customer("customerId")

def customerName = api.customer("name") //Customer Name
def customerCountry = api.customer("attribute5") //Country
def customerType = api.customer("attribute6") //Customer type

QueryApi Usage

api to get customerId

Groovy
def customerId = ...

qapi.tables().customers()

Groovy
def qapi = api.queryApi()

def c = qapi.tables().customers()

def customerId = ... // Api to get customerId

def customer = qapi.source(c, [
        c.customerId(),
        c.name(),
        c.country,
        c.customer_type],
        c.customerId().equal(customerId))
        .stream {it.find() }

def customerName = customer.name
def customerCountry = customer.country
def customerType = customer.customer_type

Result

Customer Id

Customer Name

Country

Customer Type

CID-0003

Stanley Linda CPA US Ship-to AZ

United States of America

Industry

See Also