Skip to Content

easy check and error message for different transactions

Hello everybody,

I have the requirement to implement the same check on different transactions (like Lead and Opportunity).

I want to be a good programmer that's why I thought I can create my reuse library, implement an action and call this action from onSave event of my extended Lead and Opportunity.

My problem is, that I have to throw an error message if the check isn't successful.

(Something like: "Please enter XXX")

It is not possible to raise this error message from the reuse function, isn't it?

Does someone has another Idea how to solve this problem without writing the same code 3 or 4 times in different xbos?

Thanks for your help.

Best regards,

Astrid

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Feb 01, 2016 at 04:32 PM

    Hi Astrid,


    You can still use a ReuseLibrary. The respective check method returns a collections of Text in wich you write all errors occuring during the check. In the calling action you can then loop over the result of the library method and simply raise a generic message to which you pass the according text.

    If you also need to distibguish between info, warning and error you can create a Dummy BO that contains an element for the message ype (Info, Warning, ...), the text, and whatever else you need. The result of your check message would then be a collection of elments of the Dummy BO.In your reuse library method you then simply create elements of the Dummy BO fill it with the respective info and add it to the result collection. Again in the calling action you can loop over the result and raise the message you want.

    Cheers,

    Daniel

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.