• sfdc_beginner7
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 17
    Replies
I am trying to achieve below screen using https://www.lightningdesignsystem.com/components/vertical-tabs/
Expdcted ScreenBut what I am getting is this
User-added imageOnly square is coming with no icon . I tried to use other icons also but same behaviour . Is there any update on salesforce side.
 
I want to display data as pdf that is in my lightning datatable in lwc. These list i am getting from api response . It can range from 10 to 2000 or even more. So I tried below method to pass data to VF page Approach 1 : Passing list as string parameter to VF page URL , but that is hitting my URL limit. Approach 2: Declared get set variable in lwc controller and assigning values on click on print button, but that print blank pdf page .
Approach1: LWC apex controller
  1. Pagereference pageRef = new PageReference('/apex/Locations'); pageRef.getParameters().put('locations',locWrapList); pageRef.getParameters().put('brandName',brandName);
It is giving URL limit error

Approach 2:
  1. lisOfLocation= (List<LocationWrapper>)JSON.deserialize(locWrapList, List<LocationWrapper>.class);
I am using this lisOfLocation in VF page , but on click of print it is printing blank
Is there any way I can handle this
I have a requirement where I have to create Opportunity line Item on click of custom button(LWC) on Opportunity. This component have multiple picklist fields. It works something like below Field "Product Selection" contains values Red,White, Black On selection of value in Field "Product Selection" ex Red , "Field PLCC Specification" is visible with values as (Red1, Red2, Red3) On selection of value in Field "Product Selection" ex Black , "CO-brand Specifications / Tiers" is visible with values as (Black1, Black2)
Now after adding all products when user click on save, Opportunity line Item record must be created i.e if user add 2 rows then 2 records will be added
I wanto know how to handle save for such situation.
 
import { LightningElement, wire, track, api } from "lwc";
import getProducts from "@salesforce/apex/NewOpportunityLineItem.getProducts";
import getSpecifications from "@salesforce/apex/NewOpportunityLineItem.getSpecifications";
import ceateOpportunityLineItem from "@salesforce/apex/NewOpportunityLineItem.ceateOpportunityLineItem";
import { ShowToastEvent } from "lightning/platformShowToastEvent";

export default class OpportunityLineItemCreation extends LightningElement {
  @track prodId;
  @api recordId;
  valueText = "Select Product";
  @track productData; //contain product object data for 4 products
  keyIndex = 0;
  @track itemList = [
    {
      id: 0,
    },
  ];
  //  Array of picklist values  //
  @track returnOptions = [];
  @track storeNameId = [];
  @track plccOptions = [];
  @track coBrandOptions = [];
  @track mCardSpecsOptions = [];
  @track visaSpecsOptions = [];
  @track mcStandardSpecsOptions = [];
  @track mcWordSpecsOptions = [];
  @track vStandardSpecsOptions = [];
  @track vSignatureSpecsOptions = [];
  @track parameterObjectWrapper = [];
  // Contains selected picklist value //
  @track storevalue = "";
  @track plccValue = "";
  @track coBrandValue = "";
  @track mcSpecsValue = "";
  @track mcStandardSpecsValue = "";
  @track mcWordSpecsValue = "";
  @track vSpecsValue = "";
  @track vStandardSpecsValue = "";
  @track vSignatureSpecsValue = "";
  // BOOLEAN //
  showSpinner = false;
  showModal = false;
  @track isPLCC = true;
  @track isCoBrand = true;
  @track isMasterCard = true;
  @track isVisa = true;
  @track isVisaStandard = true;
  @track isMasterStandard = true;
  @track isVisaSignature = true;
  @track isMasterWorld = true;
  allValid = false;
  uniqueCombo = false;
  @wire(getProducts)
  productList;

  get eventOptions() {
    if (this.productList.data) {
      this.productList.data.forEach((ele) => {
        this.returnOptions.push({ label: ele.Name, value: ele.Name });
        this.storeNameId.push({ label: ele.Name, value: ele.Id });
      });
    }
    return this.returnOptions;
  }
  /*get hasResults() {
    return this.eventsList.data.length > 0;
  }*/
  /*Modal toggle start*/
  showModalHandler() {
    //this.returnOptions = [];
    this.showModal = true;
  }
  closeModal() {
    // to close modal window set 'showModal' track value as false
    this.showModal = false;
  }
  /*Modal toggle End*/

