function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC n12SFDC n12 

Standard field help needed

Hi,

I am having a standard text field "Name" which is mandatory and i want to populate the value of another field called as "new request __c" which is an lookup to account object

Both the fields are on the same custom object called as "Account exceptions"



when i hit save , the value of "Name" field (Standard text field)  should be automatically populated with the values that i have entered in the "Newrequest" which is a lookup to account



Help me how to achieve this

Thanks in Advance
Tushar sharmaTushar sharma
write workfolw on when created and in the field update update the field with the "Newrequest" field value but if Name is mandatory then it will show error for this you need to write extension and  in extension you can get value of Newrequest and insert into Name and then save the record
SFDC n12SFDC n12
I trieed with the workflow field update but since its a text field i am not sure what to map it with the lookup field value


how do i do it

should i just give "Newrequest__c" in the field update without the "" 



PrasadVRPrasadVR
Use the Formula Editor to update Name Field with Newrequest__c , 

In the formula editior refer Newrequest__c field name , you need to write like this Newrequest__r.Name . this will update the Name with Newrequest__c Name 
SFDC n12SFDC n12
The workflow part is working fine , but how to do i handle the mandatory field and make it read only , if i enter some value and click on save its updating the account name correctly 


How do i handle that part 
SFDC n12SFDC n12
help me how to make a standard field read only in salesforce
PrasadVRPrasadVR
It's an Salesforce Standard field, I guess there is no way to make it as read only / removing from page layout . 

Bilal AliBilal Ali
There are two ways to accomplish this,

1.Create a visual force page and extension for which you have to made custom development then you can handle name field and populate it with the lookup.

2.Create a custom list button copy and paste the new Account url in it.Append the url with '&acc2=test'.

Sample URL: https://Bill.my.salesforce.com/001/e?retURL=%2F001%2Fo&acc2=tbd

When you click your custom list button it will redirect you the new account page and name field will be autopopulated.Select new_request__c value and save it.You workflow rull will be fire and update the name field.

thanks,
Bilal
SFDC n12SFDC n12
i want to do it by custom button

help me how to do it by custom button , what should i append the url with it 


https://cs11.salesforce.com/?
SFDC n12SFDC n12
should i use like this as the url in my new button

https://cs11.salesforce.com/e?retURL=%2F001%2Fo&Name=NewRequest__c
Bilal AliBilal Ali
Use the below URL in your custom list button or you can directly paste into your browser for testing.This url will autopopulate the Name and you dont have to face required validation, once you save the new account record the workflow will run and update the name field with your desired value.


https://cs11.salesforce.com/001/e?retURL=%2F001%2Fo&acc2=test