Skip to Content
0

How to add a custom data field to the ORDR table?

Oct 31, 2017 at 06:35 AM

63

avatar image

I need to add a custom field to the ORDR table (Sales orders- header data). Can this be done by User-Defined Fields UI and would the field data be accessible to all users?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Johan Hakkesteegt Oct 31, 2017 at 07:19 AM
1

Hi Waseem,

This is indeed what User Defined Fields and User Defined Tables are for.

Please not that the field will be added to all marketing documents, and the field will be accessible to all users.

There is the third party addon B1UP that allows for even more customization, and if I am not mistaken you can even make fields inaccessible to select users.

Regards,

Johan

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Johan Hakkesteegt Thank you very much. I have two additional programming questions/

1) Is it possible to modify those user field values using the SAP Business One SDK / DI i.e. SAPbobsCOM in c# or VB.Net?

2) How to add a toggle button to the SAP Business One UI (in order panels) to change a user fields value for example from true / false? Can such a user control be added by the UI in SAP B1 9.1?

0

Hi Waseem,

  1. Yes, and as they are user defined fields and tables, you can even use direct sql inserts, deletes, and updates on them. This is handy in cases where you do not need history data of such changes.
  2. There is no toggle type button available in B1 out of the box, but you can create a User Defined Field with predefined values (look for Set Valid Values for Field in the Field Data window), for example 'Y' and 'N' or 'True' and 'False', etc.
    Again the B1UP addon might have a toggle type button, and I am pretty sure it is possible to do it with the SDK. If you want to code such things yourself.

Four tips for you, if you are looking into coding your own addons for B1:

  1. Always first try to achieve your objective with Formatted Searches (popularly known as FMS), User Defined Fields and Tables, and the SBO_SP_TransactionNotification stored procedure. These methods are easier to implement than an addon, and you do not have to recompile and install them with every future B1 update. Once you get the hang of the SDK, it is very tempting to use it to solve every little problem, even when it is not necessary at all.
  2. With the DI API you can create any actual transactions, but I recommend to do all other coding with .NET. I.e. use the DI API as little as possible, because it is just not very efficient.
  3. An addon does not have to run inside the B1 client. You can create a console application for automation that does not require user input, and you can use a Windows application in cases where you do not need or want to install the entire B1 client. The DI API can be referenced like any other dll.
  4. If you ask questions about programming with the SDK here on the SAP Community:
    - use the SAP Business One SDK tag. More people who are specialized in the SDK will see your question.
    - post (only the relevant part of) your code.
    - search for each question first. A lot of questions have already been asked by others. Google will often be better than the search here.
    - try not to add completely different questions to an answered question. You are much less likely to get a response.

Regards,

Johan

1

Johan Hakkesteegt Thank you very much. I have already created some code which updates a user's field. For me, a toggle button is not a must, I see that the user can update the field from the UI by pressing ctrl+shift+U. I have posted another question here asking about user field's change detection in code (I know it can be done by SQL dependency or whatever its called, but maybe there are some built-in SAP hooks or listeners). Here https://answers.sap.com/questions/345010/how-to-run-a-custom-c-script-action-when-a-user-fi.html

0