Does anybody know how to make a address primary in 开发者_如何学CVendTable
?
I need to make a new field (checkbox) in the Address tab of VendTable (the datasource for Address in VendTable comes from DirpartyAddressRelationship and Address).
Can anyone let me know step by step how to make a address primary?
There seems to be a lot of relations. I am not sure how this is working.
I assume you are asking how to set the primary address using code (not through the user interface).
Use the DirParty
class:
static void DirPartyTest(Args _args)
{
VendTable v = VendTable::find("10000");
DirParty d = DirParty::constructFromCommon(v);
;
d.getDirPartyAddress().parmIsPrimary(NoYes::Yes);
Dirparty::updateAddressFromParty(d);
}
Using a specific address:
void setPrimary(Address a)
{
DirParty d = DirParty::constructFromCommon(a);
;
d.getDirPartyAddress().parmIsPrimary(NoYes::Yes);
Dirparty::updateAddressFromParty(d);
}
精彩评论