Results 1 to 3 of 3

Thread: Add New Parameters to Business function

  1. #1

    Add New Parameters to Business function

    Hello Team,
    What is the procedure to add a new parameters to the existing C business function?

  2. #2
    Is it a standard JDE function or a custom function? If it is a standard function then the first answer is it is generally to be avoided. If that is not an option (or the pain of changing the function is less than the alternative) then basically you need to find everywhere the data structure is used (generally one to one) and also everywhere the function is called and update. If the function is called from forms, NER's or UBE's then you need to open them in the designer and update. If it is called from other C BSFN's then you'll need to edit the source code directly to accommodate the new DS element. Also be aware new elements will always be appended to the DS, irrespective of what the designer shows.

    Just remember that if you do add an element to a standard DS that your name will be used in vain everytime someone has to apply and ESU or perform an upgrade. Make sure you've got a well maintained change log if you're going to be making those sorts of mods in JDE.
    Russell Codlin
    www.rinami.com
    Capital Asset Management & Manufacturing Specialists
    REST Integration, IoT, Mobile Applications and Job Scheduling for all E1 releases from 9.2 back to 8.11SP1

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,564
    I'll just tag on with what Russell said. If you do decide to add elements to a pristine BSFN DS try to make the new parameters optional or have default values so callers of the BSFN that don't implement your mods are not effected. Then all you really need to do is a full build to make sure all the C code gets recompiled with the new struct - namely BSFNs that call the modded BSFN.

    Having said that I have never found a need to modify a pristine BSFN DS... and we are very heavily modified including many BSFNs. You can often find other ways to "pass" information to a BSFN without modifying the DS directly. If the BSFN you intend to modify makes use of jdeCache the easiest way is to add your own extension or tag cache. This is what we have done with things like the sales order MBF. For example we call AcmeF4211EditLine along with F4211FSEditLine and AcmeF4211EditLine will write to custom jdeCache the additional data that we want passed to F4211FSEditLine and then that custom jdeCache is read by B4200310/311.

    Another way, (and this is a little bit of a hack but it works, and if done correctly is safe and doesn't effect callers that DONT implement the mods), is to store your custom parameters in memory (jdeCache or just plain old jdeAlloc) and then pass a handle to the memory location through an existing BSFN DS member in such a way that flags the BSFN that there is custom params to be picked up. I do this by picking a numeric DS member that is allways a positive value and then pass the handle to the memory location as a negative number. The negative number is the indication to the BSFN that the caller is passing custom params. The handle is used by the modded BSFN to pick up the values out of memory, including the originally intended value for the parameter that the handle was passed in.

    Say you have the following pristine DS:
    Code:
    JCHAR                 szCompany[11];
    MATH_NUMERIC    mnOrderNumber;
    JCHAR                 szOrderType[3];
    ...
    And you want to pass URAB (mnUserDefinedNumber) for order 01000-12345-SO to the modified BSFN.

    Calling BSFN stores the following in memory:
    Code:
    mnOrderNumber = 12345
    mnUserDefinedNumber = 88899
    Uses jdeStoreDataPtr to get a handle to the memory location which returns a value of 1.

    This is what is passed to the modified BSFN
    Code:
    szCompany = "01000"
    mnOrderNumber = -1
    szOrderType= "SO"
    The pseudo code in the modified BSFN looks like this:
    Code:
    if(mnOrderNumber < 0)
    {
       ID handle = mnOrderNumber * -1;
       myCustParams = jdeRemoveDataPtr(hUser, handle)
       MathCopy(&lpDS->mnOrderNumber, &myCustParams.mnOrderNumber); //restore the originally intended order number back in the lpDS parameter
       //you now have access to the value stored in myCustParams.mnUserDefinedNumber 
    }
    //If mnOrderNumber  is >= 0 then it just means an actual order number was passed and the caller didn't implement the mods.
    ...
    if(myCustParams)
       jdeFree(myCustParams);  //or destroy jdeCache, or what ever free action is appropriate

    I usually build a BSFN to set the custom params for the caller so that the ugliness of the implementation is hidden. So from the caller perspective all they do is this:

    Code:
    SetCustomParams
      -> mnOrderNumber = 12345
      -> mnUserDefineNumber = 88899
      <- mnOrderNumberHandle = -1
    
    ModifiedFunction
       -> szCompany = "01000"
       -> mnOrderNumber = mnOrderNumberHandle 
       -> szOrderType = "SO"
    And then in ModifiedFunction
    Code:
    if(mnOrderNumber < 0)
    {
       GetCustomParams
         <> lpDS->mnOrderNumber;  // passes -1, gets set to 12345
         <- mnUserReservedNumber;
    }

    I also use this technique so I can pass custom Form/Report Interconnects. Keeps the public interface pristine and easier to retrofit during ESU/upgrades but still allows for callers to optionally invoke custom functionality.
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.