• Nandhini S 3
  • NEWBIE
  • 65 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 61
    Questions
  • 35
    Replies
Hi Guys,

Is there any workaround to subscribe to joined reports.
Hi team,
I'm getting 101 error in one of the scenarios. When I checked the logs, I can see before update trigger methods are being called again after the after trigger methods are executed.
This is not happening in dev but happening in other sandboxes. 
What would cause before update trigger methods to be called again?
Hi Guys,

I have a field which has values separated by commas. I have queried this field and stored in a list. The list has only one record. How do I separate the values in the field?
Hi Guys,

I have a scheduler class, there is a method inside the class which has system.schedule to schedule that scheduler class.
I don't understand how this works.

global class testSchedule implements Schedulable {
    public static String sched; 

    public testSchedule (){
        List<Period> fiscalYear = [SELECT StartDate FROM Period  WHERE Type = 'Year' AND StartDate <= TODAY AND EndDate >= TODAY LIMIT 1];
        String startDay = String.valueOf(fiscalYear[0].StartDate.day());
        String startMonth = String.valueOf(fiscalYear[0].StartDate.month());
        //Every Start Date of Fiscal Year period.
        sched = '0 00 00 ' + startDay + ' ' + startMonth + ' ?'; 
    }   
    
    global static String scheduleMe() {
        testSchedule SC = new testSchedule (); 
        return System.schedule('Test Job', sched, SC);
    }

    global void execute(SchedulableContext SC) {
        Id batchJobId = Database.executeBatch(new testBatch(true, false)); 
    }
}
I have a custom object 'Object1', there are two record types rec1 and rec2.
For rec1, the field1 should be editable for all the profiles. I have created a permission set(perm1) and provided access for the record type and the field.
For rec2, the field1 should be editable only for certain profiles. I have created a permission set (Perm2) and provided access to the record type and field.
There is a profile which has access to both the record types. The users with that profile should be able to edit the 'Field1' in rec1 but shouldn't be able to edit 'Field1' in rec2. The users in this profile has 'Perm1' assigned to them so they are able to edit 'Field1' in both the record types.
How can i restrict access to 'Field1' in rec2.
Is there any other way to restrict access other than using a validation rule?
 
Hi Team,
I have to hide an app from app launcher for few profiles. I have removed app permission for those profiles. The app was still displaying under 'Items', so I made the tab as hidden in object settings of the profile. Now i'm trying to push the changes but i'm not able to push the tab visibility.I'm getting the below error while pushing the changes via vscode.
I'm not sure why that app is in object settings and there is no customtab for that app. 
 "In field: tab - no CustomTab named 'XXX' found"
Hi,
Need help here...I have to give edit access to a field which is set as read only in page layout.
Hi Guys,
I have a checkbox field 'Unlock for approvals'. Default value is false. There is a trigger to set it to 'True' based on the status value. But the field gets updated twice, it's changed to true and again reverted back to false.
I checked the logs but couldn't find anything useful.
The field is used only in two classes and both are to set it to true.There is no process to set it to false.
Does anyone have any insight on why this could happen?
Hi guys,
I need to create a trigger to throw error for the below scenarion...can someone help me with this.
Object1 is parent and Object2 is child. There is a picklist field 'Role' in Object2 with values ('A','B','C'). Object1 can have only one Object2 record with the same role.
If an Object1 has two Object2 child records.First record with Role = 'A' and second record with Role = 'B'. If the second record is updated to Role = 'A' then an error should be thrown.
How can i write a before update trigger to throw error.
Hi Guys,

I have a method for which redord id is the input. So based on the ID we’ll get the object type and the queries will be built dynamically based on the object type. and based on the object field names should be added to the dynamic SOQL.
Example,
Select id, name from customObject__c where customfield__c =: recordID;
 
Hi Guys,

I have a map, map<id, List<customObject>>.
How to get a specifc custom field of the custom object from the map?
Hi Guys,

I have a controller class which displays a date. The date is displaying in user's local time zone. But it should display in company's time zone. How can i format it?
Hi Team,

I'm checking if my list is empty before the update. My list returns null but still the If condition is resulting true and DML statement is throwing error.
If(myList != null && !myList.isempty())
{
update myList;
}

What am i doing wrong here
I'm using a javascript button to create a partner user account.
I'm getting the below error when i click the button.
'Cannot read property 'success' of undefined.

{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}
 if("{! Contact.Partner_User_Enabled__c}" == true )
{
alert( "Partner user already exists" );
}
else
{
var result = sforce.apex.execute("EnablePartnerPortal","createUser",{"partnerContact":'{!Contact.Id}'});
if(result[0].success == 'false')
{
alert("Account is not partner");
}
   
}
 window.location.href="/{!Contact.Id}";
