• Akshay Sethia
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
public with sharing class dataFetch {
  @AuraEnabled(cacheable=true)
  public static PayUser__c getUser() {
    PayUser__c user = [
      SELECT Id, Name, Email__c, Contact_Number__c
      FROM PayUser__c
      WHERE Email__c = :userinfo.getUserEmail()
      LIMIT 1
    ];
    if (user == null) {
      try {
        PayUser__c newUser = new PayUser__c(
          Name = userinfo.getName(),
          Email__c = userinfo.getUserEmail()
        );
        insert newUser;
        return newUser;
      } catch (Exception e) {
        System.debug('An unexpected error has occurred: ' + e.getMessage());
        return null;
      }
    } else {
      return user;
    }
  }
}



This is my apex class, in this i want to insert a PayUser record if one is not present. can anyone help me
Hello Folks, im new to the salesforce org, and i was working on a project. I have completed the whole project but i am just stuck at one point. The situation is as follows:
  • There are 2 objects(Custom), lets consider them as Object A and Object B. 
  • I have a lookup relationship on Object A from Object B.
  • Consider i have a text field in Object A Named "NamedField__c".
  • I have made LWC for the Object B to display all the columns using Lightning DataTable.
But the main issue i am facing is that, Lightning data table only shows me the id of the lookup value, but not the "NamedField__c", which im trying to show.

Note: I have used Apex class to fetch the data and in that i am able to retive the values to the front end. (Check using console.log).
Also, i have tried using all combos of ObjectA__r.NamedField__c, ObjectA__c.NamedField__c and all. I had no reults when i did so.
I also ran the SOQL query in anonymous window and the results were as i expected.

Please help me out, over here in how to display the ObjectA -> NamedField__c field in the lightning datatable of Salesforce.

Thanks In advance, help would be much appriciated .
 
Hello Folks, im new to the salesforce org, and i was working on a project. I have completed the whole project but i am just stuck at one point. The situation is as follows:
  • There are 2 objects(Custom), lets consider them as Object A and Object B. 
  • I have a lookup relationship on Object A from Object B.
  • Consider i have a text field in Object A Named "NamedField__c".
  • I have made LWC for the Object B to display all the columns using Lightning DataTable.
But the main issue i am facing is that, Lightning data table only shows me the id of the lookup value, but not the "NamedField__c", which im trying to show.

Note: I have used Apex class to fetch the data and in that i am able to retive the values to the front end. (Check using console.log).
Also, i have tried using all combos of ObjectA__r.NamedField__c, ObjectA__c.NamedField__c and all. I had no reults when i did so.
I also ran the SOQL query in anonymous window and the results were as i expected.

Please help me out, over here in how to display the ObjectA -> NamedField__c field in the lightning datatable of Salesforce.

Thanks In advance, help would be much appriciated .
 
discreate Account Record