+ Start a Discussion
Zach AckermanZach Ackerman 

Indexing

I'm need to get this piece of code indexed. I have never done indexing before would appreciate some help. 
 
001
Trigger PlanPackageNames on Plan__c (Before Insert,Before Update){
002
 
003
    for (Plan__c Plan : Trigger.new){
004
//UH Plan Names
005
        IF(Plan.Armada_Plan_Package_Name__c == 'Diamond' &&
006
        Plan.Sum_of_Benefits__c ==227500){
007
        Plan.Name= 'Ultimate Health'+' '+'Diamond';
008
        plan.meritain_coverage_category__c='EXC';
009
        plan.plan_code__c='EHOB';
010
        plan.plan_name__c='Diamond';
011
        }
012
        IF(Plan.Armada_Plan_Package_Name__c == 'Diamond' &&
013
        Plan.Sum_of_Benefits__c ==0){
014
        Plan.Name= 'Ultimate Health'+' '+'Diamond';
015
        plan.meritain_coverage_category__c='EXC';
016
        plan.plan_code__c='EHOB';
017
        plan.plan_name__c='Diamond';
018
        }
019
        IF(Plan.Armada_Plan_Package_Name__c=='Diamond'&&
020
        Plan.Sum_of_Benefits__c<>0 &&
021
        (Plan.Annual_Family_Maximum__c<>100000||
022
        Plan.Annual_Single_Maximum__c<>100000||
023
        Plan.Vision__c<>1500||
024
        Plan.Dental__c<>5000||
025
        Plan.RX__c<>4000||
026
        Plan.Counseling__c<>3000||
027
        Plan.Wellness__c<>1500||
028
        Plan.Medical_Equipment__c<>10000||
029
        Plan.Executive_Physical__c<>2500))
030
        {
031
        Plan.Name= 'Ultimate Health'+' '+'Modified'+' '+'Diamond';
032
        plan.meritain_coverage_category__c='EXC';
033
        plan.plan_code__c='EHOB';
034
        plan.plan_name__c='Diamond';
035
        }
036
        IF(Plan.Armada_Plan_Package_Name__c=='Platinum'&&
037
        Plan.Sum_of_Benefits__c==0){
038
        Plan.Name= 'Ultimate Health'+' '+'Platinum';
039
        plan.meritain_coverage_category__c='EXC';
040
        plan.plan_code__c='EHEB';
041
        plan.plan_name__c='Platinum';
042
        }
043
        IF(Plan.Armada_Plan_Package_Name__c=='Platinum'&&
044
        Plan.Sum_of_Benefits__c==115000){
045
        Plan.Name= 'Ultimate Health'+' '+'Platinum';
046
        plan.meritain_coverage_category__c='EXC';
047
        plan.plan_code__c='EHEB';
048
        plan.plan_name__c='Platinum';
049
        }
050
        IF(Plan.Armada_Plan_Package_Name__c=='Platinum'&&
051
        Plan.Sum_of_Benefits__c<>0 &&
052
       (Plan.Annual_Family_Maximum__c<>50000||
053
        Plan.Annual_Single_Maximum__c<>50000||
054
        Plan.Vision__c<>1000||
055
        Plan.Dental__c<>4000||
056
        Plan.RX__c<>2500||
057
        Plan.Counseling__c<>2000||
058
        Plan.Wellness__c<>1000||
059
        Plan.Medical_Equipment__c<>2500||
060
        Plan.Executive_Physical__c<>2000)){
061
        Plan.Name= 'Ultimate Health'+' '+'Modified'+' '+'Platinum';
062
        plan.meritain_coverage_category__c='EXC';
063
        plan.plan_code__c='EHEB';
064
        plan.plan_name__c='Platinum';
065
        }
066
        IF(Plan.Armada_Plan_Package_Name__c=='Gold'&&
067
        Plan.Sum_of_Benefits__c==0){
068
        Plan.Name= 'Ultimate Health'+' '+'Gold';
069
        plan.meritain_coverage_category__c='EXC';
070
        plan.plan_code__c='EHDB';
071
        plan.plan_name__c='Gold';
072
        }
073
        IF(Plan.Armada_Plan_Package_Name__c=='Gold'&&
074
        Plan.Sum_of_Benefits__c==57500){
075
        Plan.Name= 'Ultimate Health'+' '+'Gold';
076
        plan.meritain_coverage_category__c='EXC';
077
        plan.plan_code__c='EHDB';
078
        plan.plan_name__c='Gold';
079
        }
080
        IF(Plan.Armada_Plan_Package_Name__c=='Gold'&&
081
        Plan.Sum_of_Benefits__c<>0 &&
082
       (Plan.Annual_Family_Maximum__c<>25000||
083
        Plan.Annual_Single_Maximum__c<>25000||
084
        Plan.Vision__c<>500||
085
        Plan.Dental__c<>2000||
086
        Plan.RX__c<>1500||
087
        Plan.Counseling__c<>1000||
088
        Plan.Wellness__c<>500||
089
        Plan.Medical_Equipment__c<>1000||
090
        Plan.Executive_Physical__c<>1000)){
091
        Plan.Name= 'Ultimate Health'+' '+'Modified'+' '+'Gold';
092
        plan.meritain_coverage_category__c='EXC';
093
        plan.plan_code__c='EHDB';
094
        plan.plan_name__c='Gold';
095
        }
096
        IF(Plan.Armada_Plan_Package_Name__c=='Diamond Plus'&&
097
        Plan.Sum_of_Benefits__c==0){
098
        Plan.Name= 'Ultimate Health'+' '+'Diamond Plus';
099
        plan.meritain_coverage_category__c='EXC';
100
        plan.plan_code__c='EHMB';
101
        plan.plan_name__c='Diamond Plus';
102
        }
103
        IF(Plan.Armada_Plan_Package_Name__c=='Diamond Plus'&&
104
        Plan.Sum_of_Benefits__c==270000){
105
        Plan.Name= 'Ultimate Health'+' '+'Diamond Plus';
106
        plan.meritain_coverage_category__c='EXC';
107
        plan.plan_code__c='EHMB';
108
        plan.plan_name__c='Diamond Plus';
109
        }
110
        IF(Plan.Armada_Plan_Package_Name__c=='Diamond Plus'&&
111
        Plan.Sum_of_Benefits__c<>0&&
112
       (Plan.Annual_Family_Maximum__c<>100000||
113
        Plan.Annual_Single_Maximum__c<>100000||
114
        Plan.Vision__c<>10000||
115
        Plan.Dental__c<>10000||
116
        Plan.RX__c<>10000||
117
        Plan.Counseling__c<>10000||
118
        Plan.Wellness__c<>10000||
119
        Plan.Medical_Equipment__c<>10000||
120
        Plan.Executive_Physical__c<>10000)){
121
        Plan.Name= 'Ultimate Health'+' '+'Modified'+' '+'Diamond Plus';
122
        plan.meritain_coverage_category__c='EXC';
123
        plan.plan_name__c='Diamond Plus';
124
        }
125
        IF(Plan.Armada_Plan_Package_Name__c=='2000'){
126
        Plan.Name='Ultimate Health'+' '+2000;
127
        Plan.Meritain_Coverage_category__c='EXC';
128
        plan.plan_code__c='EH1A';
129
        plan.plan_name__c='2000';
130
        }
131
        IF(Plan.Armada_Plan_Package_Name__c=='4000'){
132
        Plan.Name='Ultimate Health'+' '+4000;
133
        Plan.Meritain_Coverage_category__c='EXC';
134
        plan.plan_code__c='EH2B';
135
        plan.plan_name__c='2000';
136
        }
137
         
138
//AH Plan Names.
139
 
140
        IF(Plan.Armada_Plan_Package_Name__c=='TopDoc Connect'&&
141
        Plan.TopDoc_connect__c=='Clinically Guided Navigations;Facilitated Access;Covered Scope: Full'||
142
        Plan.TopDoc_Connect__c==' ')
143
        {
144
        Plan.Name=Plan.Armada_Plan_Package_Name__c;
145
        plan.meritain_coverage_category__c='ARM';
146
        plan.plan_name__c='TopDoc Connect';
147
        }
148
        If(Plan.Armada_Plan_Package_Name__c=='TopDoc Connect'&&
149
        (Plan.Take_Me_Home__c<>NULL))
150
        {
151
        Plan.Name='TopDoc Connect' +' '+'Modified'+' '+Plan.Armada_Plan_Package_Name__c;
152
        plan.meritain_coverage_category__c='ARM';
153
        plan.plan_name__c='TopDoc Connect';
154
        }
155
        IF(Plan.Armada_Plan_Package_Name__c=='Global Assistance'&&
156
        Plan.Product_Name__c=='TD'&&
157
        Plan.TopDoc_connect__c=='Clinically Guided Navigations;Facilitated Access;Covered Scope: Full'&&
158
        Plan.Take_Me_Home__c=='Travel Portal;Travel Assistance')
159
        {
160
        Plan.Name='TopDoc Connect' +' '+Plan.Armada_Plan_Package_Name__c;
161
        plan.meritain_coverage_category__c='ARM';
162
        plan.plan_name__c='TopDoc Connect with Global Assistance';
163
        }
164
        If(Plan.Armada_Plan_Package_Name__c=='Global Assistance'&&
165
        Plan.Product_Name__c=='TD'&&
166
        (Plan.TopDoc_connect__c<>'Clinically Guided Navigations;Facilitated Access;Covered Scope: Full'||
167
        Plan.Take_Me_Home__c<>'Travel Portal;Travel Assistance'))
168
        {
169
        Plan.Name='TopDoc Connect' +' '+'Modified'+' '+Plan.Armada_Plan_Package_Name__c;
170
        plan.meritain_coverage_category__c='ARM';
171
        plan.plan_name__c='TopDoc Connect with Global Assitance';
172
        }
173
         
174
        IF(Plan.Armada_Plan_Package_Name__c=='Global Assistance'&&
175
        Plan.Product_Name__c=='TR'&&
176
        Plan.Take_Me_Home__c=='Travel Portal;Travel Assistance')
177
        {
178
        Plan.Name='Travel' +' '+Plan.Armada_Plan_Package_Name__c;
179
        plan.meritain_coverage_category__c='ARM';
180
        plan.plan_name__c='Global Assitance';
181
        }
182
        If(Plan.Armada_Plan_Package_Name__c=='Global Assistance'&&
183
        Plan.Product_Name__c=='TR'&&
184
        Plan.Take_Me_Home__c<>'Travel Portal;Travel Assistance')
185
        {
186
        Plan.Name='Travel' +' '+'Modified'+' '+Plan.Armada_Plan_Package_Name__c;
187
        plan.meritain_coverage_category__c='ARM';
188
        plan.plan_name__c='Global Assitance';}
189
         
190
        
191
        IF(Plan.Armada_Plan_Package_Name__c=='Take Me Home'&&
192
        Plan.Product_Name__c=='TD'&&
193
        Plan.TopDoc_connect__c=='Clinically Guided Navigations;Facilitated Access;Covered Scope: Full'&&
194
        Plan.Take_Me_Home__c=='Travel Portal;Travel Assistance;Paid Medical Evacuation')
195
        {
196
        Plan.Name='TopDoc Connect' +' '+Plan.Armada_Plan_Package_Name__c;
197
        plan.meritain_coverage_category__c='ARM';
198
        plan.plan_name__c='TopDoc Connect with Take Me Home';
199
        plan.plan_code__c='EMFM';
200
        }
201
        If(Plan.Armada_Plan_Package_Name__c=='Take Me Home'&&
202
        Plan.Product_Name__c=='TD'&&
203
        (Plan.TopDoc_connect__c<>'Clinically Guided Navigations;Facilitated Access;Covered Scope: Full'||
204
        Plan.Take_Me_Home__c<>'Travel Portal;Travel Assistance;Paid Medical Evacuation'))
205
        {
206
        Plan.Name='TopDoc Connect' +' '+'Modified'+' '+Plan.Armada_Plan_Package_Name__c;
207
        plan.meritain_coverage_category__c='ARM';
208
        plan.plan_name__c='TopDoc Connect with Take Me Home';
209
        plan.plan_code__c='EMFM';
210
        }
211
         
212
         IF(Plan.Armada_Plan_Package_Name__c=='Take Me Home'&&
213
         Plan.Product_Name__c=='TR'&&
214
         Plan.Take_Me_Home__c=='Travel Portal;Travel Assistance;Paid Medical Evacuation')
215
        {
216
        Plan.Name='Travel' +' '+Plan.Armada_Plan_Package_Name__c;
217
        plan.meritain_coverage_category__c='ARM';
218
        plan.plan_name__c='Take Me Home';
219
        plan.plan_code__c='EMFM';
220
        }
221
        If(Plan.Armada_Plan_Package_Name__c=='Take Me Home'&&
222
        Plan.Product_Name__c=='TR'&&
223
        Plan.Take_Me_Home__c<>'Travel Portal;Travel Assistance;Paid Medical Evacuation')
224
        {
225
        Plan.Name='Travel' +' '+'Modified'+' '+Plan.Armada_Plan_Package_Name__c;
226
        plan.meritain_coverage_category__c='ARM';
227
        plan.plan_name__c='Take Me Home';
228
        plan.plan_code__c='EMFM';}
229
         
230
        
231
         
232
         
233
         
234
//UH Summary of Benefits
235
 
236
         IF(Plan.Armada_Plan_Package_Name__c == 'Diamond' &&
237
        Plan.Sum_of_Benefits__c ==0)
238
        {
239
        Plan.Annual_Family_Maximum__c=100000;
240
        Plan.Annual_Single_Maximum__c=100000;
241
        Plan.Vision__c=1500;
242
        Plan.Dental__c=5000;
243
        Plan.RX__c=4000;
244
        Plan.Counseling__c=3000;
245
        Plan.Wellness__c=1500;
246
        Plan.Medical_Equipment__c=10000;
247
        Plan.Executive_Physical__c=2500;
248
        Plan.Medical_Expense_Coverage__c='All 213 Eligible';
249
        Plan.Deductible__c=0;
250
        Plan.Co_insurance__c=0;
251
        Plan.TopDoc_Connect__c='Not Applicable';
252
        Plan.Take_Me_Home__c='Not Applicable';
253
        }
254
        IF(Plan.Armada_Plan_Package_Name__c == 'Gold' &&
255
        Plan.Sum_of_Benefits__c ==0)
256
        {
257
        Plan.Annual_Family_Maximum__c=25000;
258
        Plan.Annual_Single_Maximum__c=25000;
259
        Plan.Vision__c=500;
260
        Plan.Dental__c=2000;
261
        Plan.RX__c=1500;
262
        Plan.Counseling__c=1000;
263
        Plan.Wellness__c=500;
264
        Plan.Medical_Equipment__c=1000;
265
        Plan.Executive_Physical__c=1000;
266
        Plan.Medical_Expense_Coverage__c='All 213 Eligible';
267
        Plan.Deductible__c=0;
268
        Plan.Co_insurance__c=0;
269
        Plan.TopDoc_Connect__c='Not Applicable';
270
        Plan.Take_Me_Home__c='Not Applicable';
271
        }
272
        IF(Plan.Armada_Plan_Package_Name__c == 'Platinum' &&
273
        Plan.Sum_of_Benefits__c ==0)
274
        {
275
        Plan.Annual_Family_Maximum__c=50000;
276
        Plan.Annual_Single_Maximum__c=50000;
277
        Plan.Vision__c=1000;
278
        Plan.Dental__c=4000;
279
        Plan.RX__c=2500;
280
        Plan.Counseling__c=2000;
281
        Plan.Wellness__c=1000;
282
        Plan.Medical_Equipment__c=2500;
283
        Plan.Executive_Physical__c=2000;
284
        Plan.Medical_Expense_Coverage__c='All 213 Eligible';
285
        Plan.Deductible__c=0;
286
        Plan.Co_insurance__c=0;
287
        Plan.TopDoc_Connect__c='Not Applicable';
288
        Plan.Take_Me_Home__c='Not Applicable';
289
        }
290
        IF(Plan.Armada_Plan_Package_Name__c == 'Diamond Plus' &&
291
        Plan.Sum_of_Benefits__c ==0)
292
        {
293
        Plan.Annual_Family_Maximum__c=100000;
294
        Plan.Annual_Single_Maximum__c=100000;
295
        Plan.Vision__c=10000;
296
        Plan.Dental__c=10000;
297
        Plan.RX__c=10000;
298
        Plan.Counseling__c=10000;
299
        Plan.Wellness__c=10000;
300
        Plan.Medical_Equipment__c=10000;
301
        Plan.Executive_Physical__c=10000;
302
        Plan.Medical_Expense_Coverage__c='All 213 Eligible';
303
        Plan.Deductible__c=0;
304
        Plan.Co_insurance__c=0;
305
        Plan.TopDoc_Connect__c='Not Applicable';
306
        Plan.Take_Me_Home__c='Not Applicable';
307
        }
308
        IF(Plan.Armada_Plan_Package_Name__c == '2000' &&
309
        Plan.Sum_of_Benefits__c ==0)
310
        {
311
        Plan.Annual_Family_Maximum__c=2000;
312
        Plan.Annual_Single_Maximum__c=2000;
313
        Plan.Vision__c=2000;
314
        Plan.Dental__c=2000;
315
        Plan.RX__c=2000;
316
        Plan.Counseling__c=2000;
317
        Plan.Wellness__c=2000;
318
        Plan.Medical_Equipment__c=2000;
319
        Plan.Executive_Physical__c=0;
320
        Plan.Medical_Expense_Coverage__c='All 213 Eligible';
321
        Plan.Deductible__c=0;
322
        Plan.Co_insurance__c=0;
323
        Plan.TopDoc_Connect__c='Not Applicable';
324
        Plan.Take_Me_Home__c='Not Applicable';
325
        }
326
         IF(Plan.Armada_Plan_Package_Name__c == '4000' &&
327
        Plan.Sum_of_Benefits__c ==0)
328
        {
329
        Plan.Annual_Family_Maximum__c=4000;
330
        Plan.Annual_Single_Maximum__c=4000;
331
        Plan.Vision__c=4000;
332
        Plan.Dental__c=4000;
333
        Plan.RX__c=4000;
334
        Plan.Counseling__c=4000;
335
        Plan.Wellness__c=4000;
336
        Plan.Medical_Equipment__c=4000;
337
        Plan.Executive_Physical__c=0;
338
        Plan.Medical_Expense_Coverage__c='All 213 Eligible';
339
        Plan.Deductible__c=0;
340
        Plan.Co_insurance__c=0;
341
        Plan.TopDoc_Connect__c='Not Applicable';
342
        Plan.Take_Me_Home__c='Not Applicable';
343
        }
344
         
345
         
346
//AH Summary of Benefits.
347
 
348
        IF(Plan.Armada_Plan_Package_Name__c == 'TopDoc Connect'&&
349
        Plan.Product_Name__c=='TD'&&
350
        Plan.TopDoc_Connect__c==NULL)
351
        {
352
        Plan.TopDoc_connect__c='Clinically Guided Navigations;Facilitated Access;Covered Scope: Full';
353
        Plan.Take_Me_Home__c=' ';
354
        Plan.Annual_Family_Maximum__c=0;
355
        Plan.Annual_Single_Maximum__c=0;
356
        Plan.Vision__c=0;
357
        Plan.Dental__c=0;
358
        Plan.RX__c=0;
359
        Plan.Counseling__c=0;
360
        Plan.Wellness__c=0;
361
        Plan.Medical_Equipment__c=0;
362
        Plan.Executive_Physical__c=0;
363
        Plan.Medical_Expense_Coverage__c='Not Applicable';
364
        Plan.Deductible__c=0;
365
        Plan.Co_insurance__c=0;
366
        }
367
        IF(Plan.Armada_Plan_Package_Name__c=='Take Me Home'&&
368
        Plan.Product_Name__c=='TD'&&
369
        Plan.TopDoc_Connect__c==NULL)
370
        {
371
        Plan.TopDoc_connect__c='Clinically Guided Navigations;Facilitated Access;Covered Scope: Full';
372
        Plan.Take_Me_Home__c='Travel Portal;Travel Assistance;Paid Medical Evacuation';
373
        Plan.Annual_Family_Maximum__c=0;
374
        Plan.Annual_Single_Maximum__c=0;
375
        Plan.Vision__c=0;
376
        Plan.Dental__c=0;
377
        Plan.RX__c=0;
378
        Plan.Counseling__c=0;
379
        Plan.Wellness__c=0;
380
        Plan.Medical_Equipment__c=0;
381
        Plan.Executive_Physical__c=0;
382
        Plan.Medical_Expense_Coverage__c='Not Applicable';
383
        Plan.Deductible__c=0;
384
        Plan.Co_insurance__c=0;
385
        }
386
        IF(Plan.Armada_Plan_Package_Name__c=='Global Assistance'&&
387
        Plan.Product_Name__c=='TD'&&
388
        Plan.TopDoc_Connect__c==NULL)
389
        {
390
        Plan.TopDoc_connect__c='Clinically Guided Navigations;Facilitated Access;Covered Scope: Full';
391
        Plan.Take_Me_Home__c='Travel Portal;Travel Assistance';
392
        Plan.Annual_Family_Maximum__c=0;
393
        Plan.Annual_Single_Maximum__c=0;
394
        Plan.Vision__c=0;
395
        Plan.Dental__c=0;
396
        Plan.RX__c=0;
397
        Plan.Counseling__c=0;
398
        Plan.Wellness__c=0;
399
        Plan.Medical_Equipment__c=0;
400
        Plan.Executive_Physical__c=0;
401
        Plan.Medical_Expense_Coverage__c='Not Applicable';
402
        Plan.Deductible__c=0;
403
        Plan.Co_insurance__c=0;
404
        }
405
        IF(Plan.Armada_Plan_Package_Name__c=='Take Me Home'&&
406
        Plan.Product_Name__c=='TR'&&
407
        Plan.TopDoc_Connect__c==NULL)
408
        {
409
        Plan.TopDoc_connect__c='';
410
        Plan.Take_Me_Home__c='Travel Portal;Travel Assistance;Paid Medical Evacuation';
411
        Plan.Annual_Family_Maximum__c=0;
412
        Plan.Annual_Single_Maximum__c=0;
413
        Plan.Vision__c=0;
414
        Plan.Dental__c=0;
415
        Plan.RX__c=0;
416
        Plan.Counseling__c=0;
417
        Plan.Wellness__c=0;
418
        Plan.Medical_Equipment__c=0;
419
        Plan.Executive_Physical__c=0;
420
        Plan.Medical_Expense_Coverage__c='Not Applicable';
421
        Plan.Deductible__c=0;
422
        Plan.Co_insurance__c=0;
423
        }
424
        IF(Plan.Armada_Plan_Package_Name__c=='Global Assistance'&&
425
        Plan.Product_Name__c=='TR'&&
426
        Plan.TopDoc_Connect__c==NULL)
427
        {
428
        Plan.TopDoc_connect__c='';
429
        Plan.Take_Me_Home__c='Travel Portal;Travel Assistance';
430
        Plan.Annual_Family_Maximum__c=0;
431
        Plan.Annual_Single_Maximum__c=0;
432
        Plan.Vision__c=0;
433
        Plan.Dental__c=0;
434
        Plan.RX__c=0;
435
        Plan.Counseling__c=0;
436
        Plan.Wellness__c=0;
437
        Plan.Medical_Equipment__c=0;
438
        Plan.Executive_Physical__c=0;
439
        Plan.Medical_Expense_Coverage__c='Not Applicable';
440
        Plan.Deductible__c=0;
441
        Plan.Co_insurance__c=0;
442
         
443
         
444
         
445
         
446
                                            }
447
          
448
                                     }
449
                                 
450
                             }

 
SandhyaSandhya (Salesforce Developers) 
Hi,

Use the below link  http://www.forcextra.com/ copy paste your code to be formatted.

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya


 
eliclak seleliclak sel
Try to interlink them with already indexed pages. I did the same practice for my page (http://www.thecorecollection.com/) and its working for me.