Notifications
Announcements
No record found.
hi can anyone tell me how to Retrieve the currency field value from contact (ie) lookup field in account entity and must show the contact currency field value should update while saving in account entity currency field save using plugins .
You need to write a java-script code
Code will try to get associated currency value which is set on contact record and set the value in account entity form.
Refer following
https://vjcity.blogspot.com/2019/07/how-to-get-and-set-value-for-different.html
https://vjcity.blogspot.com/2019/08/guidelines-to-write-good-javascript.html
If you change the currency value on Account entity, then you can update the currency value on contact entity from java-script.
You should go for Plugin if these operations are being done to CRM from external end.
I am stuck in it i retrieved the account and contact after that i need to retrieve attribute Money from contact and update in Account money Field . here is my plugin code
namespace Moneyretrieveing{ public class Class1 : IPlugin { private object entity; private object targetEntity;
public object guidAccountId { get; private set; }
public void Execute(IServiceProvider serviceProvider) { IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = factory.CreateOrganizationService(context.UserId); QueryExpression queryAccounts = new QueryExpression("account"); queryAccounts.ColumnSet = new ColumnSet(true); EntityCollection Accounts = service.RetrieveMultiple(queryAccounts); QueryExpression queryAccounts1 = new QueryExpression("contact"); queryAccounts1.ColumnSet = new ColumnSet(true); queryAccounts1.Criteria.AddCondition("parentcustomerid", ConditionOperator.Equal, new Guid("7C23E73A-2A4E-EA11-A812-000D3AF26E41")); EntityCollection contacts = service.RetrieveMultiple(queryAccounts); queryAccounts.ColumnSet = new ColumnSet("primarycontactid"); EntityCollection retrieved = service.RetrieveMultiple(queryAccounts1); if (queryAccounts1.Attributes.Contains("new_money")) { Money money = (Money)((contacts.Attributes["new_money"])); } for (int i = 0; i < retrieved.; i++) {
}
} }}
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 170 Super User 2025 Season 2
#ManoVerse 61
Gerardo RenterÃa Ga... 52 Most Valuable Professional