Hi Sharma,
Thanks for your response. I work in D365. I have a control - "Add selection" and I have 3 methods added to it at form level
[Control("String")]
class fromAddSelection
{
public void jumpRef()
{
element.addressJumpRef(FromAddressType.selection(), this.valueStr());
}
public void lookup()
{
TMSAddressType tmsAddressType;
TMSRouteTable::lookupAddress(this, str2enum(tmsAddressType, FromAddressType.valueStr()));
}
public boolean modified()
{
boolean ret;
InventLocation warehouse;
VendTable vendTable;
ret = super();
switch (FromAddressType.selection())
{
case TMSAddressType::Warehouse:
LogisticsLocation logisticsLocation;
InventLocationLogisticsLocation
inventLocationLogisticsLocation;
InventLocation inventLocation;
logisticsPostalAddress=logisticsPostalAddress::findRecId(str2int64(fromaddSelection.valueStr()));
select RecId from logisticsLocation
where logisticsLocation.RecId == logisticsPostalAddress.Location
join InventLocation from inventLocationLogisticsLocation
where inventLocationLogisticsLocation.Location == logisticsLocation.RecId
join InventLocationId,Name,RecId from inventLocation
where inventLocation.RecId == inventLocationLogisticsLocation.InventLocation;
warehouse = inventLocation;
fromAddress = TMSAddressPhone::initFromInventLocation(warehouse, false, str2int64(fromaddSelection.valueStr()));
fromAddSelection.text(warehouse.InventLocationId);
break;
}
element.setFromFields(FromAddressType.selection(), FromAddSelection.text());
element.setWarehouseFields(warehouse.InventLocationId, warehouse.InventSiteId);
VendorCode.text(vendTable.AccountNum);
VendInvoiceCode.text(vendTable.InvoiceAccount);
return ret;
}
}
Here in the lookupAddress method, Here i am returning the PostalAddressRecId as main reference to the modified method which is helping in doing the other process. I want hide this value alone in the UI .
static void lookupAddress(FormStringControl _ctrl, TMSAddressType _addressType)
{
SysTableLookup sysTableLookup;
Query query;
QueryBuildDataSource queryBuildDataSource;
boolean selectedNone;
switch (_addressType)
{
case TMSAddressType::Warehouse:
sysTableLookup = SysTableLookup::newParameters(tableNum(TMSWarehouseLocation), _ctrl);
query = new Query();
queryBuildDataSource = query.addDataSource(tableNum(TMSWarehouseLocation)); sysTableLookup.addLookupfield(fieldNum(TMSWarehouseLocation, InventLocationId)); sysTableLookup.addLookupfield(fieldNum(TMSWarehouseLocation, Name)); sysTableLookup.addLookupfield(fieldNum(TMSWarehouseLocation, PostalAddressRecId),true);
break;
default:
selectedNone = true;
break;
}
if (!selectedNone)
{
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
}
My ID, nithya.nishyas@gmail.com. Please share the xpo. Kindly suggest, if can understand the complexity.
Thanks