How copy fields automatically

DarkHorseDarkHorse Member Posts: 389
edited 2007-05-07 in Navision Attain
I've the field Purchaser code from the Vendor table and I've created the same field on the Item table. I want to copy the content of this field to the new field. I've crated a report filter by the DataItemlink "Vendor nº" and on AfterGetRecord of the Item DataItem I've put the code:

"Purchaser Code":=prove."Purchaser Code";
MODIFY;

("prove" is the Vendor table). It seems run but when I go to check the result it doesn't work, it appears empty. I don't know what's the problem; any idea?.
Thanks.

Comments

  • nunomaianunomaia Member Posts: 1,153
    If Item Vendor No. is empty then DataItemlink is incorrect.
    You shouldn't change DataItemlink in report
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • DarkHorseDarkHorse Member Posts: 389
    Yes, there are Vendor Nº empty, but I don't know another better field to filter, how I can do it?.
    Thanks.
  • nunomaianunomaia Member Posts: 1,153
    I think is missing some thing ....

    If you can relate item to vendor, why write code again?
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • DarkHorseDarkHorse Member Posts: 389
    Well, I think because I've to indicate what field I want to copy (purchase code);
  • DarkHorseDarkHorse Member Posts: 389
    Any idea, please?
    Thanks.
  • nunomaianunomaia Member Posts: 1,153
    If I understood correctly.

    You have a report With 2 data items.

    Vendor
    --> Item

    You have createt a new field in Item table, and you want to relate that new field with vendor table ?
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • DarkHorseDarkHorse Member Posts: 389
    Yes, it is. I want to copy automatically the vendor field table to the new item field table.
  • nunomaianunomaia Member Posts: 1,153
    If that new field is blank, you can't relate it to Vendor table. That why I told you that is missing something,
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • DarkHorseDarkHorse Member Posts: 389
    Then, It's impossible copy fields from a table to another?
  • AlbertvhAlbertvh Member Posts: 516
    Hi Darkhorse,

    Are you sure that the Purchaser Code for the Vendor is not blank?
    Only 1 Vendor No. related to the specific Item(s)?

    DataItemTableView of Item is set to Vendor No.
    DataItemLinkReference is Set to Prove
    DataItemLink is set No.=FIELD(Vendor No.)

    If it is not filling the Purchase Code then there is no link between Prove."No." and Item."Vendor No."

    Hope this helps.
  • DarkHorseDarkHorse Member Posts: 389
    Thanks for answer. May be there are some blank Purchaser Code field in the Vendor table, but I try filter them. The rest I think is ok. I don't know what's the problem, it's strange.
    Thanks for help.
Sign In or Register to comment.