Skip to main content
Solved

CaptionVisible property seemingly ignored?

  • 24 July 2024
  • 7 replies
  • 65 views

 Hello! I am new to customization so I apologize if any of this is hard to follow or a strange approach, I am actively learning and very open to input. 

 

Also, please ignore the title as my original post was a bit of a rabbit hole question regarding a misstep I took in solving this issue.

 

My issue is in regards to seemingly hidden business logic that I cannot make sense of. I am currently attempting to add a contact selector to the Shipment (SO302000) that allows me to select a contact and updates the Ship-To-Contact area of the form. In my graph extension, the fields under the ship to contact area are getting updated by those of the contact I choose in the top right. However, this interaction only works when the "Override Contact” checkbox is ticked. I attempted to remove the checkbox, however that makes the fields in this area all permanently disabled. I am confused by this behavior as it seems to me like removing the checkbox should remove the enable/disable behavior of this area, but that is not the case.

 

Any help in investigating this issue further or general advice in understanding the underlying behavior of a form like this is greatly appreciated. Thank you.

 

 

7 replies

Userlevel 7
Badge +9

Unless you use JS I don’t believe you can dynamically change the fields display name. The display names are created when pages is initialized. I have been through this year or two back.

Unless you use JS I don’t believe you can dynamically change the fields display name. The display names are created when pages is initialized. I have been through this year or two back.

Hi Reza, thank you so much for your answer. I realized my post was framed around a workaround as opposed to addressing the underlying problem, and revised it to ask about my initial problem that caused me to arrive at that strange workaround. Let me know if you have any additional insight based on my revised question? Thank you.

Userlevel 7
Badge +9

In this case I am guessing if you look into the Base Graph or its inherited extensions, you will see there is a CacheAttached event that sets the fields in question visibility to False (or maybe a RowSelected). Just copy/paste those CacheAttached event(s) to your graph extension and update the PXUIVisible condition as you want or set it to True and instead add PXUIEnabled property and set the where clause as you wish.

Badge +12

Are you wanting the fields to be constantly enabled or you just want to be able to change them programmatically and you haven’t been able to do so without using the ‘override’?

If I remember correctly, these fields are controlled by the ShipContactID. Have you tried setting that to your chosen contactID?

In this case I am guessing if you look into the Base Graph or its inherited extensions, you will see there is a CacheAttached event that sets the fields in question visibility to False (or maybe a RowSelected). Just copy/paste those CacheAttached event(s) to your graph extension and update the PXUIVisible condition as you want or set it to True and instead add PXUIEnabled property and set the where clause as you wish.

Thank you so much again for your response-- where would I go looking for this base graph and CacheAttached event? 

Are you wanting the fields to be constantly enabled or you just want to be able to change them programmatically and you haven’t been able to do so without using the ‘override’?

If I remember correctly, these fields are controlled by the ShipContactID. Have you tried setting that to your chosen contactID?

Thanks for your response Daryl-- I have not tried updating the ShipContactID but looking at the table in SQL this appears to be a solid route and I will try that now.

On a separate note, for a form like this, where might I find the site logic that dictates these fields are controlled by the ShipContactID? 

Badge +12

Inspect the contact fields to get the data view name:

 

Find the data view in SOShipmentEntry.cs:

 

Notice the association on shipContactID

Reply