x++ - filter look up in dialog -


i have created dialog in class, dialog method below

static void dialog(args _args) { dialog              dialog; dialogfield         dialogfieldcurrentstate; dialogfield         dialogfieldnewstate; custinvoicetable    custinvoicetable;   ;  custinvoicetable = _args.record();    dialog                  = new dialog("change state"); dialogfieldcurrentstate = dialog.addfield(typeid(state_lt),"current state: "); dialogfieldcurrentstate.value(custinvoicetable.state); dialogfieldcurrentstate.enabled(false); dialogfieldnewstate     = dialog.addfield(typeid(state_lt),"new state: ");  if (dialog.run()) {     custinvoicetable.state =  dialogfieldnewstate.value();  }  } 

in dialog there 2 fileds current state , new state .now when select new state list of states displayed(irrespective of country) dont want. states respective of country has shown in lookup . need make use of filter e.g. while select while select addressstate addressstate.countryregionid == custinvoicetable.countryregionid; states related country shown.

state_lt here string edt (where put in relation of state_lt) state_lt == addressstate.stateid

in adressstate there method lookupstateid(), how call dialog(code above) ?

i answering last question: "in adressstate there method lookupstateid(), how call dialog(code above) ?" - way writing in capital letters doesn't people understand point better.

it not clear why dialog static method, anyway you'd need following.

let's classdeclaration looks this:

class testclass1 extends runbase {     dialog      dialog;     dialogfield dialogfieldcurrentstate;     dialogfield dialogfieldnewstate;     // etcetera } 

your dialog this:

public object dialog() {     ;      dialog = super();      dialogfieldcurrentstate = dialog.addfield(typeid(addressstateid),"current state: ");     dialogfieldcurrentstate.enabled(false);     dialogfieldnewstate     = dialog.addfield(typeid(addressstateid),"new state: ");     dialogfieldnewstate.lookupbutton(formlookupbutton::always);     // if needed      return dialog; } 

to implement lookup way want need 2 things. first, open dialog, right click on new state, click setup, , check control's system name. if example fld2_1 need create following method:

void fld2_1_lookup() {     object control = dialog.formrun().controlcallingmethod();     ;      addressstate::lookupstateid(control, dialogfieldnewstate.value()); } 

second, necessary override following method:

public void dialogpostrun(dialogrunbase _dialog) {     super(_dialog);      _dialog.dialogform().formrun().controlmethodoverload(true);     _dialog.dialogform().formrun().controlmethodoverloadobject(this); } 

that should trick. haven't done while don't think forgot something.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -