Options

Sales Price Replication Issue

KishraguKishragu Member Posts: 45
Hi,

I have a client who has a UK & US Company within NAV. Sales prices for all items is maintained within the UK Company and replicated to US Company. Btw, both the companies exist within the same database.

The issue is they want to exclude the "Currency Code" field when replicating USD prices to US Company as they want to use LCY within US Company. I am able to exclude the "Currency Code" and replicate the prices. However if any of the prices are subsequently "Deleted" within the UK Company I am not able to replicate the "Deletes" as "Currency Code" is part of the primary key and Navision is not able to find a matching record at the destination and hence records are not deleted.

So far the only solution that I could think of is not to use Data Director for replication and instead make a code change to "Change Company" and insert/modify/delete the records within US Company when creating Sales Prices with a Currency Code of USD in the UK Company.

I would like to know if anyone have faced similar situations and have a better solution than making the code change in numerous places.

Many thanks in advance.

Regards,
Kishore

Comments

  • Options
    GRIZZLYGRIZZLY Member Posts: 127
    I think you should replicate Sales Price table with "By Action" type.
    When you delete Sales Price an entry in Pre-Action table is created. Then, the record from Pre-Action table replicates in destination location and record in Sales Price will be deleted there, too.
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • Options
    KishraguKishragu Member Posts: 45
    Grizzly wrote:
    I think you should replicate Sales Price table with "By Action" type.
    When you delete Sales Price an entry in Pre-Action table is created. Then, the record from Pre-Action table replicates in destination location and record in Sales Price will be deleted there, too.

    Hi Grizzly,

    Replicating "By Actions" does not work either because the packet is passing all the values of PK to the destination to identify the record to be deleted. Since the record at the destination end does not hold a value for "Currency Code" it will not be able to identify the record and hence not delete the record. Also, replicating by "Normal" with "Update-Add-Delete" does not work either because of the same constraints.

    Thanks,
    Kishore
  • Options
    GRIZZLYGRIZZLY Member Posts: 127
    Ok, now I've got it.
    You are right, if you replicate Sales Price record, including Currency Code, then this price wouldn't be recalculated in your LCY, even if you have racalculation factor 1:1 for USD currency.
    Codeunit searches for the record, which has the same Currency, as the Sales Header has, or records, there Currency Code is not filled. The first idea is to modify this codeunit to fulfill your needs.
    As for replication, I've used the following methods in simillar cases:
    1) I've created special Buffer table. Buffer table has a special field Replication Counter.
    2) Periodically a job for preparing Buffer table launches in Source location. It compares records in Buffer table and Operational table. If the record exists in Operational table, but doesn't exist in Buffer, it is added, the Replication Counter of new record is incremented by 1 to the biggest value. If the record exists in Buffer and Operational, but has different values, the Value transfered to Buffer and then Replication Counter is also incremented. If the record is deleted (exist in Buffer, but doesn't exist in Operational table), then you can assign Value (Price) to 0 (zero) and increment Counter.
    3) Replicate Buffer to Buffer with Normal job setting Replication Counter field.
    4) Launch periodical job in destination location for updating Operational table, based on Buffer.
    Of course, it's not easy, but I don't know how to solve this issue without any modification :-k
    Sincerely yours, GRIZZLY
    Follow my blog at http://x-dynamics.blogspot.com
  • Options
    KishraguKishragu Member Posts: 45
    Thanks Grizzly, will try the buffer table solution!!

    Please let me know if you come across a different solution.

    Cheers,
    Kishore
Sign In or Register to comment.