Pulling MVG Field Value through Scripting
In Accounts > Opportunity, when you create a new opportunity, if Account’s primary contact’s first name and last name should pre-default in opportunity and last Name is a MVG field too then
the following script in Opportunity BC, BusComp_NewRecord can be used to achieve the necessary scenario.
function BusComp_NewRecord ()
{
var AccBO = TheApplication().GetBusObject(“Account”);
var OppBC = AccBO.GetBusComp(“Opportunity”);
var AccBC = AccBO.GetBusComp(“Account”);
var AccId= this.GetFieldValue(“Account Id”);
var ParentBC = this.ParentBusComp();
if (ParentBC != null)
{
if(ParentBC.Name() == “Account”)
{
with(AccBC)
{
ClearToQuery();
SetViewMode(GroupView);
ActivateField(“Account Id”);
ActivateField(“Primary Contact Id”);
SetSearchSpec(“Id”, AccId);
ExecuteQuery(ForwardOnly);
if (FirstRecord())
{
var Cont = AccBC.GetFieldValue(“Primary Contact Id”);
}
}
if (Cont != null)
{
var oMVGBC = this.GetMVGBusComp(“Key Contact Last Name”);
var oAssocBC = oMVGBC.GetAssocBusComp();
with(oAssocBC)
{
ClearToQuery();
SetSearchSpec(“Id”, Cont);
ExecuteQuery(ForwardOnly);
if (FirstRecord())
Associate(NewAfter);
}
oMVGBC.WriteRecord();
}
}
}
}
How can we achieve through configuration.
hai iam visnu iam regular reader from last few days. I need information setting a field readonly depending on another f
field with few example. Thank you for u