SourceTableTemporary - Modify record in real table

poppinspoppins Member Posts: 647
Hi everyone,

I want to run a popup page from the Sales Order page when entering a Sell-to Customer No.
In this page I can fill in some fields (Adress, "Address 2", "Post Code", etc.) and when I click OK the values I entered in the popup will be in the Sales Header(the values from Customer table are not taken).
I created a list page with the fields I need from table 36 and set the property SourceTableTemporary to Yes.
In the OnOpenPage trigger I placed the following code:
IF INSERT THEN;

I added a function executed in page Sales Order when entering a Sell-to Customer No with the following code:

CLEAR(pageXXX);
pageXXX.SETTABLEVIEW(Rec);
pageXXX.SETRECORD(Rec);
pageXXX.LOOKUPMODE :=TRUE;
pageXXX.RUNMODAL;


When I get the popup page, I fill in some data and click OK, there is no error message or so but the Sales Order is not modified.
What shall I change in my code to get the result I need?

Thanks in advance :smile:

Best Answer

Answers

  • Wisa123Wisa123 Member Posts: 308
    Hi,

    1.) I don't really get why you would want to do this at all. You can still enter all the adresses, ... if you need them to be different from the Customer Values.

    2.) If you really have a legit reason to do this, you've got to assign the values from the temporary Record directly into the physical one. Right now you are just filling a tempRecord which doesn't have any effect on the real record you want to change.
    Austrian NAV/BC Dev
  • poppinspoppins Member Posts: 647
    Wisa123 wrote: »
    Hi,
    2.) If you really have a legit reason to do this, you've got to assign the values from the temporary Record directly into the physical one. Right now you are just filling a tempRecord which doesn't have any effect on the real record you want to change.
    And how do I do that?
  • poppinspoppins Member Posts: 647
    Wisa123 wrote: »
    https://msdn.microsoft.com/de-de/library/dd338718.aspx
    if pageX.runmodal IN [action::ok,action::lookupok] then begin
        pageX.getrecord(someOtherTempRec);
        validate("Bill-to Address",someothertemprec."Bill-to Address");
        // other fields...
    end
    

    and leave out the setrecord, it doesnt do anything in your case

    Thanks :smile:
Sign In or Register to comment.