HardCode Field

kolaboy
Member Posts: 446
Hi Experts,
Can anyone tell me how to hardcode a field in the customer table called Global dimension code 1 to 300. I tried Writing this in the onaftergetrecord trigger but it give me an error.
This hardcode is to be done on a report with customer as the dataitem.
Any suggestion to slove this please.
Thanks
Can anyone tell me how to hardcode a field in the customer table called Global dimension code 1 to 300. I tried Writing this in the onaftergetrecord trigger but it give me an error.
This hardcode is to be done on a report with customer as the dataitem.
"Global Dimension 1 Code" := 400;The Error is:
Type conversion is not Possible because one of the Operators contains an invalid type Code := Integer
Any suggestion to slove this please.
Thanks
0
Comments
-
The Error is:Type conversion is not Possible because one of the Operators contains an invalid type Code := Integer
instead of 400 like a number - try '400' with the quotes.
*assuming "400" is an actual dimension code.0 -
I have just tried this but it not working. I try filtering with a field which is not having 400 as dimension value and it has taken it.
I expect to run this report with only Customers with Global Dimension 1 code value to be 400 even without filtering.
The error has stopped but i have not achieve what i want.
What might be the problem?
Thanks.0 -
It is not clear what you want to achieve. Do you want the global dimension 1 value "400" to be assigned to new customers, or do you want to filter all customers in a report (all customers with global dimension 1 value = "400")?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
If the report is only for Customers with Dimension Code 1 = 400
why not View->Properties of the dataitem you are using then set the property
DataItemTableView : WHERE(Global Dimension 1 Code=FILTER(400))
:?:0 -
Savatge, Your suggestion seems correct to me, i will try it and give you feedback later.
Thanks.0 -
Hi experts,f the report is only for Customers with Dimension Code 1 = 400
why not View->Properties of the dataitem you are using then set the property
DataItemTableView : WHERE(Global Dimension 1 Code=FILTER(400))
Thanks savatge, this works. Can this be hardcoded? I want it hardcoded, because i will be filtering receiveble accounts. As it is right now, if i set another filter it does not show anything.
my aim is to have the report filter where Global Dimension Code 1 = '400'
and Receivable account = '14620'
Can we have it hardcode? any idea.
Thanks.0 -
-
also use the drilldown assist to add Receivable account = '14620' to the dataitemtableview.
Also what do you mean it does not show anything if you set another filter.
First off setting that property to 400 will only show customers with 400 as their GD1C. now if you have (for example) 100 customers with 400 then only the 100 will show but you can still filter on those 100 using other fields.
Like which customers have the same contact or have the same salesperson or have the same terms or have a name that starts with W*....etc etc etc. once you set that property to 400 you can't use that Global Dimension 1 for any other option 100, 200, 300 , 500. it's SET @ 400!
I don't know what the Receiveable account is but I guess it would look something like this:
WHERE(Global Dimension 1 Code=CONST(400),Customer Posting Group=CONST(14620))0 -
savatage,also use the drilldown assist to add Receivable account = '14620' to the dataitemtableview.
Also what do you mean it does not show anything if you set another filter.
First off setting that property to 400 will only show customers with 400 as their GD1C. now if you have (for example) 100 customers with 400 then only the 100 will show but you can still filter on those 100 using other fields.
Like which customers have the same contact or have the same salesperson or have the same terms or have a name that starts with W*....etc etc etc. once you set that property to 400 you can't use that Global Dimension 1 for any other option 100, 200, 300 , 500. it's SET @ 400!
I don't know what the Receiveable account is but I guess it would look something like this:
WHERE(Global Dimension 1 Code=CONST(400),Customer Posting Group=CONST(14620))
This is exactly what i want. I want the report to filter by
Global Dimension 1 Code=CONST(400) and also
Customer Posting Group=CONST(14620))
This should display all customer that have satisfy the above. i want it to filter by GD1C and then filter among GD1C by Customer Posting Group.
I have set the dataitemtableview to the above two conditions but when i run the report, It becomes blank. i.e report generated completed(0 pages).
i don't know what the problem is but these are the two conditions that should give me the results
Sorry, i am very new in Navision, so when i say hardcode i though i can be done using the C/AL code only. Now i have understood and have learnt.
Any suggestion again please!!!
Thanks.0 -
DateItemTableView:WHERE(Global Dimension 1 Code=CONST(400),Customer Posting Group=CONST(14620))
this should work
1)change CONST to FILTER to seeif it makes a difference
2)are you sure you have customers that actually satisfy these conditions
3)are you setting some other filters somewhere with code?0 -
kolaboy wrote:when i say hardcode i though i can be done using the C/AL code only0
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