Hi all, i need to add ship to section to project.
I try this
public class ContractExt : PXCacheExtension<Contract>
{
public static bool IsActive()
{
return true;
}
#region UsrShipContactID
public abstract class usrShipContactID : PX.Data.BQL.BqlInt.Field<usrShipContactID> { }
[PXDBInt]
[PXSelector(typeof(PMShippingContact.contactID), ValidateValue = false)]
[PXUIField(DisplayName = Messages.ShippingContact, Visible = false)]
[PMShippingContact(typeof(Select2<Customer,
InnerJoin<PX.Objects.CR.Standalone.Location, On<PX.Objects.CR.Standalone.Location.bAccountID, Equal<Customer.bAccountID>,
And<PX.Objects.CR.Standalone.Location.locationID, Equal<Customer.defLocationID>>>,
InnerJoin<Contact, On<Contact.bAccountID, Equal<Customer.bAccountID>,
And<Contact.contactID, Equal<Customer.defContactID>>>,
LeftJoin<PMShippingContact, On<PMShippingContact.customerID, Equal<Contact.bAccountID>,
And<PMShippingContact.customerContactID, Equal<Contact.contactID>,
And<PMShippingContact.revisionID, Equal<Contact.revisionID>,
And<PMShippingContact.isDefaultContact, Equal<True>>>>>>>>,
Where<Customer.bAccountID, Equal<Current<Contract.customerID>>>>), typeof(Contract.customerID))]
public virtual int? UsrShipContactID { get; set; }
#endregion
}
public class ProjectEntryExt : PXGraphExtension<ProjectEntry>
{
public static bool IsActive()
{
return true;
}
#region Select
[PXViewName(Messages.ShipToContact)]
public PXSelect<PMShippingContact, Where<PMShippingContact.contactID, Equal<Current<ContractExt.usrShipContactID>>>> ShipTo_Contact;
#endregion
#region EventHendlers
protected virtual void _(Events.RowSelected<PMProject> e, PXRowSelected baseMethod)
{
if (baseMethod != null)
{
baseMethod(e.Cache, e.Args);
}
PMProject row = e.Row;
if (row == null)
return;
bool isProjectEditable = row.IsCompleted != true && row.IsCancelled != true && row.Rejected != true;
ShipTo_Contact.Cache.AllowUpdate = isProjectEditable;
}
#endregion
}
Add filds on aspx. But my field not populated when i choose customer, and i cannot set override checkbox. I try this example from PM307000 screen.