on 10-26-2017 1:28 PM
Dear experts,
I wrote an ABSL where I ran the performance check.
The check tells me to avoid dump for the following code, line 2:
1 var customer = query.Execute(params);
2 var attributesItems = customer.MarketingAttributes.Item;
...
-> Avoid dump: Use IsSet() to check the value returned by association Item
-> Avoid dump: Use IsSet() to check the value returned by association MarketingAttributes
So I tried to fix it with following code but then I get an error message for line 2:
1 var customer = query.Execute(params);
2 if(customer.MarketingAttributes.IsSet()) {
3 var attributesItems = customer.MarketingAttributes.Item;
...
-> Method or action is not permitted.
Am I using method IsSet() the wrong way?
Thank you and best regards
Fabian
You can use the below code:
customer.MarketingAttributes.GetFirst().IsSet();
if (this.Identification.GetFirst().IsSet()) { EmployeeIdent = this.Identification.GetFirst().EmployeeID.content; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Gaurav,
thank you for your advise.
I am just wondering when I use customer.MarketingAttributes.GetFirst().IsSet() would that not lead to a dump because I then try to retrieve the first instacne of null?
Also the performance check will still complain that I should avoid dump for association MarketingAttributes by using IsSet().
Thank you and best regards
Fabian
Hi gauravloknath.gera ,
Thanks for your answer. I am trying to use the same to implement in my code. But, still the performance check gives the warnings [Check] Avoid dump : Use IsSet() to check the value returned by association PartyInformationParty
Could you please help me here by looking at the below code?
foreach(var Result in Results){
var PartyContactParty = Result.PartyInformation.PartyInformationParty.MainPartyInformationPartyContactParty;
var ContactParty = PartyContactParty.Where(n =>n.PartyKey.PartyID.content.AddLeadingZeros() == This.ContactID).GetFirst();
if(ContactParty.IsSet()){
var ContactPartyParent = ContactParty.ToParent;
var RoleCode = ContactPartyParent.RoleCode;
if(RoleCode == "Z01" || RoleCode == "60"){
PartyInformation = ContactPartyParent.ParentNodeID;
continue;
}
}
User | Count |
---|---|
74 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.