Hey guys, question, how do I add / remove entities from the lead "Convert" button on the lead?
Convert to
Collapse
X
-
you can't add / remove entities from the lead Convert button one way to remove them is to go to entity manager > account > layouts > convert Lead and then just make sure that you don't include any any fields there, same goes for opportunities and contacts. Otherwise you could create a custom convert to logic to override the existing one.Rabii
Web Dev -
you can't add / remove entities from the lead Convert button one way to remove them is to go to entity manager > account > layouts > convert Lead and then just make sure that you don't include any any fields there, same goes for opportunities and contacts. Otherwise you could create a custom convert to logic to override the existing one.
1. I tried to remove Account from Lead conversion, but it is not allowing me to delete all fields from the layout (screen attached)
2. I am trying to add a custom entity to a lead conversion, can't add it since there is no such option on the "Entity manager"Comment
-
Hey Russ
I have doubled checked and it seems that it is possible to add / remove scopes to the convert button of the lead, below is an expample on how to add Case to the convert button:
1 - Create a new file if doesn't exist under custom\Espo\Custom\Resources\metadata\entityDefs\L ead.json and paste the code below: (Use only one of the two code - each code below represent a Lead.json file)
PHP Code:// Use this code if you want to only add more entities e.g below i have added Case to the existing list using (Append) // // convertFields is used to map the fields between the converted entity and the lead (name of the case) => accountName of the Lead { "convertEntityList": [ "__APPEND__", "Case" ], "convertFields": { "Case": { "name": "accountName" } } } // Use this code if you want to override existing list and remove entities e.g below i have removed opportunity and added Case // convertFields is used to map the fields between the converted entity and the lead (name of the case) => accountName of the Lead { "convertEntityList": [ "Account", "Contact", "Case" ], "convertFields": { "Case": { "name": "accountName" } } }
2 - Create a detailConvert.json under custom\Espo\Custom\Resources\layouts\Case and paste into the code below (you need to customise this to show the correct field you want to use for the conversion), in example below i am using only name and description but you can customise it to your need:
PHP Code:[ { "label":"Overview", "rows":[ [{"name":"name"},false] ] }, { "label":"Details", "rows":[ [{"name":"description", "fullWidth": true}] ] } ]
If you follow that then just clear the cache and rebuild the system and you should see the Case in the conversion list entity when you click on convert.
As per your question about making one entity required based on selection of another i think it is possible but require some code adjustment. will see if i come up with something i will share with you.
I hope this helps.
CheersLast edited by rabii; 06-10-2024, 08:11 AM.Rabii
Web DevComment
-
Thanks a lot rabii, I will try, so you example shows how to add an entity, how do we remove one? Let's say "Account"?
// Use this code if you want to override existing list and remove entities e.g below i have removed opportunity and added Case
ThanksComment
-
There is a small error in rabii post.
The file should be called -> detailConvert.json
Comment
-
Is it possible to write custom logic for convert but in lead to convert screen,
Example: when I check the customer and click on convert button customer will be created, after created using customer id to create another entity.
If possible how to create custom logic and in which folder path that need to place that javascript file, and how to add in view in lead.json file.Comment
-
Is it possible to write custom logic for convert button in lead to convert screen,
Example: when I check the customer and click on convert button customer will be created, after created using customer id to create another entity.
If possible how to create custom logic and in which folder path that need to place that javascript file, and how to add in view in lead.json file.Comment
Comment