Quantcast
Channel: Dynamics 365 Business Central/NAV User Group
Viewing all articles
Browse latest Browse all 11285

Forum Post: RE: Customer card on assist button

$
0
0
Ok, There are 2 ways you can handle this FIRST METHOD If you are accepting a value for New customer no. from user. Step 1 - On the Sales order page define a global variable NewCustomerNo Code 20. Add this new field to your page. You will create the customer card only if the NewcustomerNo is entered by the user. Step 2 - On the Assist Edit trigger of Bill-to customer no. add the below code and also define 2 local variable called Cust record Customer and CustRecOne Record Customer. If NewCustomerNo <> '' then begin cust.reset; cust.setrange("no.",Newcustomerno); if not cust.find('-') then begin custrecone.init; Custrecone."no." := newcustomerno; custrecone.insert; page.run(page::"Customer Card",custrecone); end; end else error('Customer %1 already exists.',Newcustomerno); SECOND METHOD If you are using No. series for Customer. On AssistEdit option of the Bill-to customer no. Declare a local variable Cust Record Customer cust.reset; cust.init; Cust."no." := ''; cust.insert(true); page.run(page::"Customer Card",cust);

Viewing all articles
Browse latest Browse all 11285