cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving Address snapshot of a Business Partner - C4C

Former Member
0 Kudos

Hi Experts,

I have a requirement to retrieve the current logged in users Address Snapshot details like the Country Code ,City and Communication details

.

I have used the following approach for my scenario.I have queried the Address Snapshot Business Object using the UUID of the Address Snapshot node of the Current logged in user.

But the query result is not retrieving a table with Address details of the given UUID instead it is again returning the same UUID.

I tried to query the Address Snapshot BO us

ing the UUID in Repository explorer but this particular BO is not having a query to execute.

Kindly help me in understanding the behavior of this BO and how to retrieve data from it.

Please let me know the approach which I need to follow to get the Address Information of a given BP.

Please find the screen shots for your reference.

Regards

Navin

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee
0 Kudos

Hi,

Current user Address will be stored in Employee BO and You can make use of following code to fetch the Address Related information from Employee BO.

import ABSL;
import AP.Common.GDT;
import AP.FO.BusinessPartner.Global;
import AP.PC.IdentityManagement.Global;

var new = Identity.Retrieve(Context.GetCurrentIdentityUUID());
if (new.IsSet())
{
	var ID = new.BusinessPartnerUUID.content;
	if ( !ID.IsInitial())
	{
		var BP = BusinessPartner.Retrieve(new.BusinessPartnerUUID);
		if ( BP.IsSet())
		{
			var EMP_ID = BP.Identification.GetFirst().BusinessPartnerID;
			var emp : EmployeeID;
			emp.content = EMP_ID;
			if (!EMP_ID.IsInitial())
			{
				var res = Employee.Identification.Retrieve(emp);				
				if (res.IsSet())
				{
					var data = res.ToRoot.CurrentDefaultEmployeeWorkplaceAddressInformation;
					if ( data.IsSet())
					{
						var city = data.EmployeeWorkplaceAddressOrganisationAddress.DefaultPostalAddressRepresentation.CityName;
					}
				}
			}
		}
	}
}




Thanks

Saurabh

Former Member
0 Kudos

Hi Saurabh,

Thanks for sharing the code.I still have a query when I use repository explorer for the same Employee I am not able to find the Address details but the values are available in the code level.

Could you please comment on this behavior.If the current logged in user is not a employee if he is just as Business User which node should I use to get the Address details.

Regards

Navin

Answers (0)