Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: BSSV development, how to convert mathnumeric and integers?

  1. #1

    BSSV development, how to convert mathnumeric and integers?

    Hi All,

    I am trying to develop a custom BSSV that makes use of a standard BSFN. The BSFN needs to be passed a mathnumeric value.

    I have created the internal and published components but am having trouble assigning this value between the internal and published components. I read the JDE BSSV guide and they mentioned overloading the set method of the internal value object using something like this:
    ---------------MathNumeric to Integer-----------------------
    public void setNumberField(MathNumeric numberField){
    if(numberField!= null)
    this.numberField= new Integer(numberField.intValue());
    }

    This doesn't work for me. jDeveloper still complains about trying to set a MathNumeric to an Integer. I thought I could get around it by just changing the data type to Integer but the BSSV does not like this when run and complains about trying to cast integers to mathnumerics.

    How do people get around this? I am sure I am missing something simple here?
    Oracle JD Edwards EnterpriseOne,
    E8.12 8.97.2.5
    Websphere 6 Win2K3.
    Forms: Create!form Server 3/Server 6

  2. #2
    Member Chan Rana's Avatar
    Join Date
    Aug 2005
    Location
    PA,USA
    Posts
    998
    The way you have coded is correct so not sure why you still get the error. It may be that the data type in internal and published that you try to map/convert are not actually what you might be type casting. You can check both the variables definitions.

    Chan
    Chandrakant Rana
    E1 Xe-9.0, AS/400, XML, BSSV
    E1 Integration,C,HTML,Java,CreateForm 3.0

  3. #3
    Thanks for the reply.

    Just so I am thinking along the right lines, the internal variable is a MathNumeric type and in the setter method for this variable I should use:
    ---------------MathNumeric to Integer-----------------------
    public void setNumberField(MathNumeric numberField){
    if(numberField!= null)
    this.numberField= new Integer(numberField.intValue());
    }

    The published variable is a type Integer and remains this way. Whats strange is the MathNumeric to Integer code above gives an error right away about being unable to set the incompatible types MathNumeric to Integer. Will have to dig a bit deeper.
    Oracle JD Edwards EnterpriseOne,
    E8.12 8.97.2.5
    Websphere 6 Win2K3.
    Forms: Create!form Server 3/Server 6

  4. #4
    Member Chan Rana's Avatar
    Join Date
    Aug 2005
    Location
    PA,USA
    Posts
    998
    Just a thought but did you import the definition class for Mathnumeric at top?.

    Chan
    Chandrakant Rana
    E1 Xe-9.0, AS/400, XML, BSSV
    E1 Integration,C,HTML,Java,CreateForm 3.0

  5. #5
    New Member
    Join Date
    Jun 2007
    Posts
    22
    Hello

    We use this to populate a line number when we call SO master business fucntion thru BSSV. "new MathNumeric(lineNumber)". The linenumber is an integer.

    Hope this helps.

    8152

  6. #6
    I do have definition classe imported in my internal Processor.

    Attached is what the code and error I am getting looks like.
    Attached Images Attached Images
    Oracle JD Edwards EnterpriseOne,
    E8.12 8.97.2.5
    Websphere 6 Win2K3.
    Forms: Create!form Server 3/Server 6

  7. #7
    Member
    Join Date
    Oct 2001
    Location
    Ontario, Canada
    Posts
    277
    So if this method is for setting a MathNumeric, is the piece of code you posted supposed to accept a MathNumeric or Integer as input?

    Overloading would suggest that you should have two setAssetItemNumber methods, one accepting a MathNumeric and one accepting an Integer.

    The code might be 'something' like this:-

    public void setMnAssetItemNumber(MathNumeric mnAssetItemNumber) {
    if (mnAssetItemNumber != null)
    this.mnAssetItemNumber = new MathNumeric(mnAssetItemNumber());
    }

    public void setMnAssetItemNumber(Integer mnAssetItemNumber) {
    if (mnAssetItemNumber != null)
    this.mnAssetItemNumber = new MathNumeric(mnAssetItemNumber());
    }
    Last edited by TimPierce; 03-14-2016 at 12:39 PM.
    9.2.0.5 EnterpriseOne

  8. #8
    Senior Member johndanter's Avatar
    Join Date
    Sep 2003
    Location
    Cork, Ireland
    Posts
    1,211
    I've got import BIGDECIMAL floating around my head for some reason?
    John Danter
    You don't go out looking for a job dressed like that do you, on a weekday?

    E900 TR 9.1.5.3 Unix

  9. #9
    Quote Originally Posted by TimPierce View Post
    So if this method is for setting a MathNumeric, is the piece of code you posted supposed to accept a MathNumeric or Integer as input?

    Overloading would suggest that you should have two setAssetItemNumber methods, one accepting a MathNumeric and one accepting an Integer.

    The code might be 'something' like this:-

    public void setMnAssetItemNumber(MathNumeric mnAssetItemNumber) {
    if (mnAssetItemNumber != null)
    this.mnAssetItemNumber = new MathNumeric(mnAssetItemNumber());
    }

    public void setMnAssetItemNumber(Integer mnAssetItemNumber) {
    if (mnAssetItemNumber != null)
    this.mnAssetItemNumber = new MathNumeric(mnAssetItemNumber());
    }
    Thanks all for the responses. You are correct, I was mistaken in the way I thought I understood the overloaded methods. Once I did it like the above it all kind of clicked into place and worked as expected.
    Oracle JD Edwards EnterpriseOne,
    E8.12 8.97.2.5
    Websphere 6 Win2K3.
    Forms: Create!form Server 3/Server 6

  10. #10
    Senior Member johndanter's Avatar
    Join Date
    Sep 2003
    Location
    Cork, Ireland
    Posts
    1,211
    Hi folks,

    Can I add a post to this. I am getting the same errors and am pulling my hair out over it. I declared DOCO for example like this......

    public void setMnDocumentOrderInvoiceE_DOCO(MathNumeric mnDocumentOrderInvoiceE_DOCO) {
    this.mnDocumentOrderInvoiceE_DOCO = mnDocumentOrderInvoiceE_DOCO;
    }
    public void setMnDocumentOrderInvoiceE_DOCO(Integer mnDocumentOrderInvoiceE_DOCO)
    {
    if ( mnDocumentOrderInvoiceE_DOCO == null )
    {
    this.mnDocumentOrderInvoiceE_DOCO = null;
    }
    else
    {
    setMnDocumentOrderInvoiceE_DOCO( new MathNumeric(mnDocumentOrderInvoiceE_DOCO) );
    }
    }
    public MathNumeric getMnDocumentOrderInvoiceE_DOCO() {
    return mnDocumentOrderInvoiceE_DOCO;
    }

    That is slightly different to the way Tim has suggested right?
    There is no IF around the mathnumeric declaration. therefore am I right in thinking the mathnumeric will now override the integer one?
    John Danter
    You don't go out looking for a job dressed like that do you, on a weekday?

    E900 TR 9.1.5.3 Unix

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, Oracle or Peoplesoft.