  saveOppLineItem() {
    this.parameterObjectWrapper = [];
    //for (var i = 0; i < this.itemList.length; i++) {
      this.validate();
      this.showSpinner = true;
      //if (this.allValid) {
        this.template.querySelector('data-id').forEach(element => {
          this.parameterObjectWrapper.push({
            productName: this.storevalue,
            selProductId: this.prodId,
            plccSpecifications: this.plccValue,
            coBrandTiers: this.coBrandValue,
            mcSpecs: this.mcSpecsValue,
            mcStandardSpecs: this.mcStandardSpecsValue,
            mcWordSpecs: this.mcWordSpecsValue,
            vSpecs: this.vSpecsValue,
            vStandardSpecs: this.vStandardSpecsValue,
            vSignatureSpecs: this.vSignatureSpecsValue,
          });
      });
        
      //}
    //}
    alert(
      "parameterObjectWrapper==" + JSON.stringify(this.parameterObjectWrapper)
    );
    ceateOpportunityLineItem({
      oppLineItemRecList: this.parameterObjectWrapper,
      oppId: this.recordId,
    }).then(() => {
      const evt = new ShowToastEvent({
        message: "Opportunity Line item Created",
        variant: "success",
      });
      //);
      this.dispatchEvent(evt);
      this.showSpinner = false;
    });
  }

  addProduct() {
    var newItemList = [];
    newItemList = this.itemList;
    this.itemList = [];
    this.validate();
    //if (this.allValid) {
      ++this.keyIndex;
      var newItem = [{ id: this.keyIndex }];
      this.itemList = newItemList.concat(newItem);
    //}
  }
  removeRow(event) {
    if (this.itemList.length >= 0) {
      this.itemList = this.itemList.filter(function (element) {
        return parseInt(element.id) !== parseInt(event.target.accessKey);
      });
    }
  }
  ////Validate Opportunity Line Item////
  validate() {
    this.allValid = [...this.template.querySelectorAll(".validValue")].reduce(
      (validSoFar, inputCmp) => {
        inputCmp.reportValidity();
        return validSoFar && inputCmp.checkValidity();
      },
      true
    );
    /*if (this.storevalue == "PLCC" || this.storevalue == "Commercial PLCC") {
              if(){

              }
            }else if (
              this.storevalue == "Co-brand" ||
              this.storevalue == "Commercial Co-brand"
            ) {
            }*/
  }
  ///////// Handle Change Start/////////
  handleEventMgrChange(event) {
    var indexnumber = event.target.dataset.indexnum;
    let iterationindex = this.template.querySelector(
      '[data-indexnum="' + indexnumber + '"]'
    );
    this.storevalue = event.target.value;
    this.valueText = "Product Selected";
    this.isVisaStandard = false;
    this.isMasterStandard = false;
    this.isVisaSignature = false;
    this.isMasterWorld = false;
    this.isMasterCard = false;
    this.isVisa = false;
    this.plccOptions = [];
    var productId = "";
    var plccOptionArray = [];
    var coBrandOptionArray = [];
    this.coBrandOptions = [];

    for (var i = 0; i < this.storeNameId.length; i++) {
      if (this.storeNameId[i].label === this.storevalue) {
        productId = this.storeNameId[i].value;
        this.prodId = productId;
      }
    }
    if (productId) {
      getSpecifications({ selProductId: productId })
        .then((result) => {
          this.productData = result;
          if (
            this.storevalue == "PLCC" ||
            this.storevalue == "Commercial PLCC"
          ) {
            alert("plccjj");

            plccOptionArray =
              this.productData.PLCC_Specifications__c.split(";");
            for (var i = 0; i < plccOptionArray.length; i++) {
              this.plccOptions.push({
                label: plccOptionArray[i],
                value: plccOptionArray[i],
              });
            }

            this.template.querySelectorAll('[data-id="plccspecification"]')
              .forEach((element) => {
                if (
                  element.dataset.id == "plccspecification" &&
                  element.dataset.indexnum == indexnumber
                ) {
                  element.className = "validValue specification customCombobox";
                  element.options = this.plccOptions;
                }
              });
          } else if (
            this.storevalue == "Co-brand" ||
            this.storevalue == "Commercial Co-brand"
          ) {
            alert("co");
            coBrandOptionArray =
              this.productData.CObrand_Specifications_Tiers__c.split(";");
            for (var i = 0; i < coBrandOptionArray.length; i++) {
              this.coBrandOptions.push({
                label: coBrandOptionArray[i],
                value: coBrandOptionArray[i],
              });
            }

            this.template
              .querySelectorAll('[data-id="cobrandspecification"]')
              .forEach((element) => {
                if (
                  element.dataset.id == "cobrandspecification" &&
                  element.dataset.indexnum == indexnumber
                ) {
                  element.className = "validValue specification customCombobox";
                  element.options = this.coBrandOptions;
                }
              });
          }
        })
        .catch((error) => {
          this.error = error;
        });
    }
    // }
  }

