create my own module with relationship with contact but no field contact available in studio

Hi,

I have made my own module (via studio) with a relationship one to one with contact.
but I haven’t field “contact” to put this on my edit view.

If, I edit item in my module I see a dashlet contact…but my customer want it directly on the view for create contact when create item…

How to make a field related to this relation ? not simply a relate field …

Thanks,
ps: SCRM 7.10.11

Why “not simply a relate field”, if a relate field matches your description of what you’re trying to achieve? (no subpanel, just a field in the edit view).

cf documentation: “relate field”
https://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Creating_a_Relate_Field/

“Please note that the case record is not displayed on the related contact’s record because relate fields are a one-way relationship.”

So ?

Maybe you tried adding the relate field in the opposite direction of what it should be?

Or do you need it to be a two-way relationship?

Yes, so I use relationship 1to1 for that , but I want put the field on the edit view directly

That is possible but it won’t be easy. It subverts the way SuiteCRM is designed; you would have to save a different record when saving a Contact.

You can override the Contact’s Edit view class in PHP but get ready to face some challenges…

You might find some example online if you’re lucky (probably for some old SugarCRM CE), try searching for adding related field in edit view or something. Good luck. If you get it to work, please come back here and share how you did it.

Ok,
I think make a hook on after_save or before_save on contact
thanks, bye