Employee portal: Create new record

peterke1974
Member Posts: 23
Hello,
I want to do the following:
I want to show a list of contacts of a specific salesperson. It must also be possible to modify the contacts and create new ones (in the lines).
To do this, I have a created a header-line webpart. The header is my salesperson record, the line is the contact record.
When modifying or creating the record, I allways get the error that there is no record found in the filter. But the record is created or modified.
I created the necessary code in the codeunits 6823 en 6825.
Any idea what I do wrong?
Or is it better to create and modify in a card-window
I want to do the following:
I want to show a list of contacts of a specific salesperson. It must also be possible to modify the contacts and create new ones (in the lines).
To do this, I have a created a header-line webpart. The header is my salesperson record, the line is the contact record.
When modifying or creating the record, I allways get the error that there is no record found in the filter. But the record is created or modified.
I created the necessary code in the codeunits 6823 en 6825.
Any idea what I do wrong?
Or is it better to create and modify in a card-window
0
Comments
-
Hi,
are you setting the Salesperson code during the insert?
If not, the new record can not be found because the filter (head-line connection) will kick out this record.
If this is not the error, please post your code (or send it to me as a message), otherwise it is nearly impossible to solve your issue.
HTH,
Rainer0 -
This is the code I added:
LineRecordRef.OPEN(DATABASE::Contact,FALSE);
// Init the Record
LineRecordRef.INIT;
// Set the Primarykey Fields
LineFieldRef := LineRecordRef.FIELD(Contact.FIELDNO("Salesperson Code"));
EPSupportFunctions.ModifylFieldRefOnInsert(DATABASE::Contact,Contact.FIELDNO("Salesperson Code"),
EPDecodeXML.GetValueByFieldIDFromHeadData(XMLDocInHead,Contact.FIELDNO("Salesperson Code")),
LineFieldRef);
Salespersoncode := LineFieldRef.VALUE;
//Salespersoncode := 'LIEVENB';
EPSupportFunctions.CreateTempHeadFilterTable(Contact.FIELDNO("Salesperson Code"),
Salespersoncode,GUID);
LineRecordRef.INSERT(TRUE);
// Insert Head Key fields for Answer
EPSupportFunctions.CreateTempHeadFilterKeys(Contact.FIELDNO("Salesperson Code"),GUID);
I receive this error when I use the "EPSupportFunctions.ModifylFieldRefOnInsert" Code
Navision error (10500): Verkoper/Inkoper Code 'ERROR' does not exist.
The contact is not created.
When I put the salespersoncode filter fixed to LIEVENB, I get the follwing error
Navision error (10500): You cannot enter 'SORTING() WHERE(=CONST(LIEVENB))' in FieldNo. The cursor is in front of the invalid character.
Could It be a problem that salesperson code is not in the primary key?
I use the "salesperson code"- key in the list.
Hope you can help me
Thanks0 -
Hi,
a key is NOT the primary key!
The first key in Navision is the primary key, but you can add up to 20 keys which can then be used for sortings.
The primary key in NAV is the Contact No.
You have to use this field to create a new contact.
But you can set the value for the salesperson code when you create the record.
HTH,
Rainer0
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