Options

How to find out, if table temporary?

burkiburki Member Posts: 4
Hi,

it's possible to find out, if a table is temporary?
I start a form by
FORM.RUNMODAL(FORM::XYZ,tmpRecord)
But it's even possible to starting normal.
In the form i need to know whether rec is temporary or not.

burki

Comments

  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    You can add a boolean field to the table. When you create your temp table you set the value to TRUE
  • Options
    burkiburki Member Posts: 4
    You can add a boolean field to the table. When you create your temp table you set the value to TRUE

    Thank you, it's a practical answer to this problem. However I'm concluding, that's impossible to find out, if a table is temporary.

    burki
  • Options
    JKJK Member Posts: 21
    Try to delete all records :twisted:
  • Options
    PrebenRasmussenPrebenRasmussen Member Posts: 137
    JK is a devil ! but he's darn close...

    If you insert a record in REC (maybe using blank keyfields or whatever) then you can check for this record in a global variable of the same type. If it exists then it is non-temporary.

    (You might need SELECTLATESVERSION)
  • Options
    EugeneEugene Member Posts: 309
    one side effect of temp tables is that they do not participate in transactions
    this probably can be used to determine if the table is temporary
  • Options
    krikikriki Member, Moderator Posts: 9,090
    You can do this where you call the form:
    tmpRecord.FILTERGROUP(6);
    tmpRecord.SETRANGE("Some Field","Some Value");
    tmpRecord.FILTERGROUP(0);
    FORM.RUNMODAL(FORM::XYZ,tmpRecord)
    

    In the OnOpenForm-trigger you put:
    tmpRecord.FILTERGROUP(6);
    blnTempTable := (tmpRecord.GETFILTER("Some Field") <> '');
    tmpRecord.SETRANGE("Some Field"); //clear the filter
    tmpRecord.FILTERGROUP(0);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    burkiburki Member Posts: 4
    Thank you all for the various answers to this problem! You have been very inventive! \:D/
Sign In or Register to comment.