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 Reply
  • 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

Children
  • Hi Kaizer,

    I am using before save hook so can please tell me how we can change field label in before save hook?

    Also, how to show meeting sub panel conditionally in leads record view in mobile app?

    Please suggest.

    Kindest Regards,

    Shreya

  • Hi  ,

    You can create a file in language directory of your custom module:

    ./custom/Extension/modules/Meetings/Ext/Language/en_us.customMobileLabels.php

    // Mobile error labels
    $mod_strings['LBL_NAME_MOBILE_LABEL'] = 'XXX';

    Then manually set the label for the name field in the mobile's edit view file: custom/modules/Meetings/clients/mobile/views/edit/edit.php

    4 => 
            array (
              'name' => 'LBL_NAME_MOBILE_LABEL',
              'label' => '',
            ),

    Regards,

    Kaizer

  • Hi Kaizer,

    I think you didn't understand my query, I mean to throw error in mobile app from before save hook I am using "SugarApiExceptionInvalidParameter" on meeting module.

    So as per you suggestion in last reply how to "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)"."??

    Also, when lead is converted then how to hide meeting create button in meeting sub panel mobile app view in Lead Related module view in mobile?

    Please suggest.

    Kindest Regards,

    Shreya

  • Hi  ,

    As I previously stated, a flaw in the mobile platform prevents the custom error message you deliver on your before_save logic hook from being displayed. Instead, it will always throw a generic error. However, that halts the process of the creation of the meeting record. It's just a matter of how we can let the users know of the error being thrown in the mobile.

    To now, there is no way to manage buttons on a mobile device. Since you can filter the parent id and obtain the Lead's bean data in a before_save, you could always issue an exception and stop the creation of the meeting. Even if the create buttons are enabled you can still control the save part.

    Regards,

    Kaizer

  • You can edit a field's value but not its label directly in a before save hook. Labels are usually specified on the user interface layer and do not change at the database level. To modify how a field appears in the UI, you'll need to customize your application's view templates or UI configuration separately from the before save hook.

         // Show the meeting sub-panel if the lead status is "Qualified." if (leadStatus === "Qualified") {     // Code to display the meeting sub-panel     showMeetingSubPanel(); } else {     // Code to hide the meeting sub-panel     hideMeetingSubPanel(); }