Message Boards

Unable to show User's Phone Number in User contact Section

Muhammad Umair, modified 3 Years ago.

Unable to show User's Phone Number in User contact Section

New Member Post: 1 Join Date: 10/8/20 Recent Posts

I have a problem while adding phone number, I successfully added phone to Phone table but unable to view on front Contact section of User

long userId=user.getUserId();
        long classPk=(user != null ? user.getUserId() : 0);
        String className="com.liferay.portal.kernel.model.Contact";
        phone=ParamUtil.getString(actionRequest, "Phone");
        PhoneLocalServiceUtil.addPhone(userId, className, classPk, phone, "302",11011, false, serviceContext);

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Unable to show User's Phone Number in User contact Section

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

Hi ,

classsPK need to be contact Id , as in your case your passing userId , Pls try with sending contactId for classPK .

    

Daniya Niazi, modified 1 Year ago.

RE: Unable to show User's Phone Number in User contact Section

New Member Posts: 4 Join Date: 9/9/22 Recent Posts

@mohammad Umair can you please tell what are parameters after phone number what is typeId and extension