Skip to main content
Solved

Site URL stored in database?


hayleehicks
Varsity I
Forum|alt.badge.img

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!

Best answer by Zoltan Febert

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) { }
        }
    }
}

 

View original
Did this topic help you find an answer to your question?

3 replies

dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • 639 replies
  • July 20, 2023

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


Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • 176 replies
  • Answer
  • July 20, 2023

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) { }
        }
    }
}

 


darylbowman
Captain II
Forum|alt.badge.img+13

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings