Hi all,
I have a code field on my Contact table(Salesperson Code) I want to write to new Quotations automatically, but I can't get it to work. I have added the field to the Sales Header key and verified it before running the form.
Any suggstions?
Thanks
Tim ](*,)
0
Answers
RIS Plus, LLC
I have the following code run "OnPush" from a "New Quote" Command button on my Sales List Form.
CASE GETFILTER("Document Type") OF
'Order' : lrecSH."Document Type" := lrecSH."Document Type"::Order;
'Quote' : lrecSH."Document Type" := lrecSH."Document Type"::Quote;
ELSE
lrecSH."Document Type" := lrecSH."Document Type"::Quote;
END;
lrecSH.INSERT(TRUE);
lrecSH.VALIDATE("Sell-to Contact No.",GETFILTER("Sell-to Contact No."));
lrecSH.MODIFY(TRUE);
CASE lrecSH."Document Type" OF
lrecSH."Document Type"::Order : FORM.RUN(FORM::"Sales Order",lrecSH);
lrecSH."Document Type"::Quote : FORM.RUN(FORM::"Sales Quote",lrecSH);
END;
where lrecSH is the Sales Header Record
This opens a new Sales Quote Form 41 with the "Sell to address" fields filled in. I want the SalesPerson Code number populated as well.
Hope this helps
Tim
RIS Plus, LLC
Cust.CheckBlockedCustOnDocs(Cust,"Document Type",FALSE,FALSE);
Cust.TESTFIELD("Gen. Bus. Posting Group");
"Sell-to Customer Template Code" := '';
"Sell-to Customer Name" := Cust.Name;
"Sell-to Customer Name 2" := Cust."Name 2";
"Sell-to Address" := Cust.Address;
"Sell-to Address 2" := Cust."Address 2";
"Sell-to City" := Cust.City;
"Sell-to Post Code" := Cust."Post Code";
"Sell-to County" := Cust.County;
"Sell-to Country/Region Code" := Cust."Country/Region Code";
"Salesperson Code" := Cust."Salesperson Code"; ///(22.05.09 TFK) M9
IF NOT SkipSellToContact THEN
"Sell-to Contact" := Cust.Contact;
"Gen. Bus. Posting Group" := Cust."Gen. Bus. Posting Group";
"VAT Bus. Posting Group" := Cust."VAT Bus. Posting Group";
"Tax Area Code" := Cust."Tax Area Code";
"Tax Liable" := Cust."Tax Liable";
"VAT Registration No." := Cust."VAT Registration No.";
"Shipping Advice" := Cust."Shipping Advice";
"Type of Supply Code" := Cust."Type of Supply Code";
"Responsibility Center" := UserMgt.GetRespCenter(0,Cust."Responsibility Center");
VALIDATE("Location Code",UserMgt.GetLocation(0,Cust."Location Code","Responsibility Center"));
I have checked the Customer table and the "Salesperson Code" field is on the table and populated. Any further thoughts?
RIS Plus, LLC
Thanks for the help.
Tim