  handlePlccSpecification(event) {
    this.plccValue = event.target.value;
    this.isVisaStandard = false;
    this.isMasterStandard = false;
    this.isVisaSignature = false;
    this.isMasterWorld = false;
  }
  handleCoBrandSpecifications(event) {
    var indexnumber = event.target.dataset.indexnum;
    this.isMasterCard = false;
    this.isVisa = false;
    this.isVisaStandard = false;
    this.isMasterStandard = false;
    this.isVisaSignature = false;
    this.isMasterWorld = false;
    this.coBrandValue = event.target.value;
    this.mCardSpecsOptions = [];
    this.visaSpecsOptions = [];
    var masterCardSpecsArray = [];
    var visaSpecArray = [];
    if (this.coBrandValue == "MasterCard") {
      masterCardSpecsArray = this.productData.Mastercard_Specs__c.split(";");
      for (var i = 0; i < masterCardSpecsArray.length; i++) {
        this.mCardSpecsOptions.push({
          label: masterCardSpecsArray[i],
          value: masterCardSpecsArray[i],
        });
      }
      this.template
        .querySelectorAll('[data-id="masterCardSpecs"]')
        .forEach((element) => {
          if (
            element.dataset.id == "masterCardSpecs" &&
            element.dataset.indexnum == indexnumber
          ) {
            element.className = "validValue specification customCombobox";
            element.options = this.mCardSpecsOptions;
          }
        });
    } else if (this.coBrandValue == "Visa") {
      visaSpecArray = this.productData.Visa_Specs__c.split(";");
      for (var i = 0; i < visaSpecArray.length; i++) {
        this.visaSpecsOptions.push({
          label: visaSpecArray[i],
          value: visaSpecArray[i],
        });
      }
      this.template
        .querySelectorAll('[data-id="visaSpecs"]')
        .forEach((element) => {
          if (
            element.dataset.id == "visaSpecs" &&
            element.dataset.indexnum == indexnumber
          ) {
            element.className = "validValue specification customCombobox";
            element.options = this.visaSpecsOptions;
          }
        });
    }
  }
  handleMasterCardSpecs(event) {
    var indexnumber = event.target.dataset.indexnum;
    var iterationindex = this.template.querySelector(
      '[data-indexnum="' + indexnumber + '"]'
    );
    //if (indexnumber == iterationindex.dataset.indexnum) {
      this.isMasterStandard = false;
      this.isMasterWorld = false;
      this.isVisaStandard = false;
      this.isVisaSignature = false;
      this.mcSpecsValue = event.target.value;
      this.mcStandardSpecsOptions = [];
      this.mcWordSpecsOptions = [];
      var mcStandardSpecsArray = [];
      var mcWordSpecsArray = [];
      if (this.mcSpecsValue == "Standard") {
        mcStandardSpecsArray =
          this.productData.Mastercard_Standard_Specs__c.split(";");
        for (var i = 0; i < mcStandardSpecsArray.length; i++) {
          this.mcStandardSpecsOptions.push({
            label: mcStandardSpecsArray[i],
            value: mcStandardSpecsArray[i],
          });
        }
        this.template
          .querySelectorAll('[data-id="masterStandard"]')
          .forEach((element) => {
            if (
              element.dataset.id == "masterStandard" &&
              element.dataset.indexnum == indexnumber
            ) {
              element.className = "validValue specification customCombobox";
              element.options = this.mcStandardSpecsOptions;
            }
          });
      } else if (this.mcSpecsValue == "World") {
        mcWordSpecsArray = this.productData.MasterCard_Word_Specs__c.split(";");
        for (var i = 0; i < mcWordSpecsArray.length; i++) {
          this.mcWordSpecsOptions.push({
            label: mcWordSpecsArray[i],
            value: mcWordSpecsArray[i],
          });
        }
        this.template
          .querySelectorAll('[data-id="masterWorld"]')
          .forEach((element) => {
            if (
              element.dataset.id == "masterWorld" &&
              element.dataset.indexnum == indexnumber
            ) {
              element.className = "validValue specification customCombobox";
              element.options = this.mcWordSpecsOptions;
            }
          });
      }
    //}
  }
  handleVisaSpecsChanges(event) {
    var indexnumber = event.target.dataset.indexnum;
    var iterationindex = this.template.querySelector(
      '[data-indexnum="' + indexnumber + '"]'
    );
    //if (indexnumber == iterationindex.dataset.indexnum) {
      this.isVisaStandard = false;
      this.isVisaSignature = false;
      this.isMasterStandard = false;
      this.isMasterWorld = false;
      this.vSpecsValue = event.target.value;
      this.vStandardSpecsOptions = [];
      this.vSignatureSpecsOptions = [];
      var vStandardSpecsArray = [];
      var vSignatureSpecsArray = [];
      if (this.vSpecsValue == "Standard") {
        vStandardSpecsArray =
          this.productData.Visa_Standard_Specs__c.split(";");
        for (var i = 0; i < vStandardSpecsArray.length; i++) {
          this.vStandardSpecsOptions.push({
            label: vStandardSpecsArray[i],
            value: vStandardSpecsArray[i],
          });
        }
        this.template
          .querySelectorAll('[data-id="visaStandard"]')
          .forEach((element) => {
            if (
              element.dataset.id == "visaStandard" &&
              element.dataset.indexnum == indexnumber
            ) {
              element.className = "validValue specification customCombobox";
              element.options = this.vStandardSpecsOptions;
            }
          });
      } else if (this.vSpecsValue == "Signature") {
        vSignatureSpecsArray =
          this.productData.Visa_Signature_Specs__c.split(";");
        for (var i = 0; i < vSignatureSpecsArray.length; i++) {
          this.vSignatureSpecsOptions.push({
            label: vSignatureSpecsArray[i],
            value: vSignatureSpecsArray[i],
          });
        }
        this.template
          .querySelectorAll('[data-id="visaSignature"]')
          .forEach((element) => {
            if (
              element.dataset.id == "visaSignature" &&
              element.dataset.indexnum == indexnumber
            ) {
              element.className = "validValue specification customCombobox";
              element.options = this.vSignatureSpecsOptions;
            }
          });
      }
    //}
  }
  handleVisaStandardChanges(event) {
    this.vStandardSpecsValue = event.target.value;
  }
  handleVisaSignatureChanges(event) {
    this.vSignatureSpecsValue = event.target.value;
  }
  handleMasterStandardChanges(event) {
    this.mcStandardSpecsValue = event.target.value;
  }
  handlemasterWorldChanges(event) {
    this.mcWordSpecsValue = event.target.value;
  }
  ///////// Handle Change End/////////

}
How can we pass multiple parameters from Component to Apex class .For ex I have a custom object ObjectA__c , the component  takes input from user and then I need to process these values in apex class and save to db . There are more than 10 fields which needs which needs to be set in apex. I cant pass these fields as parameters . I am not sure about wrapper class. Please let me know what is the best way to do it .
 
I have created a path on custom object . Theere are 2 users 
user 1 : profile='Analyst'
User 2 : permission set ='Analyst'
Both permission set and prfile contains same permissions . But still user 2 is getting below error.
Error on loading path you cannot view this path. contact your salesforce administrator for help.
Please guide.
I have created a folder 'I Docs' inside the library 'I Library' , now based on the pofiles I want user to have create/edit/upload/delete
and for documents read/download  . Is there any way to control the access . I can only see Library admin, viewer and author . I am not sure if it will work or not.
Also fo some profile they can only access documents based on their region.
I have a formula field 
IF( ETA_Lag__c =0, TEXT( DATEVALUE( Min_ETA__c ) ),  
'between ' & TEXT( DATEVALUE( Min_ETA__c ) ) & ' and ' & TEXT( DATEVALUE(  Max_ETA__c ) ))
This is displayed as :
between 2018-10-24 and 2018-10-26
Can we convert it acc to user'slocale?
We have a user as "User abc"
Public group of user : 'ASIA'
Role of user : 'WJ'
There is a custom object "OBJ1" with OWD='Private'
Few Criteria based sharing rule are there on this object
1.f Origin_Region='ASIA' share the record with public group 'ASIA'
2.if Manyfacturing Facility='WJ' share it with role 'WJ'
When I am login as "User abc"
I am seeing the records only with OriginRegion="ASIA"  but I can see all the Mnaufacturing facility present in that object.
Does criteria based sharing rule consider public group as 1st and roles as 2nd?
Is there a way that I can see only records which have origin region =ASIA and Manufacturing Facility =WJ?
I have created Process Builder on custom object 'Alert ' , There is a look up to MTO ,so once the Alert is created ,the fields related to MTO on Alert are not getting populated. But after creating Alert record if I edit any field then all the related fields are getting populated. I am not understanding why my process builder is behaving like this.
User-added image
User-added image
User-added image
User-added image
User-added image
i have to create a validation rule if RecordType is "ITOVC_Alert" and Resolution_Status__c="Closed with actions" and ((EVC__c=FALSE and 
ISBLANK( EVC_Comments__c)) or (RCCA__c= FALSE and ISBLANK( RCCA_Description__c ) )  or ISBLANK(Resolution_Closing_Comments__c)) then throw the error , but the rule is not working as expected. If I populating EVC_Comments__c only it is getting saved.
)
AND( 
RecordType.DeveloperName ="ITOVC_Alert",
ISPICKVAL( Resolution_Status__c, "Closed with actions") ,
OR( 
AND( 
EVC__c=FALSE, 
ISBLANK( EVC_Comments__c ) 
), 
AND( 
RCCA__c= FALSE, 
ISBLANK( RCCA_Description__c ) 
),
ISBLANK(Resolution_Closing_Comments__c)
)    
)
What's wrong with my rule?
I have requirement where I need to calculate max of actual date , I have 1 SOQL in my class which is ordered by Event_Sequence__c.
Iterating over the result of SOQL I am calculating the max date and the corresponding Event_Sequence__c  
I need to calculate date corresponding to  next_Event_Sequence__c
 next_Event_Sequence__c=Event_Sequence__c of max date + 1
But as my for loop is ORDERED By  Event_Sequence__c DESC so I will always get the higher Event_Sequence__c and then the lower Event_Sequence__c, so adding 1 to Event_Sequence__c of max date will always give higher value which loop has already processed.
Ex : If this is the result of SOQL
{"Event__c":"36_Shipment Delivered","Event_Sequence__c":36,"Actual_Date__c":null},
{"Event__c":"19_Shipment POD Discharge date","Event_Sequence__c:19":null,"Actual_Date__c":"2018-06-01"},
{"Event__c":"17_Shipment POL Depart date","Event_Sequence__c":17,"Actual_Date__c":"2017-12-20"},
{"Event__c":"15_Shipment ISF date","Event_Sequence__c":15,"Actual_Date__c":"2017-12-07"},
{"Event__c":"14_Shipment Manifest date","Event_Sequence__c":14,"Actual_Date__c":"2017-11-15"},
{"Event__c":"13_Shipment In Gate Origin POL date","Event_Sequence__c":13,"Actual_Date__c":"2018-07-15"},
So I should get max Actual_Date__c=2018-07-15 and Event_Sequence__c=13
next_Event_Sequence__c=13+1=14
but 14 is processed before 13 ,so I need to store record related to 14.

Thanks!!

I have created 'send Email' button on my Custom Object with below URL
/_ui/core/email/author/EmailAuthor?retURL={!ITOVC_Alert_Case__c.Id} &p3_lkid={!ITOVC_Alert_Case__c.Id} &p2_lkid={! ITOVC_Alert_Case__c.Alert_Owner__c } &p6={! ITOVC_Alert_Case__c.Subject__c } &p24={!ITOVC_Alert_Case__c.Requestor_E_mail__c} &p4={!ITOVC_Alert_Case__c.Requestor_Group_E_mail__c} &p5=
in p2_lkid I am trying to use look up to user but it shows only lookup to contact.
I read p2_lkid is the Who Id.
Is there any way to point it to user look up?
User-added image
I am new to test classes. My Test class is giving only 36% coverage.What else i  can check in my test class

Test class:

@isTest
public class ITOVC_TargetMasterGovernanceClassTest {
    @TestSetup
    static void setup(){
        ITOVC_Target__c target1 = new ITOVC_Target__c(Name='TG01',Start_Date__c=Datetime.newInstance(2018, 01, 01), End_Date__c=Datetime.newInstance(2018, 01, 31),Target_Value__c=1);
        insert target1;
    }
  @isTest  static void testDuplicateRecordsForSameStartEndDate(){
        ITOVC_Target__c target2 = new ITOVC_Target__c(Name='TG01',Start_Date__c=Datetime.newInstance(2018, 01, 01), End_Date__c=Datetime.newInstance(2018, 01, 31),Target_Value__c=1);
        try {
           insert target2;
       } catch (Exception e) { 
           System.debug('An error happened, as predicted!');
       }
    }
}
apex class:

public class ITOVC_TargetMasterGovernanceClass {
    public void DuplicateRecordsForSameStartEndDate(List<ITOVC_Target__c> newTgId){
        List<ITOVC_Target__c> TgList = ([Select Name,Target_Value__c,Start_date__c,End_date__c from ITOVC_Target__c limit 10000]);
        for(ITOVC_Target__c tg : TgList){
            system.debug('ITOVC_Target__c tg :  ' + tg);
            for(ITOVC_Target__c newTg : newTgId ){
                system.debug('ITOVC_Target__c newtg :  ' + newtg);
                if(tg.Start_Date__c !=Null || tg.End_Date__c !=Null){
                    if( 
                        ((newTg.End_Date__c >= tg.Start_Date__c && newTg.End_Date__c <= tg.End_Date__c) ||
                        (newTg.Start_Date__c >= tg.Start_Date__c && newTg.End_Date__c <= tg.End_Date__c)||
                        (newTg.Start_Date__c >= tg.Start_Date__c && newTg.Start_Date__c <= tg.End_Date__c)||
                        (newTg.Start_Date__c < tg.Start_Date__c && newTg.End_Date__c > tg.End_Date__c))&&
                        (newTg.Name >= tg.Name)&&
                              (newTg.Target_Value__c >= tg.Target_Value__c)
                      ){

                              newTg.addError('Start date and End date are getting overlapped with existing records.');

                       }
                 }
            }
     }
    }
    public void recordsCantBeDeleted(List<ITOVC_Target__c> oldTgId){

        for(ITOVC_Target__c TgDel : oldTgId){

            TgDel.addError('You can\'t delete master target record');
        }
    }
}
apex trigger:

trigger ITOVC_TargetMasterGovernanceTrigger on ITOVC_Target__c (before insert,before update, before delete) {
     ITOVC_TargetMasterGovernanceClass thClass = new ITOVC_TargetMasterGovernanceClass();
    if(trigger.isInsert || Trigger.isUpdate){
        system.debug('Trigger.new contains :   '+Trigger.new);
        thClass.DuplicateRecordsForSameStartEndDate(Trigger.new);
    }
   if(Trigger.isDelete)
    {
        thClass.recordsCantBeDeleted(Trigger.old);
        system.debug('Trigger.old contains :   '+Trigger.old);
    }

}
 
I have 6 lookup fields on Case. If the user populates 1 lookup field, then on the other 5 lookup fields I want to show values related to the one which is populated.
I have many to many relationship between the objects.
Ex Position and website are 2 custom objects which have many to many relationship.
PO1 WB1
PO1 WB2
PO2 WB2
PO3 WB3
PO4 WB3
These can be the scenarios on the association object between Position and Website if user populate website look up field with value= WB3  if user click on position lookup field user should see PO3 and PO4 in suggestions
and also it can be vice versa ex if user enters Position=PO1 then  if user click on website lookup field user should see WB1 and WB2 in suggestions
Lookup filters and validations rules  are not possible because there is many to many relationship and also it will not auto suggest the related values.
Is there any lightning component that can auto suggest values on click of lookup field?
I need to create manual cases where 'case type' is 'Manual' I have 6 lookup fields on Case as Lookup_MTO (object is MTO) Lookup_Re (object is Re) Lookup_ToP (object is ToP) Lookup_Bk (object is Bk) Lookup_To (object is To) Lookup_Ld (object is Ld) My requirement is If Lookup_To is populated by User on the New case UI, only Lookup_MTO related to that Lookup_To should appear as available options on Lookup_To field. Same with Lookup_Re , Lookup_ToP , Lookup_Bk and Lookup_Ld. Likewise user can populate any lookup filed not only Lookup_To ,in any case rest of the lookups should come up with values related to that Lookup field populated by user. Relationship between objects is : Re(child) is having Lookup to MTO(parent) To,ToP,Bk,Ld is having many to many relationship with MTO Bk is child to ToP (look up relationship) To is a child to ToP (look up relationship) How can we achieve this ?
My requirement is to show all the cases related to parent object 'MTO' on case except the one case which is open .Ex there are 5 cases on MTO if I open 1 case then I should see other 4 cases on case related list. I have created lightning component .But the look and feel is not like related list .
Currently my lightning component is looking like this 
User-added image
also the view all button is not clickable .How can I show sandard view all button functionality?
But I want it to be look like this 
User-added image
 
I have a parent object 'MTO' for ex 1 MTO is having 5 cases My requirement is : If i open a case in MTO ,then in that case details page in related list tab I should see other 4 cases.
can we  use  a data table from the lightning design system along with an aura:if to loop through a list of related cases and display them in the table.?
 
I have a custom object 'Object1' which is having 5 cases related to it .My requirement is if I open 1 case out of 5 then in that 1 case in related list I can see other 4 cases.
How can i implement it?

There are 2 object parent and child having look up relationship between them .I need count of child object on parent but only few times.(not always)
Instead of creating childcount field on parent using trigger is there any other way ?
because we have huge data and having triggers will be complex for us.

I have a custom child object "Child__c" which is having a "Leg__c" field of type number(2,0), "Child__c" is related to parent object "Parent__c" through look up relationship.
Ex : "Parent__c" is having 6 "Child__c" with following leg
Child001    1
Child002    6
Child003    5
Child004    4
Child005    7
Child006    3
There is a field "Max_Leg__c" on "parent__c" .I need to find the max value of "Leg__c" from child object so that means my  
Max_Leg__c should be 7 on parent object.
Can we achieve it using configuration?
 
How can we pass multiple parameters from Component to Apex class .For ex I have a custom object ObjectA__c , the component  takes input from user and then I need to process these values in apex class and save to db . There are more than 10 fields which needs which needs to be set in apex. I cant pass these fields as parameters . I am not sure about wrapper class. Please let me know what is the best way to do it .
 
I have created a folder 'I Docs' inside the library 'I Library' , now based on the pofiles I want user to have create/edit/upload/delete
and for documents read/download  . Is there any way to control the access . I can only see Library admin, viewer and author . I am not sure if it will work or not.
Also fo some profile they can only access documents based on their region.
My requirement is to show all the cases related to parent object 'MTO' on case except the one case which is open .Ex there are 5 cases on MTO if I open 1 case then I should see other 4 cases on case related list. I have created lightning component .But the look and feel is not like related list .
Currently my lightning component is looking like this 
User-added image
also the view all button is not clickable .How can I show sandard view all button functionality?
But I want it to be look like this 
User-added image
 
I have a custom object 'Object1' which is having 5 cases related to it .My requirement is if I open 1 case out of 5 then in that 1 case in related list I can see other 4 cases.
How can i implement it?
I have a custom child object "Child__c" which is having a "Leg__c" field of type number(2,0), "Child__c" is related to parent object "Parent__c" through look up relationship.
Ex : "Parent__c" is having 6 "Child__c" with following leg
Child001    1
Child002    6
Child003    5
Child004    4
Child005    7
Child006    3
There is a field "Max_Leg__c" on "parent__c" .I need to find the max value of "Leg__c" from child object so that means my  
Max_Leg__c should be 7 on parent object.
Can we achieve it using configuration?
 
Hi ,I have 2 objects "Positions" and "Employment Websites" having many to many relationship between them with "Job Posting" as a junction object.
->I have a case "C1" on "Position" 
->Position "P1" is posted to 3 Employement Websites "W1" ,"W2" and "W3"
->My requirement is to show case "C1" on Employement Website "W1" ,"W2" and "W3"

