Dissappearing window

mark_christsmark_christs Member Posts: 156
Dear All,
These are the coding I wrote in the C/AL editor :

SETRANGE(Status,ProdOrderStatus);

IF ProdOrderFilter <> '' THEN
SETFILTER("Prod. Order No.",ProdOrderFilter)
ELSE
SETRANGE("Prod. Order No.");

CurrForm.UPDATE(FALSE);

I select demand is simulated, when I write the prod. order no. in the field prod. order filter, and its status is released, the window is missing because the production order no. doesn't match with selected status, meanwhile I want it return to the windows and put a message in the pop up window : "the prod. order no. doesn't match with status selected", how to make it ? Tks be4hand..


Rgds,
Mark

Comments

  • krikikriki Member, Moderator Posts: 9,118
    I didn't completely understand your need but I think it will be something like this.
    SETRANGE(Status,ProdOrderStatus);
    IF ProdOrderFilter <> '' THEN
      SETFILTER("Prod. Order No.",ProdOrderFilter)
    ELSE
      SETRANGE("Prod. Order No.");
    IF NOT FIND('-') THEN BEGIN
      MESSAGE('the prod. order no. doesn't match with status selected.');
      EXIT;
    END;
    
    CurrForm.UPDATE(FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mark_christsmark_christs Member Posts: 156
    Kriki wrote:
    I didn't completely understand your need but I think it will be something like this.

    :) Tks for your reply. Sorry, but you are very very clever. it's from my heart. I really confused before hand and not know what to write there.

    I will try to put and run it. hope my kudos isn't too overload..


    Rgds,
    Mark
  • mark_christsmark_christs Member Posts: 156
    Kriki wrote:
    ...MESSAGE('the prod. order no. doesn't match with status selected.'); ...

    Using the above, I can't run it and when i close form designer this message appears (pop up message) :"")" should come here" then the cursor placed precisely between doesn' and t.

    I could use it if I change doesn't to be does not. It will be more grammatically rather than doesn't, won't it ?? :D =D>


    Rgds,
    Mark
  • krikikriki Member, Moderator Posts: 9,118
    Kriki wrote:
    ...MESSAGE('the prod. order no. doesn't match with status selected.'); ...

    Using the above, I can't run it and when i close form designer this message appears (pop up message) :"")" should come here" then the cursor placed precisely between doesn' and t.

    I could use it if I change doesn't to be does not. It will be more grammatically rather than doesn't, won't it ?? :D =D>


    Rgds,
    Mark
    In the forum, we always give the text in english in the message. In Navision you should create a global textconstant and put the text in it and then use the textconstant instead of the string.

    In case you want to keep it like this, the word "doesn't" should be "doesn''t". If you have a single ' in a string, you should put 2 single ' in it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mark_christsmark_christs Member Posts: 156
    Kriki Wrote:
    In Navision you should create a global textconstant and put the text in it and then use the textconstant instead of the string.

    It works good after I create a local but not global. I wrote as follows:

    IF NOT FIND('-') THEN BEGIN
    MESSAGE(text001);
    EXIT;

    In the C/AL Local I wrote :
    Name ConstValue
    text001 The prod. order no. doesn't match with status selected.

    But this one :
    In case you want to keep it like this, the word "doesn't" should be "doesn''t". If you have a single ' in a string, you should put 2 single ' in it.
    is really s**t words.. it can't work. sorry but tks a lot :D


    Rgds,
    Mark
  • krikikriki Member, Moderator Posts: 9,118
    But this one :
    In case you want to keep it like this, the word "doesn't" should be "doesn''t". If you have a single ' in a string, you should put 2 single ' in it.
    is really s**t words.. it can't work. sorry but tks a lot :D

    The problem is that the single ' is used to start and stop a string, so when Navision sees it in a string, he thinks that the string is finished and goes in tilt with the rest of the string. That is the reason it is needed to use 2 single ' in the string.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.