07-11-2017 6:15 AM - edited 02-03-2024 10:36 PM
Hello, Experts.
When I checked the performance tips on the above code it shows
so I've modified as below,
Still, I'm getting performance suggestions as below
How to optimize the code without any suggestion leaving by performance tips tool.
Br
Senz
Hello Senz,
By simply doing what the Performance Tips suggest:
use
if (this.ToParent.CC:IsSet())
instead of
if (parent.CC.Count() > 0 )
HTH,
. Horst
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Senz,
I see we need to enhance the performance tips 🙂
First: if you use constructs like "this.<association>" more than twice, it is better to assign it to a variable
var myParent = this.ToParent;
Then you can check it.
Checking means
Second: You don't need to check if the "this" is set.
Maybe you share the BO definition so we can see how "CC" is defined.
Bye,
. Horst
Thanks Horst
Here is my BO
import AP.Common.GDT as apCommonGDT;
[DeploymentUnit(Financials)] businessobject ApprovalSetup raises GeneralInfo
{
message ServiceIDEmpty text "Service ID cannot be empty,save fails";
message GeneralInfo text "&1":LANGUAGEINDEPENDENT_EXTENDED_Text;
message SourceBOExists text "Entered source business object already exists,save fails";
[AlternativeKey]element ID:BusinessTransactionDocumentID;
element SysAdminData:SystemAdministrativeData;
element CreatedBy:Name;
element ChangedBy:Name;
element Status :ActivationStatusCode;
element SourceBusinessObject:BusinessObjectTypeCode;
element CompanyID : PartyID;
element CompanyName:Name;
element BackupEmployee:EmployeeID;
action Delete;
node DefaultTargetGroups [0,n] raises GeneralInfo,SourceBOExists
{
element ID:BusinessTransactionDocumentItemID;
element Level:NumberValue;
element ActualLevel : NumberValue;
element TargetOption:TARGETOPTIONCode;// 1 = target group, 2= individual, 3= ops manager
element TargetGroupID:BusinessTransactionDocumentID; // if targetOption = 1
element TargetGroupName:Name;
element AllRelevant:Indicator;
element RelevanceFormula:REL_FORMULACode;
element CommonEmployee : EmployeeID;
element CommonEmployeeName : Name;
action AddCC;
element WithRFQ:Indicator;
node CC [0,n] raises CCInfo
{
message CCInfo text "&1":LANGUAGEINDEPENDENT_EXTENDED_Text;
element CCEmployee : EmployeeID;
element CCEmployeeName : Name;
}
}
}
and I wrote the code on Root ->Node DefaultTargetGroups->Node CC -> Event AfterModify script.
Regards
Senz.
Hello Senz,
I've checked the Performance Tips coding for that situation.
I will do some enhancements there. 🙂
For the time being you can ignore those messages for this situation.
Sorry,
. Horst
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.