Liferay - Set Expando Field Value in a Javascript Function

813 views Asked by At

I need to set a User Expando field value in a Javascript Function in liferay. It is possible to do?

1

There are 1 answers

3
Romeo Sheshi On BEST ANSWER

You can use the json api like this way

Liferay.Service(
  '/expandovalue/add-value',
  {
    companyId: 20154,
    className: 'com.liferay.portal.model.User',
    tableName: 'CUSTOM_FIELDS',
    columnName: 'test',
    classPK: 30924,
    data: 'test'
  },
  function(obj) {
    console.log(obj);
  }
);

where

columnName is the name of your custom field

classPK is the entity id in this case userId

data the value of the custom field