Tuesday 7 August 2012

displaymethod to get employee countryregionid

display AddressCountryRegionId SARdisplayEmployeeCountryRegion()
{
    DirPartyAddressRelationship         partyAddressRelationship;
    DirPartyAddressRelationshipMapping  addressRelationshipMapping;
    Address                             address;
    AddressCountryRegionId              ret;
    ;
    select  addressRelationshipMapping
    join partyAddressRelationship
    where partyAddressRelationship.PartyId == this.PartyId && partyAddressRelationship.IsPrimary &&
    partyAddressRelationship.RecId == addressRelationshipMapping.PartyAddressRelationshipRecId
    join address
    where address.RecId        == addressRelationshipMapping.AddressRecId &&
    address.DataAreaId   == addressRelationshipMapping.RefCompanyId;

    if(address)
    ret = address.CountryRegionId;
    else
    ret = '';
    return ret ;
}

No comments:

Post a Comment