Hi,
Need help here...I have to give edit access to a field which is set as read only in page layout.
Hi guys,
I need to create a trigger to throw error for the below scenarion...can someone help me with this.
Object1 is parent and Object2 is child. There is a picklist field 'Role' in Object2 with values ('A','B','C'). Object1 can have only one Object2 record with the same role.
If an Object1 has two Object2 child records.First record with Role = 'A' and second record with Role = 'B'. If the second record is updated to Role = 'A' then an error should be thrown.
How can i write a before update trigger to throw error.
Hi Guys,

I have a method for which redord id is the input. So based on the ID we’ll get the object type and the queries will be built dynamically based on the object type. and based on the object field names should be added to the dynamic SOQL.
Example,
Select id, name from customObject__c where customfield__c =: recordID;
 
Hi Guys,

I have a map, map<id, List<customObject>>.
How to get a specifc custom field of the custom object from the map?
Hi Team,

I'm checking if my list is empty before the update. My list returns null but still the If condition is resulting true and DML statement is throwing error.
If(myList != null && !myList.isempty())
{
update myList;
}

What am i doing wrong here
Hi Guys,
In lightning app builder, we have added an update action. The update action visiblilty is set based on the value of another field.
Users assigned to a particular profile are not able to view the actions even though they have access to the fields.
Can someone help me out here
Hi Guys,

I have added an update action to a page layout. The update action displays few fields based on the value of another field. Few profiles are not able to see the update action section even though they have access to the fields added in the section
Hi Guys,

I'm creating a report with 'Opportunity and opportunity team'. I need to display a specific role as a column in the report.
Ex. one of the team member role is 'Sales manager'
my report should have columns like- opportunity name, sales manager,created date

How can i display only 'Sales manager' role in the report. 
When do we go,
-Lightning record forms
-LDS wire adaptors
-apex classes
I'm getting error when i use console.log statement.
User-added image
Hi,
I'm building a lightning web component which should display result based on search result and display all the accounts when i clear the search box.
My component is displaying the search records correctly but when i clear the search box no records are displayed in the table.
User-added image
JS
*********
import { LightningElement,wire } from 'lwc';
import getAccount from '@salesforce/apex/searchLWC.getAccount';
export default class AccountSearch extends LightningElement {
    
    columns = [
      
        {
            label: 'Account Name',
            fieldName: 'Name',
            type: 'text',
        },
        {
            label: 'Account Type',
            fieldName: 'Type',
            type: 'Text',
        }
    ];
    //error;
    //accList;
    
    @wire(getAccount)
    wiredAccounts;
    /*({
        error,
        data
    }) {
        if (data) {
            this.accList = data;
        } else if (error) {
            this.error = error;
        }
    }*/
  
    
    buttonLabel ='Show Table';
    showTable;
    handleClick(){
        if(this.buttonLabel==='Show Table')
        {
            this.buttonLabel='Hide Table';
            this.showTable=true;
        }
        else
        {
            this.showTable=false;
            this.buttonLabel='Show Table';
        }
    }
     //data= wiredAccounts.data;
    searchWord;
    handleKeyUp(event){
        var keyWord=event.target.value;
        var recs= this.wiredAccounts.data;
        
       this.wiredAccounts.data=[];
       
        if(keyWord !='')
        {
            for(let i=0;i<recs.length;i++)
            {
                if(recs[i].Name.toLowerCase().includes(keyWord.toLowerCase()))
                {
                    this.wiredAccounts.data = [...this.wiredAccounts.data,recs[i]];
                }
            }
        }
            else
            {
                this.wiredAccounts.data=this.wiredAccounts.data;
            }
        
    }
}


HTML
**********
<template>
    <div onkeyup={handleKeyUp}>
        <lightning-input
            name="enter-search"
            label="Search using Name"
            type="search"
        ></lightning-input>
        </div>
    <lightning-button variant="brand" label={buttonLabel} title="Show/Hide data" onclick={handleClick} class="slds-m-left_x-small">
    </lightning-button>
    
<template if:true={showTable}>
    <div style="height: 300px;">
        <lightning-datatable
                key-field="id"
                data={wiredAccounts.data}
                columns={columns}
                hide-checkbox-column>
        </lightning-datatable>
    
    </div> 
</template>   
</template>
Hi,

Can someone tell me, what is the difference between Create Project and Create Project using Manifest? 
Is the latter used for non-dx projects primarily?

Thx