• Madhuri Londhe
  • NEWBIE
  • 45 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 8
    Questions
  • 7
    Replies
I have a triger condition which checks wheather user role exists in custom setting or not.
so for this i have a method where U do query on UserRole object.
I receive below error:
execution of BeforeUpdate caused by: System.QueryException: sObject type 'UserRole' is not supported.

for normal users i dont receive this error. But as system admin I receive email fro this and I am not able to find the cause.
please let me know the reason/cause for this and for which user we should expect this?
 
I am writing query on Object ' Product Item Consumed'. It has lookup field 'Related Record'
I have to fetch fields of its parent.
please help me to write SOQL.
I tried below Query but its giving error.
SOQL :SELECT ProductItemId,RelatedRecord.Serial_Number__c FROM ProductItemTransaction where RelatedRecord.Id != NULL

Error:ERROR at Row:1:Column:22
No such column 'Serial_Number__c' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

User-added image
Hi,

I need to write a batch class on one of object records whose created date  greater than 5 years .
Please help me to write correct filter condition for this.
 I have created Dispatcher Console Custom Actions. And i am calling a visualforce page. From visualforce page i am calling One lightning commponent. On save button of lightning component my Dispatcher Console Custom Actions Dialog box should be closed. Do anyone know how to achive this?
 @AuraEnabled
    @Future(callout=true)
    public static void makePostCallout(String reqId) 
    {}

Can I do this?
I am not getting any error for this.
I need to call this method from trigger as well as lightning component.
Hi,

In one of my interview ,the interviewer asked to explain an application in apex from front ent to back end.

I didnt get his requirement. what he wanted . I have worked in apex at backend that is trigger, Batch classes. what is frond end development in Apex? Can somone explain?
I have a triger condition which checks wheather user role exists in custom setting or not.
so for this i have a method where U do query on UserRole object.
I receive below error:
execution of BeforeUpdate caused by: System.QueryException: sObject type 'UserRole' is not supported.

for normal users i dont receive this error. But as system admin I receive email fro this and I am not able to find the cause.
please let me know the reason/cause for this and for which user we should expect this?
 
I am writing query on Object ' Product Item Consumed'. It has lookup field 'Related Record'
I have to fetch fields of its parent.
please help me to write SOQL.
I tried below Query but its giving error.
SOQL :SELECT ProductItemId,RelatedRecord.Serial_Number__c FROM ProductItemTransaction where RelatedRecord.Id != NULL

Error:ERROR at Row:1:Column:22
No such column 'Serial_Number__c' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

User-added image
Hi,

I need to write a batch class on one of object records whose created date  greater than 5 years .
Please help me to write correct filter condition for this.
Hi ! 

Let us say we have an Admin. He will be owner of leads, Opportunities, accounts, he will get alerts, his email id used in email templates etc. But he left the company ... now, we need to deactivate him. How do we find what all he is tied to in Salesforce, so, that I can do mass transfer of records, change templates, apex classes if any). How to get this list please ? what is the procudere or quick way transferring the records etc. pls let me know. Thanks. 
  • September 23, 2019
  • Like
  • 0
I enabled email to case in my org. When a response comes in and the case is closed a new case will be created., that is working as expected using the process builder. However when the new case is created the email is not attaching to the new case . I would like the email to attach as an activity or email to the new case. Any ideas on how i can do this? 

Not really a question, but  solution I thought might be helpful to others:

 

Due to the nature of most backoffice (and frontoffice, for that matter) systems, the standard Address object in salesforce does not work well with integrations, especially if you are using Salesforce.com as the system of record for some addresses.  Most of these systems use a dedicated field for each address line.   We need our street address field to fit into our accounting system limitations, which are:

1. Maxium of 30 characters per line

2. No more than two lines

 

Anyway, the answer for me was some fairly basic Regex for the BillingStreet Field:

NOT(
OR(
REGEX(
BillingStreet,
".{0,30}"
),
REGEX(
BillingStreet,
".{0,30}\r\n.{0,30}"
)
)
)

My regex logic:

Must be:
Empty or Single line less than 31 characters:
.{0,30}
Two lines with less than 31 characters each line:
.{0,30}\r\n.{0,30}

You can also do this with negative enforcement, but the positive model is much cleaner (example shown with 60 character limit instead of 30):

NOT:
2 or more CRLFs
(.*\r\n){2,}.*
More than 60 characters on single line
.{61,}
More than 60 characters on first line of two
.{61,}\r\n.*
More than 60 characters on second line of two
.*\r\n.{61,}

I learned the following about SF regex while doing this:

1. It does not appear to operate in multi-line mode (IE the $ zero-width match does not match the end of each line, just the end of the field)

2. The dot (.) does not match EOL characters (\r and \n)

3. Your regex has to match the entire field - all lines to be true.   In other workds, .* will not match a multi-line field.

4. To match the entire field regardless of the number of lines you would use (.*\r\n){*}

5. SF Address field uses \r\n as their EOL for the purposes of regex (I think this is different than the export, which is supposed to use just \n).

 

Enjoy,

 

Brandy Peterson