How to create a C Business Function?

Jashua

Jashua

Active Member
Hello,

Can anyone help me how to create a C Business Function?

I have tired to create while reading the PDF but still I am not clear about the procedure.

Thank you
 
1. Create BSFN Object in OMW (B55xxxxx, B56xxxxx, etc.)
2. Create Data Structs Objects (D55xxxxxA, D55xxxxxB, etc) for the functions that will be declared inside of your BSFN
3. In BSFN Design Aid, create functions inside of BSFN. MyFunc1, MyFunc2, etc.
4. In BSFN Design Aid, for each func created in step 3, assign DS created in step 2.
5. In BSFN Design Aid, select Form|Create. Say yes to all prompts.
6. Open the .h file generated in step 5. In BSFN Design Aid select a grid row for one of your funcs and select Row|Typedef, flip over to your .h file and paste contents, repeate for all funcs/grid rows.

-- at this point you have a BSFN with function definitions and everything stubbed out --

7. Compile (Build BSFN). If done correctly, you should get a clean complile.
8. Open .c file, and start writing the actual logic so your functions will actually do something.
9. repeate steps 7 and 8 until you get tired, bored or it actually works.
 
Hi Boster,

Thanks for the information; this is very helpful.

I have tried on a simple adding Amout1 and Amount 2 values and assigned to Total.
I have completed up to the step 7.Upto this stage its working fine. When I am going to write the logic I am not sure about the Variables declaration and how to pass the values.

I heard about that some API's also to learn for C BSFN.

So can you give some explanation of Sample Code with the same function that will be very helpful for me to understand the code.

Thank You,
Jashua
 
Thats kind of a loaded question for a forum. There are a lot of JDE C APIs for working with their objects and their data types as well as, depending on your release, a bunch of wrapper APIs for string manipulation and other 3rd party libraries. As far as examples go, you have apx. 600 megs worth of examples sitting on your hard drive.

If you want to write C BSFNs I would give the following advice:

1. You must have a strong knowledge of pure ANSI C, if you don't all ready have a firm foundation in ANSI C, I would stop right now with JDE C BSFNs and learn basic ANSI C. You don't have to be a C guru to write JDE C BSFNs, but trying to write JDE C BSFNs w/o knowing basic ANSI C is like trying to put a roof on a house before the foundation is poured.

2. Read all the JDE developer guides especially any special guides on BSFNs, Unicode, etc.

3. Look at existing pristine code for examples. There is really very little specific documentation on specific JDE API calls, most of what I have learned, I have learned by reverse engineering existing JDE code.
 
Hi,

I also started how to create C BSFN's in JDE. I did not find any relevant documents to it. can you please suggest me some of them?

It will be really helpful to me.

Thanks & Regards
 
1. Create BSFN Object in OMW (B55xxxxx, B56xxxxx, etc.)
2. Create Data Structs Objects (D55xxxxxA, D55xxxxxB, etc) for the functions that will be declared inside of your BSFN
3. In BSFN Design Aid, create functions inside of BSFN. MyFunc1, MyFunc2, etc.
4. In BSFN Design Aid, for each func created in step 3, assign DS created in step 2.
5. In BSFN Design Aid, select Form|Create. Say yes to all prompts.
6. Open the .h file generated in step 5. In BSFN Design Aid select a grid row for one of your funcs and select Row|Typedef, flip over to your .h file and paste contents, repeate for all funcs/grid rows.

-- at this point you have a BSFN with function definitions and everything stubbed out --

7. Compile (Build BSFN). If done correctly, you should get a clean complile.
8. Open .c file, and start writing the actual logic so your functions will actually do something.
9. repeate steps 7 and 8 until you get tired, bored or it actually works.

10. flip a table
 
Hi Nagendra/Jashua,

If you want to learn on C - BSFN just start with simple BSFNs like B0400009 which is used to retrieve the company(CO) from F0901 by passing Account ID

Regards
Sujit R
 
Hi Sujith,

Thanks for the advice. I am trying to write cache business function. I need to create cache to add values into the table and fetch from the cache. It should be done in application. Can you tell me tips how to write simple MBF using Begin doc,edit doc,end doc?

Thanks & regards
J. Nagendra.
 
Hi Nagendra,

Sure. You can reach out to me thru my mail [email protected]. Cache BSFN will be useful particularly for temporary storage of data. So whenever there is a case of work file required to store the data temporarily, then we will prefer Cache BSFN for better performance. Please find the sample cache bSFN I have created to add, delete, update, fetch all, fetch select based on switch cases. It will be helpful to start on cache. Master BSFN delas with cache+transaction property, I guess. I hope mostly there will be no necessity to create master bsfns. Most of the time we will use standard MBFs.

Regards
Sujit R
 

Attachments

  • B59TEST8_C.txt
    15.5 KB · Views: 766
  • B59TEST8_h.txt
    5 KB · Views: 401
Hi Nagendra,

Sure. You can reach out to me thru my mail [email protected]. Cache BSFN will be useful particularly for temporary storage of data. So whenever there is a case of work file required to store the data temporarily, then we will prefer Cache BSFN for better performance. Please find the sample cache bSFN I have created to add, delete, update, fetch all, fetch select based on switch cases. It will be helpful to start on cache. Master BSFN delas with cache+transaction property, I guess. I hope mostly there will be no necessity to create master bsfns. Most of the time we will use standard MBFs.

Regards
Sujit R



Hi Sujit,

This is very useful information you shared.
 
Back
Top