
Hi everyone,
In my model driven application I have a table workorder and a table Machine.
Machine has a machine Number and a name.
Workorder has a lookup field of table Machine.
When i select my machine in the workorder screen then i can see the name of the machine and not the number.
Can i change this in any way?
See screenshot below for a visualisation of my problem.
Thanks in advance!
You will have two options, you will have to evaluate which one best suits your needs, as the Lookup will show you the name of the machine, not the name and number.
let machineColumn = formContext.getAttribute("new_machineid");
let machineValue = (machineColumn === null) ? null : machineColumn.getValue();
//Retrieve machine row: Xrm.WebApi.retrieveRecord("new_machine", machineValue)
machineValue[0].name = 'VALUE WITH RESULT OF Xrm.WebApi with name + number'
machineColumn.setValue(machineValue);​