查询职位信息
Query Job Information
我正在查看屏幕参考以查看是否有 XML 查询职位的请求。我发现只有客户查询请求 CustomerQueryRq
而它也没有 return 它拥有的子作业。
假设客户和就业中心是这样的:
- Customer 1
-- Job 1
-- Job 2
-- Job 3
我能够使用 CustomerQueryRq
并获取 Customer 1
的详细信息,但找不到任何用于检索 Job 1
.
的内容
所以我的问题是如何查询工作并获得它所在的父客户?如果有任何帮助,我将不胜感激。
编辑: 发布我的 QBXML 请求:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<CustomerQueryRq requestID="1">
<FullName>Customer name</FullName>
</CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>
Customer name
有子作业,我想查询一下。
ICustomerQuery
returns 工作列表以及客户列表。没有针对职位的单独查询 object。每个工作都有一个客户作为 parent。因此,您还可以检索作业的关联客户。
这是一个示例:我的公司文件中有一份工作 J1 与客户 C1 关联。在下面的 C# 代码示例中,我创建了一个客户查询 object(使用 QB SDK 13.0)并迭代了结果。我在客户列表中得到两个结果( C1 和 J1 ):
using QBXMLRP2Lib;
using Interop.QBFC13;
public class SDKApp
{
private QBSessionManager sessionMgr;
public SDKApp()
{
// in the class constructor - sessionMgr is a member variable
sessionMgr = new QBSessionManager();
}
public void GetData()
{
// open connection and begin session before data fetch - intentionally skipped this code
// during data fetch
IMsgSetRequest msgset = sessionMgr.CreateMsgSetRequest("US", 13, 0);
ICustomerQuery customerQuery = msgset.AppendCustomerQueryRq();
IMsgSetResponse msgRes = sessionMgr.DoRequests(msgset);
IResponseList responseList = msgRes.ResponseList;
if (responseList.Count > 0)
{
IResponse response = responseList.GetAt(0);
ICustomerRetList customerList = response.Detail as ICustomerRetList;
for (int i = 0; i <= customerList.Count - 1; i++)
{
ICustomerRet qbCustomer = customerList.GetAt(i);
string displayName = qbCustomer.Name.GetValue();
string entityType = "Customer";
if (qbCustomer.ParentRef != null)
{
entityType = "Job of " + qbCustomer.ParentRef.FullName.GetValue();
}
Console.WriteLine(displayName + " " + entityType);
}
}
// end session and close connection after data fetch - intentionally skipped this code
}
}
我正在查看屏幕参考以查看是否有 XML 查询职位的请求。我发现只有客户查询请求 CustomerQueryRq
而它也没有 return 它拥有的子作业。
假设客户和就业中心是这样的:
- Customer 1
-- Job 1
-- Job 2
-- Job 3
我能够使用 CustomerQueryRq
并获取 Customer 1
的详细信息,但找不到任何用于检索 Job 1
.
所以我的问题是如何查询工作并获得它所在的父客户?如果有任何帮助,我将不胜感激。
编辑: 发布我的 QBXML 请求:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<CustomerQueryRq requestID="1">
<FullName>Customer name</FullName>
</CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>
Customer name
有子作业,我想查询一下。
ICustomerQuery
returns 工作列表以及客户列表。没有针对职位的单独查询 object。每个工作都有一个客户作为 parent。因此,您还可以检索作业的关联客户。
这是一个示例:我的公司文件中有一份工作 J1 与客户 C1 关联。在下面的 C# 代码示例中,我创建了一个客户查询 object(使用 QB SDK 13.0)并迭代了结果。我在客户列表中得到两个结果( C1 和 J1 ):
using QBXMLRP2Lib;
using Interop.QBFC13;
public class SDKApp
{
private QBSessionManager sessionMgr;
public SDKApp()
{
// in the class constructor - sessionMgr is a member variable
sessionMgr = new QBSessionManager();
}
public void GetData()
{
// open connection and begin session before data fetch - intentionally skipped this code
// during data fetch
IMsgSetRequest msgset = sessionMgr.CreateMsgSetRequest("US", 13, 0);
ICustomerQuery customerQuery = msgset.AppendCustomerQueryRq();
IMsgSetResponse msgRes = sessionMgr.DoRequests(msgset);
IResponseList responseList = msgRes.ResponseList;
if (responseList.Count > 0)
{
IResponse response = responseList.GetAt(0);
ICustomerRetList customerList = response.Detail as ICustomerRetList;
for (int i = 0; i <= customerList.Count - 1; i++)
{
ICustomerRet qbCustomer = customerList.GetAt(i);
string displayName = qbCustomer.Name.GetValue();
string entityType = "Customer";
if (qbCustomer.ParentRef != null)
{
entityType = "Job of " + qbCustomer.ParentRef.FullName.GetValue();
}
Console.WriteLine(displayName + " " + entityType);
}
}
// end session and close connection after data fetch - intentionally skipped this code
}
}