E9.1 Send message extended and update table simultaneously

iheb94

Member
Hi,
i am new to JDE and i need some help please , my problem is that i want to update a table that i have created and then send an email at the same time , i have used the system function "send message extended" after updating the table.
result: i get the email but the table is not updated .
you can find the code in the attached file.
PS: i am working on E9.1 version
 

Attachments

  • send msg.txt
    4 KB · Views: 11

Kim Schmidt

Well Known Member
The table operations are not being checked for success, and the process continues on regardless if there was an error. If it's your F56BO update that isn't occurring, it might be that the FI mnUniqueKeyIDInternal does not match an existing record in the F56BO table. Since the prior statement is performing a Fetch Single on the same table with the same key, there is an opportunity to test if the record exists or not. So you could insert success tests like this:
. . .
F56BO.Fetch Single
If SV File_IO_Status is not equal to CO SUCCESS
// do appropriate error reporting
Else
F56BO.Update
If SV File_IO_Status is not equal to CO SUCCESS
// do appropriate error reporting
Else
F56HFACT.Insert
If SV File_IO_Status is not equal to CO SUCCESS
// do appropriate error reporting
Else
// perform your send message
End If
End If
End If

There are other ways to do this instead of using nested If, but the principle is to test for success of every table operation. Good Luck with JDE!
 

BBritain

VIP Member
iheb94,

You also need to focus on attention to detail.
1) What is the reason for getting VA evt_structure_P from F0150? It is never used and this is an event level variable?
2) What is the reason for getting VA frm_DescriptionAN8 from F0101? It is never used?
3) You retrieve VA evt_OrderType from F56BO but insert VA evt_DocumentType into F56FACT.
4) You retrieve VA evt_RPER_Insert from F56BO but insert VA frm_PersonResponsible into F56FACT. Did you mean to use different variables?
5) VA evt_DateInvoiceJ, VA evt_VendorInvoiceNumber, VA evt_Company, VA evt_StatusCodeNext, are all variables that have never been set, but are used to insert into F56HFACT.
6) You have an If statement checking whether VA frm_CodeLengthEnvoi is '20', which you hardcoded to '20'. When will it NOT be '20'?

Sometimes "table is not updated" means a record wasn't added, and sometimes it means some of the field are NULL, which would be explained by 1-6 above. If it is "no record" then verify that you are passing a valid FI mnUniqueKeyIDInternal.

Ben again,
 

iheb94

Member
thank you for your responses, i just fixed the problem it was because i am using fetch single and update on the same table F56BO with the same key just as @Kim Schmidt said, so i have disabled the fetch single and now it's working.
 
Top