Pre built function failure: thisapp.portal.assignUserInProfile();

Pre built function failure: thisapp.portal.assignUserInProfile();

Hi, I have a function that automates the process of creating an account for customers for the customer portal.

The problem is if a blocked email address is passed through it ends the whole function.

This displays a huge error message and its non-developers that use this function. Is there a way I can handle this fail to display a better message and to also warn the development team on where and why the failure has happened?

A test example of the part of the function thats causing the problem:

string dummy.PractTest(string email)
{
 
    strPortalPractitionerFullAccessProfile = "Practitioner Full Access";

    //The error message is caused here when a blocked email is passed through
    strCreateResponse = thisapp.portal.assignUserInProfile(email,strPortalPractitionerFullAccessProfile);

    mapCreateResponse = strCreateResponse.toMap();
    checkEmailInput = mapCreateResponse.get("emailId");
    checkProfileInput = mapCreateResponse.get("profileName");

    if(checkEmailInput != null && checkProfileInput != null)
    {
             strMessage = "do somthing";
    }
    else
    {
        /strMessage = "do somthing";
    }
    return strMessage;
}

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation
                                              • Sticky Posts

                                              • How to Add Users to your Organization in ZohoMail?

                                                A better clarity so you can create other users to start using Zoho Mail. You can directly Add Users from the Control Panel to your Organization. You can invite users with the existing email address. If the person (user) already uses ZohoCRM, then you can import users from Zoho CRM. You can also import them using a .csv file. (if you are planning to add them in Bulk)  In this topic, We will be discussing on how to Add and Invite users only.  The Import options are self explanatory. ____________________________________________________________________________________________________________


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now