Options

Can't update record in my own table

asdastyasdasty Member Posts: 26
edited 2014-09-06 in NAV Three Tier
Hi guys, I've built my custom table to store XML documents. After receiving one, I'd like to insert that xml to NAV and finally update that record. I'm doing something like this simple function:
UpdateDocumentNumbers(extDocNo : Code[20]; intDocNo : Code[20]; recId : Text[50])
QueueRecord.RESET;
QueueRecord.SETRANGE("Message Id", recId);

IF QueueRecord.FINDFIRST() THEN
BEGIN
  QueueRecord."External Doc. No." := extDocNo;
  QueueRecord."Internal Doc. No." := intDocNo;
  QueueRecord."Transfer Status" := QueueRecord."Transfer Status"::Done;
  QueueRecord.MODIFY(TRUE);

  MESSAGE(extDocNo + ' => ' + QueueRecord."External Doc. No.");
END;

I'm getting message with filled External Doc. No. after modify, but that this record is not really updated. I have no ideas about this, what should I do?

Comments

  • Options
    lvanvugtlvanvugt Member Posts: 774
    Guess these three fields you are updating are not part of the PK ... and QueueRecord variable does not have Temporary set to Yes?
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • Options
    asdastyasdasty Member Posts: 26
    These fields are not part of PK. And QueueRecord isn't temporary variable.

    I can create second variable QueueRecordTmp, then make TRANSFERFIELDS to this var from QueueRecord, and in this one I have these fields filled. And of course I can insert this new record to Queue.

    edit

    I've found this in another part of the same codeunit
    QueueRecord.LOCKTABLE()
    

    No comment...
Sign In or Register to comment.