Create a quote form a new form
Dear folks, I think this is easy for experts. I've create a new form that brings a "Contact Nº" and the "Customer No" asociates. Then, from this form I want to create a sales quote . I put a button with a PushAction and the following options:
PushAction: RunObject
RunObject: Form Sales Quote
RunFormLink: Sell-to Customer No.=FIELD("Customer No.")
RunFormLinkType: OnUpdate
"Customer No." is the field from my new form.
Well, on push the button it goes to the customer quotes, but it doesn't insert a new one. ¿which is what I need?.
Thanks in advance
PushAction: RunObject
RunObject: Form Sales Quote
RunFormLink: Sell-to Customer No.=FIELD("Customer No.")
RunFormLinkType: OnUpdate
"Customer No." is the field from my new form.
Well, on push the button it goes to the customer quotes, but it doesn't insert a new one. ¿which is what I need?.
Thanks in advance
0
Comments
-
You should do everything in the OnPush trigger of the button:
lrecSalesQuote.INIT; lrecSalesQuote.VALIDATE(Document Type,lrecSalesQuote."Document Type"::Quote); lrecSalesQuote."No. Series" := (Sales Quote No. Series); lrecSalesQuote.VALIDATE("Sell-to Customer No.",codCustomer); lrecSalesQuote.VALIDATE("Sell-to Contact,txtContact); lrecSalesQuote.INSERT(TRUE); FORM.RUN(41,lrecSalesQuote);
Should be something like this... quickly coded, errors possible...0 -
Thanks for reply. Only one question: lrecSalesQuote I suppose is Sales Header table?.0
-
-
Sorry, it says me "date is not correct" on push. What's the matter please?.0
-
Try this:
lrecSalesQuote.INIT; lrecSalesQuote.VALIDATE(Document Type,lrecSalesQuote."Document Type"::Quote); //lrecSalesQuote."No. Series" := (Sales Quote No. Series); lrecSalesQuote."No." := ''; lrecSalesQuote.VALIDATE("Sell-to Customer No.",codCustomer); lrecSalesQuote.VALIDATE("Sell-to Contact,txtContact); lrecSalesQuote.INSERT(TRUE); FORM.RUN(41,lrecSalesQuote);0 -
Thanks, but the result is the same. It only works if I cancel the line:
lrecSalesQuote.VALIDATE("Sell-to Customer No.",codCustomer);
Then it insert a new Quote but doesn't put the customer number neither the other fields. Any idea please?
Thanks.0 -
Ok, what about this:
lrecSalesQuote.INIT; lrecSalesQuote.VALIDATE(Document Type,lrecSalesQuote."Document Type"::Quote); //lrecSalesQuote."No. Series" := (Sales Quote No. Series); lrecSalesQuote."No." := ''; lrecSalesQuote.VALIDATE("Sell-to Customer No.",codCustomer); lrecSalesQuote.VALIDATE("Sell-to Contact,txtContact); lrecSalesQuote.INSERT(TRUE); lfrmSalesQuote.SETRECORD(lrecSalesQuote); lfrmSalesQuote.RUN;
Should work :?0 -
Thanks for reply. Sorry, but it goes on showing the message "Date is not correct". I don't what it means.
Thanks.0 -
-
perhaps the # = blank is causing the problem.
remove that line..we use something similar below & it works.
OnPush()
RECSALESHEADER.INIT;
RECSALESHEADER."Document Type" := RECSALESHEADER."Document Type"::Order;
RECSALESHEADER.VALIDATE("Sell-to Customer No.",'blah blah');
RECSALESHEADER.INSERT(TRUE);
SETFILTER("No.",RECSALESHEADER."No.");
CurrForm.SalesLines.ACTIVATE;
CLEAR(RECSALESHEADER."Document Type");
CLEAR(RECSALESHEADER."No.");0 -
Following the common user inputs, i would do:
RECSALESHEADER.INIT; RECSALESHEADER."Document Type" := RECSALESHEADER."Document Type"::Order;//or whatever document type RECSALESHEADER."no." := ''; RECSALESHEADER.insert(true); RECSALESHEADER.validate("sell-to customer",'mycustomer); ... ... RECSALESHEADER.modify(true);0 -
Perfect!! it runs. Finally this is the code:
RECSALESHEADER.INIT;
RECSALESHEADER.VALIDATE("Document Type",cabventa."Document Type"::Quote);
RECSALESHEADER."No." := '';
RECSALESHEADER.INSERT(TRUE);
RECSALESHEADERVALIDATE("Sell-to Customer No.","Customer No.");
RECSALESHEADER.MODIFY(TRUE);
formsales.SETRECORD(RECSALESHEADER);
formsales.RUN;
Thanks everybody for help and time.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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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