Skip to main content

Hi All,

I want to add a new field in the part lookup.

Like when a user clicks on part lookup column in mobile he can also see Rx material id(part info)

along with the part id.

Below is my code please guide anything is missing.

 

var partId = getControlValue('external_ref','part');
var rex = getUserInfo('part_id');
var rexID = getDBValue(stringFormat("SELECT external_ref FROM PART WHERE part_id='{0}'"rex,));
setControlValue('external_ref','part id',rexID);

@Pinmaya Kumar Singh 

Looks like a bit of syntax issues.

  • getControlValue expects different inputs.
    object getControlValue(string tableName, string columnName)
  • getUserInfo - This function is used to return information about the currently logged‐in user.
    Dont think this is your intention.
  • Do you have the part synced into mobile? 
  • setControlValue expects different inputs.
    bool setControlValue(string tableName, string columnName, object value)

This is my best guess:

var partid = getcontrolvalue('part','external_ref');
var rexid = getdbvalue(stringformat("select external_ref from part where part_id='{0}'", partid));
setcontrolvalue('part','external_ref',rexid);

 

Cheers!


Reply