E9.1 B4210000 - Cancel Sales Order Line

JDE_MP

Member
Hi All,

Has anyone used the BSFN Cancel Sales Order Line (B4210000)? Does this BSFN work even if we don't pass the session key and line key which are a part of the input parameters?
Also, will it move the status of the order line to 980 999?

Thanks in advance.
 

BOster

Legendary Poster
I believe B4210000 is part of the model in the P42101 MVC framework. Technically I believe you could call it outside of P42101 but I am not sure it is 100% "stand alone". In other words you may have to call a bunch of other sales order "model" functions to set the sales order state before you could call B4210000.

Ultimately it might be easier to simply call B4200310 BegDoc, EditLine (for every line) and EndDoc to cancel the order. There may also be some other "stand alone" function out there that will cancel a sales order but I don't know if there are any or what they are called if they exist... I have always gone the Sales Order MBF route (B4200310).
 

JDE_MP

Member
I believe B4210000 is part of the model in the P42101 MVC framework. Technically I believe you could call it outside of P42101 but I am not sure it is 100% "stand alone". In other words you may have to call a bunch of other sales order "model" functions to set the sales order state before you could call B4210000.

Ultimately it might be easier to simply call B4200310 BegDoc, EditLine (for every line) and EndDoc to cancel the order. There may also be some other "stand alone" function out there that will cancel a sales order but I don't know if there are any or what they are called if they exist... I have always gone the Sales Order MBF route (B4200310).
Thanks for the reply.
If I am not wrong, action code D in F4211 Edit Line is used for cancelling the orders, right? Also, for action code D, is it mandatory to call F4211 Begin Doc as well?
Sorry I am relatively new to these MBFs.
Would really appreciate if someone could help me with how to go ahead using these MBFs for cancelling order lines.

Thanks in advance.
 

BOster

Legendary Poster
Thanks for the reply.
If I am not wrong, action code D in F4211 Edit Line is used for cancelling the orders, right? Also, for action code D, is it mandatory to call F4211 Begin Doc as well?
Sorry I am relatively new to these MBFs.
Would really appreciate if someone could help me with how to go ahead using these MBFs for cancelling order lines.

Thanks in advance.
Yes, it is action 'D' and you probably will need to call F4211FSBeginDoc first and then ultimately F4211FSEndDoc. From our AcmeCancelSalesOrder function:

Code:
dsJdeEL.cCMLineAction = _J('D');
 

eydeak

Reputable Poster
Thanks for the reply.
If I am not wrong, action code D in F4211 Edit Line is used for cancelling the orders, right? Also, for action code D, is it mandatory to call F4211 Begin Doc as well?
Sorry I am relatively new to these MBFs.
Would really appreciate if someone could help me with how to go ahead using these MBFs for cancelling order lines.

Thanks in advance.
Yes, you will need to do the BeginDoc, EditLine, EndDoc. BeginDoc and EditLine are building your transaction in cache and EndDoc is what does the database updates.

Figuring out what parameters to populate is always "fun" for people using them for the first time. You can probably find other discussions on this topic in this forum. As a developer, experimenting is a good way to learn. But I got permission to give you a boost and share the code for simple a BSFN we use to cancel a line. You will probably need to make some tweaks for your business purposes, but it gives you an outline for calling the functions with a small number of parameters.

In general, I have a few techniques I use when trying to figure out how to use MBFs in custom code:

1. Check JDELIST to see if there are any tips.
2. Review other code to see how they are called.
3. Use a base JDE program that uses the MBFs for the same sort of transaction with debug logging and review the debug log to see how it populates the parameters.

Regards,
Ellen
 

Attachments

  • N554918B.txt
    7 KB · Views: 6

JDE_MP

Member
I believe B4210000 is part of the model in the P42101 MVC framework. Technically I believe you could call it outside of P42101 but I am not sure it is 100% "stand alone". In other words you may have to call a bunch of other sales order "model" functions to set the sales order state before you could call B4210000.

Ultimately it might be easier to simply call B4200310 BegDoc, EditLine (for every line) and EndDoc to cancel the order. There may also be some other "stand alone" function out there that will cancel a sales order but I don't know if there are any or what they are called if they exist... I have always gone the Sales Order MBF route (B4200310).

Yes, you will need to do the BeginDoc, EditLine, EndDoc. BeginDoc and EditLine are building your transaction in cache and EndDoc is what does the database updates.

Figuring out what parameters to populate is always "fun" for people using them for the first time. You can probably find other discussions on this topic in this forum. As a developer, experimenting is a good way to learn. But I got permission to give you a boost and share the code for simple a BSFN we use to cancel a line. You will probably need to make some tweaks for your business purposes, but it gives you an outline for calling the functions with a small number of parameters.

In general, I have a few techniques I use when trying to figure out how to use MBFs in custom code:

1. Check JDELIST to see if there are any tips.
2. Review other code to see how they are called.
3. Use a base JDE program that uses the MBFs for the same sort of transaction with debug logging and review the debug log to see how it populates the parameters.

Regards,
Ellen
Thanks a ton Ellen.

I was able to use the MBFs for cancelling the order lines.
Now I face one issue here, when I cancel a single order line, it is updating F4211.KITID with a value which is F4211.LNID*1000. But when I cancel more than one line, it doesn't update the KITID field.
Any idea what could be causing this?
When cancelling a single line from P4210, it doesn't update the KITID field.
I took the logs but still not able to find the cause.
Help and inputs appreciated.

Regards,
MP
 
Top