on 07-22-2019 4:02 PM
Hi all,
I know how to display value in field of matrix in SAP B1 SDK, but I tried to display date in date field I failed, Below is my code I tried but there is no luck
mtx2.Columns.Item("C_1_5").Cells.Item(mtx2.RowCount).Specific.string = FromDate 'this is variable of date from database
Above codes fail when I run
or
mtx2.Columns.Item("C_1_5").Cells.Item(mtx2.RowCount).Specific.string = Format(FromDate, "dd/MM/yyyy")
Above codes display nothing in the field
Please anyone can help me
Hi all,
It works, I took normal field in my query and then I converted variable instead of converting field in query
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pls Replace
Services.GetCompany
with
(Application.SBO_Application.Company.GetDICompany as SAPbobsCOM.Company)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use that code for this. You must replace "Services.GetCompany" with your code.
public static DateTime DateTimeValue(string DateString)
{
SAPbobsCOM.SBObob oBridge =
(SAPbobsCOM.SBObob)Services.GetCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
return (DateTime)oBridge.Format_StringToDate(DateString).Fields.Item(0).Value;
}
public static string DateTimeToString(DateTime Date)
{
SAPbobsCOM.SBObob oBridge =
(SAPbobsCOM.SBObob)Services.GetCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
return oBridge.Format_DateToString(Date).Fields.Item(0).Value.ToString();
}
public static string DateTimeToString(object Date)
{
SAPbobsCOM.SBObob oBridge =
(SAPbobsCOM.SBObob)Services.GetCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
return oBridge.Format_DateToString((DateTime)Date).Fields.Item(0).Value.ToString();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hakan,
Actually FromDate is selected from database with recordset
Dim sRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset) sRs.DoQuery("SELECT T0.[U_FromDate] from [dbo].[@ODDS] T0...........")
Data type of U_FromDate is date
variable of U_FromDate which is FromDate is the one used below
mtx2.Columns.Item("C_1_5").Cells.Item(mtx2.RowCount).Specific.string = FromDate
I tried to use
Dim sRs2 As SAPbobsCOM.SBObob = CType(Services.GetCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge), SAPbobsCOM.SBObob)
But I get error message Addon failed.... to that line
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.