_updateMeta

Controls accessibility of the Customer Portal for a specified Customer, or can be used to set the Account Sage Number of a Customer instead.

Parameters

id

The ID of the Customer.

meta

The type of data being modified. (Works with "customer_portal" and "account_sage")

val

An integer value, if meta is set to "customer_portal", this sets the accessibility of the Customer Portal for the Customer: 0 => Can visit all 3 pages in the Customer Portal. (Assets, Quote and Invoice) 1 => Cannot visit Assets page but can visit Quote and Invoice pages. 2 => Cannot visit Quote page but can visit Assets and Invoice pages. 3 => Can only visit Invoice page. 4 => Cannot visit Invoice page but can visit Assets and Quote pages. 5 => Can only visit Quote page. 6 => Can only visit Assets page. 7 => Cannot visit any of the 3 pages.

If meta is set to "account_sage" however, this instead sets the Account Sage Number of the Customer.

Examples

With "meta" set to "customer_portal":

FM_api('Customer_updateMeta',[
  'id' => '712686',
  'meta' => 'customer_portal',
  'val' => '5'
]);

(The Customer with an ID of 712686 will only be able to access the Quote page.)

With "meta" set to "account_sage":

FM_api('Customer_updateMeta',[
  'id' => '712686',
  'meta' => 'account_sage',
  'val' => '123467'
]);

(Sets the Account sage number of the Customer with ID 712686 to 123467.)

Results

On Success

{"ok":1}

On Failure

If the "id" parameter is missing or given a value less than 1:

{"error":"missing or invalid parameter: id"}

If the "meta" parameter is missing or empty after being trimmed:

{"error":"missing or invalid parameter: meta"}

If the "val" parameter is not set:

{"error":"missing or invalid parameter: val"}

Last updated