Time Function In SSRS reports D365FO. Convert seconds to 1:00 pm.
=Format(TimeSerial(0,0,first(Fields!JobOrderTime.Value, "ServiceOrder")),"hh:mm:ss tt")
Keep Daxing!!
Time Function In SSRS reports D365FO. Convert seconds to 1:00 pm.
=Format(TimeSerial(0,0,first(Fields!JobOrderTime.Value, "ServiceOrder")),"hh:mm:ss tt")
Keep Daxing!!
If you want to get address of from warehouse:
InventLocation::find(InventLocationId).logisticsPostalAddress().Address;
InventLocation::find(InventLocationId).Address();
--------------------------------------------or--------------------------------------------------------
Based on role type:
Get delivery type primary address of warehouse:
public static RefRecId getDeliveryAddressRecid(InventLocationId _inventLocationId) { InventLocation inventlocation = InventLocation::find(_inventLocationId); InventLocationLogisticsLocation inventLocationLogisticsLocation; InventLocationLogisticsLocationRole inventLocationLogisticsLocationRole; LogisticsLocationRole logisticsLocationRole; LogisticsPostalAddress postalAddress; select firstonly location from inventLocationLogisticsLocation where inventLocationLogisticsLocation.InventLocation == inventLocation.RecId && inventLocationLogisticsLocation.IsPrimary == true exists join inventLocationLogisticsLocationRole where inventLocationLogisticsLocationRole.LocationLogisticsLocation == inventLocationLogisticsLocation.RecId exists join logisticsLocationRole where inventLocationLogisticsLocationRole.LocationRole == logisticsLocationRole.RecId && logisticsLocationRole.Type == LogisticsLocationRoleType::Delivery; if (inventLocationLogisticsLocation.Location) { TransDateTime now = DateTimeUtil::getSystemDateTime(); select firstonly validtimestate(now) RecId from postalAddress where postalAddress.Location == inventLocationLogisticsLocation.Location; } return postalAddress.RecId ? postalAddress.RecId : nullValueFromType(Types::Int64); }
--------------------------------------------or--------------------------------------------------------
public static void getDeliveryAddress(RefRecId _inventLocationRecId) {
InventLocationLogisticsLocation inventLocationLogisticsLocation;
Select firstOnly inventLocationLogisticsLocation where inventLocationLogisticsLocation.InventLocation == _inventLocationRecId && inventLocationLogisticsLocation.IsPrimary == NoYes::Yes;
}
Keep Daxing!!
Get current company's Contact Information In D365 FO.
static void CompanyPhone(Args _args)
{
DirPartyLocation dirPartyLocation;
LogisticsElectronicAddress electronicAddress;
CompanyInfo companyInfo;
companyInfo = companyInfo::find();
select dirPartyLocation
where dirPartyLocation.Party == companyInfo.RecId
&& dirPartyLocation.IsPostalAddress == NoYes::No
join electronicAddress
where electronicAddress.Location == dirPartyLocation.Location
&& electronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;
{
info(strFmt("Description: %1, Contact number/address: %2", electronicAddress.Description, electronicAddress.Locator));
}
}
Keep Daxing!!
Right-click on the button and copy the name.
check the Below code.
FormCommandButtonControl newButton;
#SysSystemDefinedButtons //- standard macro
// #SystemDefinedNewButton - button name.
newButton = sender.control(sender.controlId(#SystemDefinedNewButton)) as FormCommandButtonControl;
newButton.visible(false);
// Disable in design
sender.formRun().design().showNewButton(0);
this.form().design().showNewButton(0);
Keep Daxing!!
How to change form view mode to edit mode in D365.
Convert HexaDecimal value to decimal in d365Fo using X++.
Check below code:
{
int R, G, B;
str colorStr = '#00FF00';
R = hex2int(substr(colorStr,2,2));
G = hex2int(substr(colorStr,4,2));
B = hex2int(substr(colorStr,6,2));
info(strFmt('%1',WinAPI::RGB2int(R,G,B)));
info(strFmt('%1',WinAPI::RGB2int(0,255,0)));
}
Keep Daxing!!