Emiliano Atala
Emiliano Atala

Reputation: 35

How can i load and edit a customer profile in a RESTlet?

I'm trying to write a Restlet in Suitescript 2.0 to get a customer record and edit its credit card field from an external mobile application. I access to the Restlet using a customer account and Oauth 2.0, and I need get his own profile and edit it, but the response is :

"INSUFFICIENT_PERMISSION\",\"message\":\"Permission Violation: You need the \'Lists -> Customers\

I can't put the customer permission in List > Customers into the customer role, because netsuite platform doesn't allow it. So... How can i do it!?... Help me, please!

function editCustomerCreditCard(requestBody) {

        var user = requestBody.customer

        var customer = record.load({
            type: record.Type.CUSTOMER, 
            id: user.internalid,
            isDynamic: true
        });

        return JSON.stringify(customer)
 }

Upvotes: 1

Views: 452

Answers (1)

felipechang
felipechang

Reputation: 924

You can do user-level permissions in the employee record.

Employee > Access > Global Permissions > Customers

Upvotes: 1

Related Questions