Updating customer table

I have to update customer “Location Code” field based on “Department” field value… is report the solution or is there is any better solution for this ? Any hint how to develop this report efficiently !

probably a processing only report will be quickest. Put your logic into the Customer’s OnAfterGetRecord trigger.

If you only need to do it once, you can do it by setting a filter on the department code, then do a search and replace on the location field. if you only have a few departments it won’t take long.

Right, Just remember to clear the original field as well. Customer.“Location Code” := “Global Dimension 1 Code”; Customer.“Global Dimension 1 Code” := ‘’; Customer.VALIDATE(“Global Dimension 1 Code”); Customer.MODIFY; Just remember what the rest of the people said about the report, filter on it first otherwise, add an IF/THEN condition prior to the above above: IF Customer.“Global Dimension 1 Code” = ‘WHATEVER’ THEN BEGIN Insert coding indicated above. END; Good Luck,

Hi Masquazi, I am assuming here that you have some sort of relation between the dimension “Department” and Location. In this case your best solution is to add a new field to the Dimension table “Location Code” which is linked to the location table. Then populate the field int he dimensions with the appropriate location. Don’t map the dimension directly to the location, since if the user makes a mistake, you can get data in the customer card that can cuase lots of erros down the road. Then int he customer table, modify the trigger on the "Global dimension 1 field to somethign like Dimension.Get(...); If Dimension.LocationCode <> '' then Validate(location code,Dimension.locationcode); Then create a non printing report that goes though and validates all the customer records. now when the user adds or changes dimenssion, the locations will be updated.

Beware of associating dimensions and locations. Once you get to inventory transfers you will find that you can only have one dimension value (per dimension code) for each transfer line, but there are three locations involved: source, in-transit, destination. Depending on what you are tring to accomplish this may be a problem which may require some modifications to resolve.

The issue was linking Customer to location, not dimension to location, so this should be fine.

i have created report for it and it worked fine… thanks all now i have another assigment… i have to update the Production BOM Line item description based n the item master descriptoin i have to create a preocessing only report… with a query like if “production bom line”.“no” = “item”.“no.” then “production bom line”.“decription” := “item”.“decriptoin” but i suppose, i need to loop throught the bom lines instead of just puttin this code in onaftergetrecord() can anybody help me out… what exactly i need to do to update the descripition of BOM lines with latest item descriptoin

Hi masqazi, you should not be posting new topics here, only completing exiting threads. Please go to the new site, and post the new question there. Thanks… http://dynamicsusers.org/forums/3/ShowForum.aspx