Applying vendor address change to all open Purchase Orders

JanA
Member Posts: 2
We often have a large number of open purchase orders to which a change in address for a single vendor needs to be applied. Is there a simple way for a non-super user to do this?
0
Comments
-
There a bunch of ways - one would be a processing report.
Based on the Purchase Header table.
Onaftergetrecord you can do a....if Vendor.GET("Buy-from Vendor No.") then begin Name := Vendor.Name; "Ship-to Address" := Vendor.Address; "Ship-to Address 2" := Vendor."Address 2"; "Ship-to City" := Vendor.City; State := Vendor.State; "ZIP Code" := Vendor."ZIP Code"; "Country Code" := Vendor."Country Code"; plus any other fields you want to update Modify; End;
Another way could be to filter on the vendor number.
Make sure they are all Status:Open
and have a processing report Revalidate the "Buy-from Vendor No." only to update.
or you could filter on the vendor number you want to update and filter on status=open, then manually go to the "Buy-from Vendor No." hit f2->enter->next and zip thru them yourself.***
or you could use the object designer to run the pucrahse header table. filter on the vendor in question. Edit the first line as you want & F8 all the way down correcting each header.
Pick one that fits your current nav skill level.
*** Not knowing your permissions & security this manual version will allow you to update a bunch fairly quickly & easily0 -
Instead of a processing report, I think you could use a codeunit that leveraged the power of MODIFYALL, right?
Create a codeunit, name it something like 'Vendor Management', with a function:UpdatePOAddresses(Vendor : Record Vendor) PurchaseHeader.SETCURRENTKEY("Buy-from Vendor No."); PurchaseHeader.SETRANGE("Buy-from Vendor No.",Vendor."No."); IF PurchaseHeader.FINDSET(TRUE) THEN BEGIN MODIFYALL(Name,Vendor.Name); MODIFYALL("Ship-to Address",Vendor.Address); MODIFYALL("Ship-to Address 2",Vendor."Address 2"); MODIFYALL("Ship-to City",Vendor.City); MODIFYALL(State,Vendor.State); MODIFYALL("ZIP Code",Vendor."ZIP Code"); MODIFYALL("Country Code",Vendor."Country Code"); // plus any other fields you want to update END;
The MODIFYALL is an incredibly fast function, which is why I'd try testing with it first. I've only had to use it when modifying just one field, so I'm not sure how it behaves when you want to do multiple fields at once like this.
Make sure you know what MODIFYALL is doing, though - read the help first to make sure the application works for you!!
Next, I would add code to the Vendor Card that triggered during an OnModifyRecord.IF (xrec.Name <> Name) OR (xrec.Address <> Address) // ...and so on... THEN BEGIN IF CONFIRM('Do you want to update Purchase Orders with the new Vendor information?') THEN VendorManagement.UpdatePOAddresses(Rec); END;
Michael Hollinger
Systems Analyst
NAV 2009 R2 (6.00.34463)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions