29.11.2010, 14:24 | #1 |
Участник
|
Query addField in Business Connector
Hi,
I am pretty new to business connector and I am creating a query where I can't figure out how to call addField in C#. X++ code is: .... query.dataSourceNo(1).fields().dynamic(false); query.dataSourceNo(1).fields().clearFieldList(); query.dataSourceNo(1).fields().addField(fieldNum(CompanyInfo, dataAreaId)); query.dataSourceNo(1).fields().addField(fieldNum(CompanyInfo, CurrencyCode)); ... Please give me some guidance how to use ...Call("dynamics", false) .. and so on SteEng |
|
29.11.2010, 15:28 | #2 |
Участник
|
Hi. Simple C# example:
X++: IAxapta2 axapta = new Axapta2Class(); axapta.Logon2(userId, pass, companyId, "", "", "", "", null, null, null); IAxaptaObject axQuery = axapta.CreateObject("Query", "queryName", null, null, null, null, null); IAxaptaObject axQBDS = axQuery.Call("dataSourceNo", 1, null, null, null, null, null); IAxaptaObject axQBDSFields = axQBDS.Call("fields", null, null, null, null, null, null); axQBDSFields.Call("dynamic", false, null, null, null, null, null); |
|
|
За это сообщение автора поблагодарили: SteEng (1). |
29.11.2010, 19:58 | #3 |
Участник
|
Цитата:
Сообщение от _scorp_
Hi. Simple C# example:
X++: IAxapta2 axapta = new Axapta2Class(); axapta.Logon2(userId, pass, companyId, "", "", "", "", null, null, null); IAxaptaObject axQuery = axapta.CreateObject("Query", "queryName", null, null, null, null, null); IAxaptaObject axQBDS = axQuery.Call("dataSourceNo", 1, null, null, null, null, null); IAxaptaObject axQBDSFields = axQBDS.Call("fields", null, null, null, null, null, null); axQBDSFields.Call("dynamic", false, null, null, null, null, null); What about X++ addLink(fieldNum(Currency, dataAreaId), fieldNum(CompanyInfo, dataAreaId)) ? SteEng |
|
29.11.2010, 20:14 | #4 |
Banned
|
FieldNum(...) is an intrinsic function inside of AX. I think you may directly use the known field ID number:
("addLink", 61488, 61488) |
|
29.11.2010, 20:36 | #5 |
Участник
|
Sorry EVGL,
That didn't work. Exception: Invalid Field/ Related field combination. STephan |
|
29.11.2010, 21:12 | #6 |
Banned
|
|
|
29.11.2010, 21:45 | #7 |
Участник
|
Thanks,
I should have seen that myself. |
|
Теги |
business connector |
|
|