Js validation on meeting module create view in sugarcrm Mobile app

Hi All,

I have one use case, as a sugarcrm user if I am creating meeting for converted lead then system should display error popup message "meeting cannot be created for converted prospect." on meeting create view in sugarcrm Mobile app.

Can anyone suggest how to add above js validation on meeting module create view in sugarcrm Mobile app

Please suggest asap.

Kindest Regards,

Shreya

Parents
  • Hi  ,

    Without going through Sugar's SDK development, you could achieve this by throwing an Exception in a LogicHook to control the creation of record in mobile. You can filter the platform value from the session variables so it will only execute the logic in the mobile app:

    Fullscreen
    1
    $_SESSION['platform'] == 'mobile'
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.1/Integration/Web_Services/REST_API/API_Exceptions/index.html

    The downside is that, it won't show the custom error message that you specify in the hook and it will just throw a generic Sugar error message in the App unless the bug has been resolved in the recent versions.

    I hope that helps.

    Thank you.

    Regards,

    Kaizer

  • Hi Kaizer,

    Thanks for responding, I was also trying same way with below exception::

    "throw new SugarApiExceptionInvalidParameter('error message here');" in logic hook and on browser it show as error message same how sugar shows errors on UI but in mobile view it shows error in Chrome's developer tools -> Network tab and on mobile UI it show generic message to user "Internal error 422, please try again later", is there any way to display error on mobile UI?

    Please suggest?

    Kindest Regards,

    Shreya 

Reply
  • Hi Kaizer,

    Thanks for responding, I was also trying same way with below exception::

    "throw new SugarApiExceptionInvalidParameter('error message here');" in logic hook and on browser it show as error message same how sugar shows errors on UI but in mobile view it shows error in Chrome's developer tools -> Network tab and on mobile UI it show generic message to user "Internal error 422, please try again later", is there any way to display error on mobile UI?

    Please suggest?

    Kindest Regards,

    Shreya 

Children
  • Hi  ,

    I think there is no option to display your own error message until this improvement or defect is fixed for upcoming editions.

    When the generic error is issued in the mobile, perhaps you might edit the label of that field to show the description of the issue as a workaround. You may include a brief explanation of the problem given that it can display the custom error code. The "name" field's label, for instance, may be changed to "Name (Exception 422: Meeting cannot be created for converted prospect)".

    You are allowed to modify the label you can use in the mobile views because, as you are aware, the views for the web and mobile platforms are independent.

    Regards,

    Kaizer