Solved

Site URL stored in database?

  • 20 July 2023
  • 3 replies
  • 78 views

Userlevel 4
Badge

Does anyone know of a table/datafield that stores the site URL? I’m trying to feed parameters into a GI navigation link and have it be transferable across multiple sites without needing to update the URL on each site. Thanks!

icon

Best answer by Zoltan Febert 21 July 2023, 01:53

View original

3 replies

Userlevel 7
Badge +12

I dont believe it is held in any table but done through the IIS. You could always add a field to the Company table to store the URL and do it that way

Userlevel 6
Badge +3

You can use an unbound field, here I added it to the SOOrder table:

using PX.Data;
using PX.Data.Update;
using PX.Objects.SO;

namespace PX.Objects
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class SOOrderSiteURLExt : PXCacheExtension<SOOrder>
{
#region UsrSiteURL
[PXString(255)]
[PXUIField(DisplayName="Site URL")]
[PXUnboundDefault(typeof(SiteURLConstant), PersistingCheck = PXPersistingCheck.Nothing)]
public virtual string UsrSiteURL { get; set; }
public abstract class usrSiteURL : PX.Data.BQL.BqlString.Field<usrSiteURL> { }
#endregion

public class SiteURLConstant : PX.Data.BQL.BqlString.Constant<SiteURLConstant>
{
public SiteURLConstant() : base(PXInstanceHelper.HostName) { }
}
}
}

 

Badge +11

This won’t work with GIs, but an elegant solution for reports is here.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved