Can't used Function PAGE.RUNMODAL(0,.. As Customized Object

QuickWEQuickWE Member Posts: 80
edited 2013-02-06 in NAV Three Tier
Hello expert

now i have some problems during I'm upgrading my database from 2009R2 --> 2013
When I used Function PAGE.RUNMODAL(0,..) As Customized Object,
My code is PAGE.RUNMODAL(PAGE::"Magazin Journal Archiv",StoffeBuBlArchiv); ,just simple error

I found error

The error is

Microsoft Dynamics NAV Development Environment
The variable is not a record. 'Variable.Field' is invalid.
OK

But for Standard objects can used this function .I 'm not sure .why this error occur ,please give me any guidance for fixed this problems

Thank in advance.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
  • QuickWEQuickWE Member Posts: 80
    Is StoffeBuBlArchiv a record variable?

    Yes, it is a record variable. that already defined. :(
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Please comment the above code and compile again..

    Where is pointer stopping after pressing ok on error mesage?
  • ichladilichladil Member Posts: 68
    In the past I have seen this error in quite tricky conditions. The code was pretty much the following:
    PROCEDURE Something(Customer: Record Customer)
    WITH ContactRecord DO 
      Customer."No." := 'xxxx';
    

    The issue was that somebody added Customer as a field to the Contact table and the Customer in Customer."No." was evaluated as that field instead of the Customer in the procedure parameters. And therefore this code stopped with the same error as yours even though I have not touched it at all (we have just added that Customer field to the Contact table). I can therefore imagine e.g. that you might have e.g. field called Page in the default context the code is running or something similar. (I know that RUNMODAL should not be evaluated as field but as function but I am not sure what the error would be in the case where Page was evaluated as field). I would also check broader context of the failing code to see where the naming collision can come from.

    Regards,
    Igor
  • QuickWEQuickWE Member Posts: 80
    ichladil wrote:
    In the past I have seen this error in quite tricky conditions. The code was pretty much the following:
    PROCEDURE Something(Customer: Record Customer)
    WITH ContactRecord DO 
      Customer."No." := 'xxxx';
    

    The issue was that somebody added Customer as a field to the Contact table and the Customer in Customer."No." was evaluated as that field instead of the Customer in the procedure parameters. And therefore this code stopped with the same error as yours even though I have not touched it at all (we have just added that Customer field to the Contact table). I can therefore imagine e.g. that you might have e.g. field called Page in the default context the code is running or something similar. (I know that RUNMODAL should not be evaluated as field but as function but I am not sure what the error would be in the case where Page was evaluated as field). I would also check broader context of the failing code to see where the naming collision can come from.


    Thank for all replies,but unfortunately this case may be differences ,I tried to move code PAGE.RUNMODAL(0,..) to the first line of triggers (OnValidate of "No." fields) but the same error still occurs.

    The pointer is stopped at after 'E' (PAGE|.RUNMODAL(0,LagerplatzRec))


    Regards,
    Igor
Sign In or Register to comment.