Is there a way to select Yes when a mesage pop up
fmhigue
Member Posts: 290
I am writing a report to update Price Group Code on the Special-Frozen Price table.
But Price Group Code is a key.
SO I want to run my report and seleck Yes on the fly.
Any ideas?
But Price Group Code is a key.
SO I want to run my report and seleck Yes on the fly.
Any ideas?
0
Comments
-
fmhigue wrote:I am writing a report to update Price Group Code on the Special-Frozen Price table.
But Price Group Code is a key.
SO I want to run my report and seleck Yes on the fly.
Any ideas?
You need to use the RENAME command directly on the record instead of validating then modifying the record.
Is this a one of fix? If so then fine. But if this is a regular routine, then you need to redefine the data model.David Singleton0 -
But note, a rename can run very long if it is a big table. Sometimes it's faster to delete and insert then a new rec.
For the price table, there are no table relations to these field so you can also:
Copy the rec, delete the rec, change the needed field in copy, insert the rec from copy.
But if you are not sure if this work for u, use, like David say, the Rename command.
RegardsDo you make it right, it works too!0 -
David - Garak:
This is the code I got on a report to change the values on the field
SETFILTER("Customer Type",'Chain');
SETRANGE("Price Group Code",'140');
IF "Frozen-Special Price".FIND('-') THEN
REPEAT
"Price Group Code":= 'AALFS';
"Frozen-Special Price".MODIFY;
UNTIL "Frozen-Special Price".NEXT = 0;0 -
fmhigue wrote:David - Garak:
This is the code I got on a report to change the values on the field
SETFILTER("Customer Type",'Chain');
SETRANGE("Price Group Code",'140');
IF "Frozen-Special Price".FIND('-') THEN
REPEAT
"Price Group Code":= 'AALFS';
"Frozen-Special Price".MODIFY;
UNTIL "Frozen-Special Price".NEXT = 0;
Is this code in the on after get record trigger in the report? The context does not make sense. What is the WITH here?David Singleton0 -
SETFILTER("Customer Type",'Chain');
SETRANGE("Price Group Code",'140');
IF "Frozen-Special Price".FIND('-') THEN
REPEAT
"Price Group Code":= 'AALFS';
"Frozen-Special Price".MODIFY;
UNTIL "Frozen-Special Price".NEXT = 0;
First: I'am wondering, why you use the Rec Variable "Frozen-Special Price" for the loop, but you change the the CurrRec. Or is there an With "Frozen-Special Price" Do begin statement infront of?
From where is this code called :?: OnPreDataItem / OnPostDataItem / OnAfterGetRecord (as David sayed)
normally u make a rename like this:SpecialFroznPrices.reset; SpecialFroznPrices.SETFILTER("Customer Type",'Chain'); SpecialFroznPrices.SETRANGE("Price Group Code",'140'); IF SpecialFroznPrices.FINDset(true,true) THEN begin //onSQL, Native find('-') with an sep. Rec Variable to rename REPEAT SpecialFroznPrices.rename(PKField1,'AALFS',[PKField N]; //if Price Group is the second Primary key field "Frozen-Special Price".MODIFY; UNTIL SpecialFroznPrices.NEXT = 0; end; an other way is following (if there are no tabl. relations) TempSpecialFroznPrices.reset; //temp. Variable TempSpecialFroznPrices.deleteall; SpecialFroznPrices.reset; SpecialFroznPrices.SETFILTER("Customer Type",'Chain'); SpecialFroznPrices.SETRANGE("Price Group Code",'140'); IF SpecialFroznPrices.FINDset(true) THEN begin REPEAT TempSpecialFroznPrices := SpecialFroznPrices; TempSpecialFroznPrices.insert; UNTIL SpecialFroznPrices.NEXT = 0; end; SpecialFroznPrices.deleteall; TempSpecialFroznPrices.reset; if TempSpecialFroznPrices.find('-') then begin repeat SpecialFroznPrices.init; SpecialFroznPrices := TempSpecialFroznPrices; SpecialFroznPrices."Price Group Code":= 'AALFS'; SpecialFroznPrices.insert; until TempSpecialFroznPrices.next = 0; end;
RegardsDo you make it right, it works too!0 -
fmhigue wrote:SETFILTER("Customer Type",'Chain');
Oh and this is just so wrong in more ways than I can even imagine.David Singleton0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
