cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Key user fields in Other BO's action/events

Former Member
0 Kudos

Hi,

There is a Key user field created in "Account" Screen, related BO would be "Customer" or "BusinessPartner".

In my solution I have created a reference of Key users fields, and also extend the SAP BO ServiceRequest.

Now I want to access Key user fields created in Account/BusinessPartner in BeforeSave event of ServiceRequest.

Is this possible to read the KUT fields in other BO's?

Thanks

Sunil

Accepted Solutions (0)

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Sunil,

You can use the "Reference to Customer-Specific Fields" from the "New" menu:

There can be only one for the whole solution.

HTH,

     Horst

Former Member
0 Kudos

Hi Horst

Thanks for helping,

I have already created reference for Customer specific field. but I want to read extended fields in script

I want to read Customer BO's extended fields in beforeSave of ServiceRequest

I have written below script which not returning value of field.


var ExtFld;

var qry = BusinessPartner.QueryByIdentification;

var selparam = qry.CreateSelectionParams();

selparam.Add(qry.InternalID, "I","EQ", this.BuyerParty.MainPartyContactParty.PartyKey.PartyID.RemoveLeadingZeros().content);

var res;

res = qry.Execute(selparam);

if(res.Count()>0){

Trace.Info("Test1", res.Count().ToString());

foreach(var ins in res){

Trace.Info("CustoID1", ins.InternalID);

ExtFld = ins.CurrentCommon.EXTMiRisk00163E030CD31EE291A8EB6CD1B1BA95.ToString(); // this is my KUT fields

var d5 = ins.CurrentCommon.Person.Name.GivenName;

Trace.Info("KUT", ExtFld);

Trace.Info("Test2_contact", d5);

}

}

In trace I can see output

15:05:39 [1:I] Trace       KUT                           --> after KUT value is not displaying

15:05:39 [1:I] Trace       Test2_contact Sunil  --> I can see the name

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Sunil,

But your code is correct.

If the KeyUser field "EXT..." is filled for this instance of the BusinessPartner, you should be able to access it.

Bye,

    Horst

Former Member
0 Kudos

Hi Sunil,

Could you try querying Customer.bo rather than BusinessPartner.bo and see if it works?

Best regards,

Fernando Giroleti

SAP Cloud Service Center AMEA