Customer card on assist button

Dear All,

I want to open new customer card page on assist button, my assist button is on bill to customer no field of sales order page.

On the sales order page create a variable say NewCustomerNo code 20, . Add the variable to Sales order page. Have user enter the New customer no., if new customer no is not blank then insert this new customer into customer table and show the customer card page.

I did not understand can please explain me in more detail

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);

Thanks You.