Error while Calling a Function

navuser1navuser1 Member Posts: 1,329
Hi all,

I am facing a error message at time of calling a Function. ](*,)

Function Name = GetNeededQty;
Parameters = ProdOrderComp ( Record = Prod. Order Component )

Error Screen msg :


Custom Function :


What is the reason ? Kindly reply. [-o<
Now or Never

Answers

  • kapamaroukapamarou Member Posts: 1,152
    Do you have a field or variable with the same name as the record?
  • navuser1navuser1 Member Posts: 1,329
    kapamarou wrote:
    Do you have a field or variable with the same name as the record?

    No.

    I have created this Function in the Report named Prod. Order - Job Card (ID 99000762).
    And Calling this function in the Prod. Order Component - OnAfterGetRecord().
    Now or Never
  • kapamaroukapamarou Member Posts: 1,152
    I saw the call to the function. Try the following:

    Rename the DataItem variable on your report as RecA (or something...)

    If you leave the call exactly as is do you get an error that "Prod. Order Component" is not declared?
  • navuser1navuser1 Member Posts: 1,329
    kapamarou wrote:
    I saw the call to the function. Try the following:

    Rename the DataItem variable on your report as RecA (or something...)

    If you leave the call exactly as is do you get an error that "Prod. Order Component" is not declared?

    Error is As it was
    Now or Never
  • kapamaroukapamarou Member Posts: 1,152
    Yes... I saw all that.

    If this error occurs in the call to GetNeededQty then it seems that for some reason the caller passes an Option as a parameter, and not a Record.

    So my initial question was:
    Is there a possibility that there is a field on "Prod. Order Component" table with the name
    "Prod. Order Component"? Is there a local or global variable with the name "Prod. Order Component"?
  • navuser1navuser1 Member Posts: 1,329
    kapamarou wrote:
    Yes... I saw all that.

    If this error occurs in the call to GetNeededQty then it seems that for some reason the caller passes an Option as a parameter, and not a Record.

    So my initial question was:
    Is there a possibility that there is a field on "Prod. Order Component" table with the name

    I'm working in Nav 5.0 Sp1 and no field is there with the same name.
    kapamarou wrote:
    "Prod. Order Component"? Is there a local or global variable with the name "Prod. Order Component"?

    This is the Last dataitem of the Report and there is a parameter named ProdOrderComp ( Record = "Prod. Order Component" ) of the function.

    The Function is Called everywhere without throwing any compiling error but not in the Prod. Order Component - OnAfterGetRecord().
    :-k :-k :-k
    Now or Never
  • kapamaroukapamarou Member Posts: 1,152
    kapamarou wrote:
    The Function is Called everywhere without throwing any compiling error but not in the Prod. Order Component - OnAfterGetRecord().

    This is crucial info.

    Could there be a GetNeededQty function with (different parameter) on the "Prod. Order Component" table?
  • navuser1navuser1 Member Posts: 1,329
    kapamarou wrote:
    kapamarou wrote:
    The Function is Called everywhere without throwing any compiling error but not in the Prod. Order Component - OnAfterGetRecord().

    This is crucial info.

    Could there be a GetNeededQty function with (different parameter) on the "Prod. Order Component" table?

    Yes kapamarou. I have found the same before YOU :wink:

    Thanks for your support. :thumbsup:

    Merry Christmas & Happy New Year to all of you.
    Now or Never
  • kapamaroukapamarou Member Posts: 1,152
    You're welcome.

    Merry Christmas :)
Sign In or Register to comment.