New record and CardPageID - how to pass parameters?
alex9
Member Posts: 97
Here is a situation.
There are two pages: MyList page and MyCard page, the same source table. I need to copy some field value from selected record to the new record when I am inserting a new record.
I can do that on the MyList page with the code:
Is there any way to pass some values from List page to Card page when CardPageID is used and new record is inserted?
There are two pages: MyList page and MyCard page, the same source table. I need to copy some field value from selected record to the new record when I am inserting a new record.
I can do that on the MyList page with the code:
OnNewRecord(BelowxRec : Boolean) rec.MyField := xRec.MyField;However, this doesn't work when I specify CardPageID on MyList page. In that case, MyCard page is opening when I click New (or ctrl+N) on MyList page. The problem is, MyPage card doesn't know anything about xRec, it's just empty.
Is there any way to pass some values from List page to Card page when CardPageID is used and new record is inserted?
0
Comments
-
Hi,
I created a customer list page and a card page. Linked them together (CardPageID).
Wrote the below code on OnNewRecord trigger of the Card page.
Address:= xRec.Address;
When I clicked on New on the list page, the address is getting picked from the last record in customer table into my new record.
If you want to copy the xrec fields from a specific record, it might not be possible directly.0 -
Yes, it is picked from the last record, which does not make a lot of sense. It needs to be copied from the record which is selected at the moment when I click New. It does so when I am creating new record from a standalone list. But CardPageID is used, it doesn't work.
Does somebody know any workaround? The only idea I have is to create my own list instead of standard one (page 9308 "Purchase Invoices" in my case), create custom action "New" with code which passes parameter to Purchase Invoice card and disable standard action "New" somehow. Any other ideas? And how to disable standard action "New", by the way?0 -
Partially answering my own question, that new list should have InsertAllowed=No, so standard "New" won't appear. Still not sure this is the best approach.alex9 wrote:Does somebody know any workaround? The only idea I have is to create my own list instead of standard one (page 9308 "Purchase Invoices" in my case), create custom action "New" with code which passes parameter to Purchase Invoice card and disable standard action "New" somehow. Any other ideas? And how to disable standard action "New", by the way?0
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