I have written a trigger for the above requirement but i am stuck
Objects :
Position
Employment Websites
Job Posting (Junction object for Position and Employement Websites)
CaseRelatedList( junction object between case and employement websites)
case (look up to Position)
I am trying to copy case related list from Position to Employment Websites .
Trigger :
trigger CloneCaseRelatedList on Case (after insert) {
    set<string> posId = new set<string>();
    Map<string,Job_Posting__c> posEmpWebsite = new Map<String,Job_Posting__c>();
    if(Trigger.isInsert)
    {
        for(Case c : Trigger.new)
        {
            posId.add(c.Position__c);
                system.debug(posId);
        }
        
    }
    for(Job_Posting__c j : [Select Position__c ,Employment_Website__c from Job_Posting__c where Position__c in : posId ])
    {
        posEmpWebsite.put(j.Position__c, j);
        system.debug(posEmpWebsite);
    }
    //I am stuck at this point How I can loop through all employmemt websites that position have
        
    }
1.I have created CaseRelatedList as a junction object for Employement Website and Case
2.Created trigger on case and from there I am getting positions
3.finding employemnt websites related to position through junction object 'Job Posting'
4.Need to loop through result of step 3. 
How can I loop through it so that I can insert case and employment website on junction object caseRelatedList.
Thanks in advance!!
Hi ,I have 2 objects "Positions" and "Employment Websites" having many to many relationship between them with "Job Posting" as a junction object.
->I have a case "C1" on "Position" 
->Position "P1" is posted to 3 Employement Websites "W1" ,"W2" and "W3"
->My requirement is to show case "C1" on Employement Website "W1" ,"W2" and "W3"
How can we acheive the above requirement?
Is it possible to collapse related list on an object or limiting it to 1 or 2 records per related list ?
I have a below requirement  ,Need to create a custom object "Custom A"  which will have 2 look fields Account Name and Contact Name
.I need to create a vf page such that if I click on account name it shows me 10 records and a search box that
let me search account by putting 3 alphabets and same funcationality in contact name but it should search contact only related  to selected
account.

I have created a basic code .
Apex class
public class create_employee_mv {
    public List<String> listofAccountName {get;set;}
    public List<String> listofContactFirstName {get;set;}
    public Set<Id> AccId;
    public create_employee_mv(ApexPages.StandardController stdcntrl)
    {
        listofAccountName = new List<String>();
        Accid = new Set<Id>();
        for(Account a : [Select Id, Name,(select Employee_Designation__c from Employee_MVs__r)
                         from Account])
        {
         listofAccountName.add(a.name);
         Accid.add(a.id);
        }
        
        
    }

}

VF page
<apex:page standardController="Employee_MV__c" extensions="create_employee_mv" docType="html-5.0">
    <apex:form>
        
        <apex:inputText list="{!listofAccountName}"  /> &nbsp;
        <apex:inputField value="{!Contact_Name__c}"/>
        
    </apex:form>
</apex:page>



 
trigger prevent_duplicate_account on Account (before insert) {
    map<id,Account> mapAcc = new map<id,Account>([Select id,name,rating from Account ]);
    for(Account a : Trigger.new)
    {
        if(a.Name==mapAcc.get(a.id).name && a.rating==mapAcc.get(a.id).rating)
            a.adderror('you cant add duplicate account');
    }

}
I have already an account with name as IGA ,i am updating this account with rating =warm ,it is preventing to save record .since I have used && condition ,if both are true then only it should save the record to save . Also If i am creating a record with name as IGA and rating different from the previous one than also I am getting error .What can be done please help
Thanks in advance!!
Hi Experts,

i have little confuse ,Why we are using test.start and test stop test methods in test class to batch apex ? Any one can demonstrate on this  .      pls don't paste the link.

Regards,
Chanti
Has anyone completed this trail? I am stomped on challenge number 3, regarding created the process for fulfillment. Any pointers or guidance would be appreciated.
 
I need apex code , I want a  Text Box and button on VF page, when i enter Some Text (ex address)  and enter, It should need to display all records where the Text matches(ex Address)......How we can acheive this? Is this Possible? Can we do this using SOSL, If anyone has the code please give me?
  • February 04, 2014
  • Like
  • 0