使用 SalesforceSharp 访问查找字段
Access Lookup Field With SalesforceSharp
如何在 SalesforceSharp 中查询查找字段?当我 运行 这个查询时:
SELECT id,
AccountId,
Contact.Account.peaksyn_mm__Member_Family__c
From Contact limit 2
在Force.com的开发者控制台中,peaksyn_mm__Member_Family__c是"Y"或"N"。但是当我 运行 使用 SalesforceSharp
进行查询时
var contact_records = client.Query<SFContact>(@"SELECT id,
AccountId,
Contact.Account.peaksyn_mm__Member_Family__c
From Contact limit 2");
foreach (var r in contact_records)
{
Console.Log( r.id + ": " + (r.peaksyn_mm__Member_Family__c == null).ToString() );
}
用这个class
public class SFContact
{
public string id { get; set; }
public string AccountId { get; set; }
public string peaksyn_mm__Member_Family__c { get; set; }
}
r.peaksyn_mm__Member_Family__c 对于每条记录都是空的。是否需要某种语法来访问帐户对象中的字段?
您必须使用 r.account.peaksyn_mm__Member_Family__c 而不是 r.peaksyn_mm__Member_Family__c
如何在 SalesforceSharp 中查询查找字段?当我 运行 这个查询时:
SELECT id,
AccountId,
Contact.Account.peaksyn_mm__Member_Family__c
From Contact limit 2
在Force.com的开发者控制台中,peaksyn_mm__Member_Family__c是"Y"或"N"。但是当我 运行 使用 SalesforceSharp
进行查询时var contact_records = client.Query<SFContact>(@"SELECT id,
AccountId,
Contact.Account.peaksyn_mm__Member_Family__c
From Contact limit 2");
foreach (var r in contact_records)
{
Console.Log( r.id + ": " + (r.peaksyn_mm__Member_Family__c == null).ToString() );
}
用这个class
public class SFContact
{
public string id { get; set; }
public string AccountId { get; set; }
public string peaksyn_mm__Member_Family__c { get; set; }
}
r.peaksyn_mm__Member_Family__c 对于每条记录都是空的。是否需要某种语法来访问帐户对象中的字段?
您必须使用 r.account.peaksyn_mm__Member_Family__c 而不是 r.peaksyn_mm__Member_Family__c