Jump to content


Willkommen im Coresystems Community Forum

Dieses Forum wird nicht mehr weiter betrieben.
Sollten Sie eine Lösung für eine spezifische Aufgabenstellung suchen wenden Sie sich bitte an unseren Support: helpdesk.coresystems.ch.
Für allgemeine Produktinformationen kontaktieren Sie unser Sales-Team: sales@coresystems.ch

Welcome at the coresystems community forum

This forum is no longer being maintained.
If you need a specific solution please contact our support: helpdesk.coresystems.ch.
For general product information do not hesitate to contact our sales team: sales@coresystems.ch

How to debug by displaying SAP’s LastError?

debug coresuite country package SAP B1

  • Please log in to reply
No replies to this topic

#1 Guest_kau_*

Guest_kau_*
  • Guests

Posted 7 May 2015 - 09:30

(Original Blog Post from Juan Pablo Guerena-Moran, coresuite expert, posted at the 13.05.2013)

 

One of the greatest advantages of using coresuite customize is the ability to create any type of documents. While creating documents we have to be very careful with the information we provide in the code to create this document, if we provide insufficient or invalid data the document will fail to create.

Sometimes it is difficult to notice the reason why the document failed because we don't get any feedback or display error from the system when the action is done. We think that the document was created but then we notice that nothing happened. In support it is common to receive questions about why a code is not working if everything is compiling inside the rule.

There are several tools inside coresuite customize and also from sdk that will help us to debug our code and know what is missing in our document/rule.
 

Let say we want to create a new Journal Entry when we press a button. 
In the following code we give the instructions to the system to create a new one, but we are posting something invalid, our JE is unbalanced.
 

Let say we want to create a new Journal Entry when we press a button. 
In the following code we give the instructions to the system to create a new one, but we are posting something invalid, our JE is unbalanced.
 

b01_3.png

If we compile our code, everything will be compiled successfully, but if we try our code it won't display any error, it won't create any Journal Entry and it will display the message that the Journal Entry was created.

If we compile our code, everything will be compiled successfully, but if we try our code it won't display any error, it won't create any Journal Entry and it will display the message that the Journal Entry was created.

b02_2.png

The best approach in order to get what is wrong in the document is to use getLastError functionality.

So we can change our last part of the code to look like the following:

The best approach in order to get what is wrong in the document is to use getLastError functionality.

So we can change our last part of the code to look like the following:

b03_2.png

Adding this code will let us to get the following error displayed and as consequence we will be able to tell what was wrongly defined.

Adding this code will let us to get the following error displayed and as consequence we will be able to tell what was wrongly defined.

b04_2.png

This solution is very easy to use and can help us to save minutes and minutes of trying to figure out what it is wrong in our code.

This solution is very easy to use and can help us to save minutes and minutes of trying to figure out what it is wrong in our code.

 







Also tagged with one or more of these keywords: debug, coresuite country package, SAP B1

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users