cancel
Showing results for 
Search instead for 
Did you mean: 

BOM verification before saving

Former Member
0 Kudos

Hi,

I need to do BOM adjustments with program code. Because there is no way remove or update a BOM line with code, I have to copy the original BOM to another BOM making changes along the way. When done I have to remove the original BOM and then save the new BOM with the same key item ID as the original BOM. My problem is that if something goes awry and I can't save the updated BOM, there is no way to recover the original BOM. Is there a way to test the integrity of the updated BOM without adding it to the BOM collection?

Thanks,

Mike

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mike,

I am not sure if this will work and you can maybe test it, but have you tried using the Transactions that forms part of the DI API? Look at Company.StartTransaction in the help file.

Hope it helps,

Adele

Former Member
0 Kudos

Adele,

I read through the help file as you suggested but I didn't find it helpful. I know what transactions are but I don't understand how one would help me here. All I want to do is provide a link button in a grid edit-text column. When the user clicks on it, I want to open a form that represents a user-defined object identified by the key value in the cell.

Thanks for your input. Can you clarify?

Thanks,

Mike

Former Member
0 Kudos

Hi Mike,

Your question is not regarding a linked button. Your question is about duplicating a BOM. I have answered the other question too.

Adele

Former Member
0 Kudos

Adele,

Sorry about the confusion. I got this thread confused with another thread I had created. Sometimes the detail of creating addons for SAP B1 is so great, that differentiating issues is a bewildering effort. I see how a transaction would help here.

Thanks for your input. I will take a look at it. Sorry again,.

Thanks,

Mike

Former Member
0 Kudos

No problem, let us know if it works.

Former Member
0 Kudos

Adele,

Thanks for the suggestion. I did use a transaction and it appears to have worked well. While I was deleloping the code to do the BOM update, I had a few instances where it appeared to have rolled back when my code did something bad. But what is the best way to really test it? A BOM-to-BOM copy appears to be more tolarent than a BOM-to-PdO copy. What is a good data way to test the a BOM-to-BOM copy. Can I have the confidence that if my code encounters a situation I didn't acticipate, it will rollback?

Transactions appear to be problematic to test.

Thanks,

Mike

Answers (0)